FORTIFY_SOURCE: detect intra-object overflow in string functions
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest2 patches 0 repliesNew
- v11 patch 2 repliesSuperseded
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | string.h: detect intra-object overflow in fortified string functionsinclude/ | +16 | 0 replies | |
| 2/2 | lkdtm: tests for FORTIFY_SOURCEdrivers/ drivers/ drivers/ | +55 | 0 replies |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Kees Cook |
|---|---|
| 1/2 | R-b |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/2] FORTIFY_SOURCE: detect intra-object overflow in string functions
When the fortify feature was first introduced in commit 6974f0c4555e ("include/linux/string.h: add the option of fortified string.h functions"), Daniel Micay observed:
* It should be possible to optionally use __builtin_object_size(x, 1) for some functions (C strings) to detect intra-object overflows (like glibc's _FORTIFY_SOURCE=2), but for now this takes the conservative approach to avoid likely compatibility issues.
This patch set:
- converts a number of string functions to use __builtin_object_size(x, 1)
- adds LKDTM tests for both types of fortified function.
This change passes an allyesconfig on powerpc and x86, and an x86 kernel built with it survives running with syz-stress from syzkaller, so it seems safe so far.
Daniel Axtens (2):
string.h: detect intra-object overflow in fortified string functions
lkdtm: tests for FORTIFY_SOURCE
drivers/misc/lkdtm/bugs.c | 51 ++++++++++++++++++++++++++++++++++++++ drivers/misc/lkdtm/core.c | 2 ++ drivers/misc/lkdtm/lkdtm.h | 2 ++ include/linux/string.h | 27 ++++++++++++-------- 4 files changed, 71 insertions(+), 11 deletions(-)
Signature · 1 line
2.20.1