Vulnerability Note VU#249579

klogd does not adequately handle NULL byte when parsing text using LogLine( )

Original Release date: 24 Jul 2001 | Last revised: 09 Apr 2003

Overview

There is a denial-of-service vulnerability in certain distributions of the Linux kernel logging daemon (klogd) which could allow an attacker to cause klogd to hang.

Description

The Linux kernel logging daemon (klogd) can be forced to hang if it receives a null byte in a log message from the Linux kernel. Please see the following bug report for more information:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=85478

Impact

This vulnerability causes klogd to go into an infinite loop, thus preventing further kernel log messages from being written to disk.

Solution

Upgrade to latest version of klogd for your Linux distribution.

The following workaround is taken from http://bugs.debian.org/cgi-bin/bugreport.cgi?archive=no&bug=85478:
The patch below contains a possible fix for this, by treating a null byte as a delimiter, equivalent to \n. Additionally, the patch prevents LogLine from being invoked with a negative counter as an argument.

diff -u sysklogd-1.3.orig/klogd.c sysklogd-1.3/klogd.c
--- sysklogd-1.3.orig/klogd.c Sat Feb 10 13:04:06 2001
+++ sysklogd-1.3/klogd.c Sat Feb 10 12:58:11 2001
@@ -707,7 +707,7 @@
break; /* full line_buff or end of input buffer */
}

- if( *ptr == '\n' ) /* newline */
+ if( *ptr == '\n' || *ptr == '\0') /* newline or null terminator */
{
ptr++; /* skip newline */
space -= 1;
@@ -877,8 +877,10 @@
fprintf(stderr, "klogd: Error return from sys_sycall: " \
"%d - %s\n", errno, strerror(errno));
}
-
- LogLine(log_buffer, rdcnt);
+ else
+ LogLine(log_buffer, rdcnt);
+
+
return;
}

@@ -902,8 +904,8 @@
Syslog(LOG_ERR, "Cannot read proc file system: %d - %s.", \
errno, strerror(errno));
}
-
- LogLine(log_buffer, rdcnt);
+ else
+ LogLine(log_buffer, rdcnt);

return;
}

Systems Affected (Learn More)

VendorStatusDate NotifiedDate Updated
DebianAffected10 Feb 200120 Jul 2001
ImmunixAffected10 Feb 200120 Jul 2001
If you are a vendor and your product is affected, let us know.

CVSS Metrics (Learn More)

Group Score Vector
Base N/A N/A
Temporal N/A N/A
Environmental N/A N/A

References

Credit

This vulnerability was discovered by Thomas Roessler <roessler@does-not-exist.org> and was reported to the bugs.debian.org mailing list on February 10, 2001.

This document was written by Ian A. Finlay

Other Information

  • CVE IDs: CVE-2001-0738
  • Date Public: 10 Feb 2001
  • Date First Published: 24 Jul 2001
  • Date Last Updated: 09 Apr 2003
  • Severity Metric: 1.83
  • Document Revision: 51

Feedback

If you have feedback, comments, or additional information about this vulnerability, please send us email.