summaryrefslogtreecommitdiff
path: root/kernel/auditsc.c
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2012-08-10 23:07:09 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-08-12 22:25:50 +0400
commite3756477aec028427fec767957c0d4b6cfb87208 (patch)
treec92974b2e75dea5f050b2060cf181a44c2d49643 /kernel/auditsc.c
parentf4ba394c1b02e7fc2179fda8d3941a5b3b65efb6 (diff)
downloadlinux-e3756477aec028427fec767957c0d4b6cfb87208.tar.xz
printk: Fix calculation of length used to discard records
While tracking down a weird buffer overflow issue in a program that looked to be sane, I started double checking the length returned by syslog(SYSLOG_ACTION_READ_ALL, ...) to make sure it wasn't overflowing the buffer. Sure enough, it was. I saw this in strace: 11339 syslog(SYSLOG_ACTION_READ_ALL, "<5>[244017.708129] REISERFS (dev"..., 8192) = 8279 It turns out that the loops that calculate how much space the entries will take when they're copied don't include the newlines and prefixes that will be included in the final output since prev flags is passed as zero. This patch properly accounts for it and fixes the overflow. CC: stable@kernel.org Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/auditsc.c')
0 files changed, 0 insertions, 0 deletions