printk: fix string termination for record_print_text()
stable inclusion from stable-5.10.12 commit d5ac8304e18025a522b5d1d87629e926064ce134 bugzilla: 47876 -------------------------------- commit 08d60e59 upstream. Commit f0e386ee ("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: f0e386ee ("printk: fix buffer overflow potential for print_text()") Reported-by: NSven Schnelle <svens@linux.ibm.com> Signed-off-by: NJohn Ogness <john.ogness@linutronix.de> Signed-off-by: NPetr Mladek <pmladek@suse.com> Link: https://lore.kernel.org/r/20210124202728.4718-1-john.ogness@linutronix.deSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NChen Jun <chenjun102@huawei.com> Acked-by: NXie XiuQi <xiexiuqi@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Showing
想要评论请 注册 或 登录