Skip to content

fortify: Minor changes to strlen() and strnlen()

[email protected] linux-hardening lkml llvm oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 15 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3fortify: replace __compiletime_lessthan() with statically_true()include/linux/fortify-string.h+21 -261 reply
2/3fortify: Optimise strnlen()include/linux/fortify-string.h lib/tests/fortify_kunit.c+26 -2611 replies
3/3fortify: Simplify strlen() logicinclude/linux/fortify-string.h+13 -73 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH next 0/3] fortify: Minor changes to strlen() and strnlen()

From: David Laight <[email protected]>

Looking at the object code for strnlen() of constant strings showed that it sometimes contained an 'impossible to reach' error message.

Simplify some bits and adjust the condition so that the compiler optimises it away.

David Laight (3):
fortify: replace __compiletime_lessthan() with statically_true()
fortify: Optimise strnlen()
fortify: Simplify strlen() logic

 include/linux/fortify-string.h | 109 +++++++++++++++++----------------
 lib/tests/fortify_kunit.c      |   8 +--
 2 files changed, 59 insertions(+), 58 deletions(-)
Signature · 1 line
2.39.5