linux-stable/fs/jbd2
Andy Shevchenko 7afb6d8fa8 jbd2: Avoid printing outside the boundary of the buffer
Theoretically possible that "%pg" will take all room for the j_devname
and hence the "-%lu" will go outside the boundary due to unconditional
sprintf() in use. To make this code more robust, replace two sequential
s*printf():s by a single call and then replace forbidden character.
It's possible to do this way, because '/' won't ever be in the result
of "-%lu".

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20230605170553.7835-2-andriy.shevchenko@linux.intel.com
2023-06-05 15:31:12 -07:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
checkpoint.c jbd2: rename jbd_debug() to jbd2_debug() 2022-08-02 23:52:19 -04:00
commit.c jbd2,ocfs2: move jbd2_journal_submit_inode_data_buffers to ocfs2 2023-01-18 17:12:51 -08:00
journal.c jbd2: Avoid printing outside the boundary of the buffer 2023-06-05 15:31:12 -07:00
recovery.c - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in 2022-10-10 17:53:04 -07:00
revoke.c jbd2: rename jbd_debug() to jbd2_debug() 2022-08-02 23:52:19 -04:00
transaction.c jdb2: Don't refuse invalidation of already invalidated buffers 2023-04-14 19:38:50 -04:00