mbox series

[0/2] fortify: Add run-time WARN for cross-field memcpy()

Message ID 20220901065914.1417829-1-keescook@chromium.org (mailing list archive)
Headers show
Series fortify: Add run-time WARN for cross-field memcpy() | expand

Message

Kees Cook Sept. 1, 2022, 6:59 a.m. UTC
Hi,

I'm hoping to at least get this into -next to see how noisy it ends up
being. I've tracked down several false positives that are getting fixed,
but I'd like to see this get wider testing. For details, see patch 1,
but this is the run-time half of the recent FORTIFY_SOURCE memcpy()
bounds checking work.

-Kees

Kees Cook (2):
  fortify: Add run-time WARN for cross-field memcpy()
  lkdtm: Update tests for memcpy() run-time warnings

 drivers/misc/lkdtm/fortify.c            | 96 +++++++++++++++++++++----
 include/linux/fortify-string.h          | 70 +++++++++++++++++-
 tools/testing/selftests/lkdtm/tests.txt |  8 ++-
 3 files changed, 155 insertions(+), 19 deletions(-)

Comments

Nathan Chancellor Sept. 1, 2022, 8:05 p.m. UTC | #1
Hi Kees,

On Wed, Aug 31, 2022 at 11:59:12PM -0700, Kees Cook wrote:
> Hi,
> 
> I'm hoping to at least get this into -next to see how noisy it ends up
> being. I've tracked down several false positives that are getting fixed,
> but I'd like to see this get wider testing. For details, see patch 1,
> but this is the run-time half of the recent FORTIFY_SOURCE memcpy()
> bounds checking work.
> 
> -Kees
> 
> Kees Cook (2):
>   fortify: Add run-time WARN for cross-field memcpy()
>   lkdtm: Update tests for memcpy() run-time warnings
> 
>  drivers/misc/lkdtm/fortify.c            | 96 +++++++++++++++++++++----
>  include/linux/fortify-string.h          | 70 +++++++++++++++++-
>  tools/testing/selftests/lkdtm/tests.txt |  8 ++-
>  3 files changed, 155 insertions(+), 19 deletions(-)
> 
> -- 
> 2.34.1
> 

I took these two patches for a spin on four of my test machines (one
arm64 and three x86_64, kernel compiled with tip of tree clang) and I
did not see any warnings. Not to say there are not any lurking but my
set of drivers did not appear to trigger anything.

Tested-by: Nathan Chancellor <nathan@kernel.org>

Cheers,
Nathan