zram-off-by-one-in-read_block_state.patch removed from -mm tree
The patch titled
Subject: zram: off by one in read_block_state()
has been removed from the -mm tree. Its filename was
zram-off-by-one-in-read_block_state.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Dan Carpenter <[email protected]>
Subject: 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.
Fixes c0265342bff4 ("zram: introduce zram memory tracking")
Signed-off-by Dan Carpenter <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Sergey Senozhatsky <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
drivers/block/zram/zram_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/zram/zram_drv.c renamed from drivers/block/zram/zram_drv.c~zram-off-by-one-in-read_block_state +1 -1
@@ -910,7 +910,7 @@ static ssize_t read_block_state(struct fzram_test_flag (zram, index,ZRAM_HUGE ) ?'h' :'.' , zram_test_flag(zram, index, ZRAM_IDLE) ? 'i' : '.'); -if (count < copied) { +if (count <= copied) {zram_slot_unlock (zram, index);break ; }
_
Patches currently in -mm which might be from [email protected] are