You need to sign in or sign up before continuing.
printk: ringbuffer: fix line counting
stable inclusion from stable-5.10.11 commit cf3cca5f1580ce846e36c32db2c125199dca2d86 bugzilla: 47621 -------------------------------- [ Upstream commit 668af87f ] Counting text lines in a record simply involves counting the number of newline characters (+1). However, it is searching the full data block for newline characters, even though the text data can be (and often is) a subset of that area. Since the extra area in the data block was never initialized, the result is that extra newlines may be seen and counted. Restrict newline searching to the text data length. Fixes: b6cf8b3f ("printk: add lockless ringbuffer") Signed-off-by: NJohn Ogness <john.ogness@linutronix.de> Reviewed-by: NPetr Mladek <pmladek@suse.com> Acked-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com> Signed-off-by: NPetr Mladek <pmladek@suse.com> Link: https://lore.kernel.org/r/20210113144234.6545-1-john.ogness@linutronix.deSigned-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com> Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
Showing
想要评论请 注册 或 登录