1
0
Files
Dan Carpenter 520d609f4a UPSTREAM: zram: off by one in read_block_state()
snprintf() returns the number of bytes it would have printed if there
were space.  But it does not count the NUL terminator.  So that means
that if "count == copied" then this has already overflowed by one
character.

This bug likely isn't super harmful in real life.

Link: https://lkml.kernel.org/r/20210916130404.GA25094@kili
Fixes: c0265342bff4 ("zram: introduce zram memory tracking")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit a88e03cf3d190cf46bc4063a9b7efe87590de5f4)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ia10ed8d7287c3dc54ce250cfdd2e8a2bbf831c6f
2022-02-25 21:12:18 +03:00
..
2018-11-15 21:36:32 +03:00
2018-11-15 21:36:32 +03:00
2018-11-15 21:36:32 +03:00
2020-09-12 21:03:26 +03:00