diff options
| author | Andy Shevchenko <[email protected]> | 2023-06-05 17:05:51 +0000 |
|---|---|---|
| committer | Kees Cook <[email protected]> | 2023-06-05 22:31:12 +0000 |
| commit | 7afb6d8fa81fd8d332f70ead5e35d8c90abb8165 (patch) | |
| tree | c843ef681c8a20274965d8c4482ee2e1ba9ef680 /lib/debugobjects.c | |
| parent | checkpatch: Check for 0-length and 1-element arrays (diff) | |
| download | kernel-7afb6d8fa81fd8d332f70ead5e35d8c90abb8165.tar.gz kernel-7afb6d8fa81fd8d332f70ead5e35d8c90abb8165.zip | |
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 <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'lib/debugobjects.c')
0 files changed, 0 insertions, 0 deletions
