linux-stable/kernel/printk
John Ogness d5ac8304e1 printk: fix string termination for record_print_text()
commit 08d60e5999 upstream.

Commit f0e386ee0c ("printk: fix buffer overflow potential for
print_text()") added string termination in record_print_text().
However it used the wrong base pointer for adding the terminator.
This led to a 0-byte being written somewhere beyond the buffer.

Use the correct base pointer when adding the terminator.

Fixes: f0e386ee0c ("printk: fix buffer overflow potential for print_text()")
Reported-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20210124202728.4718-1-john.ogness@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-30 13:55:20 +01:00
..
braille.c printk: Replace strncmp() with str_has_prefix() 2019-08-16 09:54:08 +02:00
braille.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
console_cmdline.h printk: Fix preferred console selection with multiple matches 2020-02-18 09:34:42 +01:00
internal.h printk: move dictionary keys to dev_printk_info 2020-09-22 11:27:48 +02:00
Makefile printk: add lockless ringbuffer 2020-07-10 08:48:19 +02:00
printk.c printk: fix string termination for record_print_text() 2021-01-30 13:55:20 +01:00
printk_ringbuffer.c printk: ringbuffer: fix line counting 2021-01-27 11:55:08 +01:00
printk_ringbuffer.h printk: avoid and/or handle record truncation 2020-09-30 13:30:28 +02:00
printk_safe.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2020-10-15 15:11:56 -07:00