projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fc525d6
)
fortify: Fix incorrect reporting of read buffer size
author
Kees Cook
<kees@kernel.org>
Tue, 29 Jul 2025 23:18:25 +0000
(16:18 -0700)
committer
Kees Cook
<kees@kernel.org>
Wed, 30 Jul 2025 00:19:29 +0000
(17:19 -0700)
When FORTIFY_SOURCE reports about a run-time buffer overread, the wrong
buffer size was being shown in the error message. (The bounds checking
was correct.)
Fixes:
3d965b33e40d
("fortify: Improve buffer overflow reporting")
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link:
https://lore.kernel.org/r/20250729231817.work.023-kees@kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>
include/linux/fortify-string.h
patch
|
blob
|
history
diff --git
a/include/linux/fortify-string.h
b/include/linux/fortify-string.h
index
e4ce1ca
..
b3b53f8
100644
(file)
--- a/
include/linux/fortify-string.h
+++ b/
include/linux/fortify-string.h
@@
-596,7
+596,7
@@
__FORTIFY_INLINE bool fortify_memcpy_chk(__kernel_size_t size,
if (p_size != SIZE_MAX && p_size < size)
fortify_panic(func, FORTIFY_WRITE, p_size, size, true);
else if (q_size != SIZE_MAX && q_size < size)
- fortify_panic(func, FORTIFY_READ,
p
_size, size, true);
+ fortify_panic(func, FORTIFY_READ,
q
_size, size, true);
/*
* Warn when writing beyond destination field size.