Bug 24348 - Klogd uses 100% cpu time if it comes across two NULLs in a log
Summary: Klogd uses 100% cpu time if it comes across two NULLs in a log
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: sysklogd   
(Show other bugs)
Version: 7.0
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brian Brock
Depends On:
TreeView+ depends on / blocked
Reported: 2001-01-19 11:17 UTC by John Looney
Modified: 2014-03-17 02:18 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-01-19 12:46:34 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description John Looney 2001-01-19 11:17:47 UTC
This problem affects me quite severely. This patch fixes the problem.
Please make this availible ASAP.

-------- Original Message --------
Subject: [PATCH] klogd busy loop on zero byte (output from 3c59x driver)
Date: Thu, 11 Jan 2001 09:48:57 +0100
From: "Troels Walsted Hansen" <troels@thule.no>
To: linux-kernel@vger.kernel.org, greg@wind.enjellic.com, joey@linux.de

Hi all.

I found a bug in the sysklogd package version 1.4. When it encounters a
byte in the kernel logging output, the text parser enters a busy loop. I
came upon it when the 3c59x driver from kernel 2.4.0 started outputting two
zero bytes for the product code of my laptop's 3Com card. It could be
that the kernel should never output zero bytes in the logging info, but
obviously that will happen from time to time.

I fear this bug might be considered a security issue as well, if the kernel
can be coerced to output a zero byte somehow, all kernel logging will stop.

I have included a patch to klogd.c to correct the issue.

--- sysklogd-1.4.orig/klogd.c   Mon Sep 18 09:34:11 2000
+++ sysklogd-1.4/klogd.c        Thu Jan 11 09:26:10 2001
@@ -739,6 +758,13 @@
                  break;  /* full line_buff or end of input buffer */

+               if( *ptr == '\0' ) /* zero byte */
+               {
+                  ptr++;       /* skip zero byte */
+                  space -= 1;
+                  len   -= 1;
+                  break;
+               }
                 if( *ptr == '\n' )  /* newline */
                    ptr++;      /* skip newline */

Troels Walsted Hansen

Comment 1 Harald Hoyer 2001-01-19 12:46:30 UTC
reassigned to the correct package...

Comment 2 Bill Nottingham 2001-01-19 17:06:40 UTC
Will be fixed in 1.4-5.

Comment 3 David Rees 2001-01-31 09:39:24 UTC
Any idea when the updated sysklogd will be released?  With the release of kernel
2.4.1 a lot of 3c59x  driver users can be affected.  (At least I was!  ;-)  More
info is in these three threads on linux-kernel:

Comment 4 Bill Nottingham 2001-01-31 17:14:34 UTC
It's available in rawhide currently.

Comment 5 David Rees 2001-01-31 17:16:34 UTC
Thanks, I'll take a look and see if it fixes the problem I have in 2.4.1, if you
don't hear back from me it's because it works.  ;-)

Note You need to log in before you can comment on or make changes to this bug.