Debian Bug report logs - #85478
sysklogd: (PATCH) klogd loops infinitely when encountering a \0

version graph

Package: sysklogd; Maintainer for sysklogd is (unknown);

Reported by: roessler@does-not-exist.org

Date: Sat, 10 Feb 2001 12:18:02 UTC

Severity: grave

Tags: fixed, patch

Found in version 1.3-33.1

Fixed in version sysklogd/1.4.1-1

Done: Martin Schulze <joey@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Martin Schulze <joey@debian.org>:
Bug#85478; Package sysklogd. (full text, mbox, link).


Acknowledgement sent to roessler@does-not-exist.org:
New Bug report received and forwarded. Copy sent to Martin Schulze <joey@debian.org>. (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: roessler@does-not-exist.org
To: submit@bugs.debian.org
Subject: sysklogd: (PATCH) klogd loops infinitely when encountering a \0
Date: Sat, 10 Feb 2001 13:12:04 +0100 (CET)
Package: sysklogd
Version: 1.3-33.1
Severity: grave

When klogd's LogLine() function encounters a null byte in state
PARSING_TEXT, it will loop infinitely.  More precisely, copyin()
will treat the null byte as a delimiter - unlike LogLine(), which
will invoke copyin() ever and ever again.

The patch below contains a possible fix for this, by treating a null
byte as a delimiter, equivalent to \n.  This may or may not be the
right approach, but, at least, it prevents klogd from looping
infinitely - and failing to log!  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;
 }



-- System Information
Debian Release: 2.2
Kernel Version: Linux bohr 2.4.1 #34 Sat Feb 3 16:43:17 CET 2001 i686 unknown

Versions of the packages sysklogd depends on:
ii  libc6          2.1.3-17       GNU C Library: Shared libraries and Timezone




Information forwarded to debian-bugs-dist@lists.debian.org, Martin Schulze <joey@debian.org>:
Bug#85478; Package sysklogd. (full text, mbox, link).


Acknowledgement sent to Adam Rice <adam@newsquest.co.uk>:
Extra info received and forwarded to list. Copy sent to Martin Schulze <joey@debian.org>. (full text, mbox, link).


Message #10 received at 85478@bugs.debian.org (full text, mbox, reply):

From: Adam Rice <adam@newsquest.co.uk>
To: 85478@bugs.debian.org
Subject: confirmation and testimonial
Date: Fri, 23 Feb 2001 14:31:53 +0000
Since I upgraded a server running potato to kernel 2.4.1, the klogd process
has gone into an infinite loop on startup (and at regular intervals
thereafter, if restarted). This patch has completely fixed the problem for
me.

I was fortunate that I was able to find this information and produce a
patched sysklogd package myself. There are many potato users out there
running 2.4 that won't know how to do this. A fixed package needs to be
issued ASAP, IMHO.

Adam Rice



Tags added: patch Request was from Tommi Virtanen <tv-nospam-5f1a41@debian.org> to control@bugs.debian.org. (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Martin Schulze <joey@debian.org>:
Bug#85478; Package sysklogd. (full text, mbox, link).


Acknowledgement sent to jicebe@altern.org:
Extra info received and forwarded to list. Copy sent to Martin Schulze <joey@debian.org>. (full text, mbox, link).


Message #17 received at 85478@bugs.debian.org (full text, mbox, reply):

From: jicebe@altern.org
To: Debian Bug Tracking System <85478@bugs.debian.org>
Subject: klogd dead loop
Date: Thu, 1 Mar 2001 01:51:16 +0100
hi,

klogd seems to have a probleme when eating \0
it gets into a dead loop 

i would be good to correct this probleme that i consider grave
=> it can fuck up all the logs on server for exemple



-- System Information
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux zeus 2.4.2 #1 Sat Feb 24 03:14:26 CET 2001 i686

Versions of packages sysklogd depends on:
ii  libc6                         2.2.2-1    GNU C Library: Shared libraries an




Reply sent to Martin Schulze <joey@debian.org>:
You have taken responsibility. (full text, mbox, link).


Notification sent to roessler@does-not-exist.org:
Bug acknowledged by developer. (full text, mbox, link).


Message #22 received at 85478-close@bugs.debian.org (full text, mbox, reply):

From: Martin Schulze <joey@debian.org>
To: 85478-close@bugs.debian.org
Subject: Bug#85478: fixed in sysklogd 1.4.1-1
Date: Mon, 12 Mar 2001 15:06:43 -0500
We believe that the bug you reported is fixed in the latest version of
sysklogd, which has been installed in the Debian FTP archive:

sysklogd_1.4.1-1.dsc
  to pool/main/s/sysklogd/sysklogd_1.4.1-1.dsc
sysklogd_1.4.1-1.diff.gz
  to pool/main/s/sysklogd/sysklogd_1.4.1-1.diff.gz
sysklogd_1.4.1.orig.tar.gz
  to pool/main/s/sysklogd/sysklogd_1.4.1.orig.tar.gz
A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 85478@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Martin Schulze <joey@debian.org> (supplier of updated sysklogd package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Sun, 11 Mar 2001 22:30:53 +0100
Source: sysklogd
Binary: sysklogd klogd
Architecture: source
Version: 1.4.1-1
Distribution: unstable
Urgency: low
Maintainer: Martin Schulze <joey@debian.org>
Changed-By: Martin Schulze <joey@finlandia.infodrom.north.de>
Description: 
 klogd      - Kernel logging daemon
 sysklogd   - System logging daemons
Closes: 32580 35586 41068 49824 62358 66712 67604 70790 71631 72043 72122 74864 74993 76170 76170 76757 79250 80771 84872 85289 85478 85478 87020 87819 88741
Changes: 
 sysklogd (1.4.1-1) unstable; urgency=low
 .
   * New upstream source (closes: Bug#87819, Bug#70790, Bug#32580,
     Bug#62358, Bug#71631)
   * Upstream: Doesn't re-set log-level if not requested (closes:
     Bug#76170, Bug#76170, Bug#85289)
   * Upstream: Ignore zero bytes (closes: Bug#85478, Bug#85478, Bug#41068)
   * Upstream: Corrected documentation for `-s' (closes: Bug#87020)
   * Upstream: test for existence of syslogd-listfiles before calling
     them.  This got lost due to 1.4.0 brokennes which was packaged and
     removed some hours later (closes: Bug#84872, Bug#66712)
   * Applied patch by Tommi Virtanen <tv@debian.org> splitting the package
     into `sysklogd' and `klogd' (closes:Bug#35586, Bug#72043, Bug#74864,
     Bug#72122)
   * Provide / depend on virtual packages system-log-daemon
     and linux-kernel-log-daemon (closes: Bug#67604)
   * Applied patch from Tim Janik <timj@gtk.org> to support `-s pattern' in
     syslogd-listfiles
   * Transition to FHS, i.e. /usr/share/doc instead of /usr/doc and
     /usr/share/man instead of /usr/man (closes:  Bug#79250, Bug#80771)
   * Use --exec for stopping services (closes: Bug#76757)
   * Corrected broken character in klogd.8 (cloes: Bug#75932)
   * Only rotate logfiles with size greater than zero.  This got lost due
     to 1.4.0 brokennes which was packaged and removed some hours later
     (closes: Bug#74993, Bug#49824)
   * Added another note about modificability of cronjobs (closes:
     Bug#88741)
   * Since klogd replaces parts of sysklogd a proper Replaces line is there
Files: 
 f7ea6fd1799c4d26a567e14c416cc9ff 578 base required sysklogd_1.4.1-1.dsc
 d214aa40beabf7bdb0c9b3c64432c774 81784 base required sysklogd_1.4.1.orig.tar.gz
 b23664c0b5c146c46dc3279dce007cb9 16859 base required sysklogd_1.4.1-1.diff.gz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE6rALcW5ql+IAeqTIRAuXkAKC1X9HdcCfIjsZ2HVh83JBDPiG9KQCcDRIi
duTE/7YqpGNA8yc2RW8n3+E=
=33tA
-----END PGP SIGNATURE-----



Tags added: fixed Request was from Martin Schulze <joey@debian.org> to control@bugs.debian.org. (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Apr 15 11:07:36 2023; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.