OSDN Git Service

lkdtm/bugs: Check that a per-task stack canary exists
authorKees Cook <keescook@chromium.org>
Fri, 22 Oct 2021 22:38:26 +0000 (15:38 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Oct 2021 07:13:46 +0000 (09:13 +0200)
commitd46e58ef776bc6548b17b563ec4a8ed30c6643da
tree9310e618184c42ca467919ae2818163f53a004ac
parent149538cd55cad138b6eaa4dc4735c28f53eb5d32
lkdtm/bugs: Check that a per-task stack canary exists

Introduce REPORT_STACK_CANARY to check for differing stack canaries
between two processes (i.e. that an architecture is correctly implementing
per-task stack canaries), using the task_struct canary as the hint to
locate in the stack. Requires that one of the processes being tested
not be pid 1.

Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20211022223826.330653-3-keescook@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/lkdtm/bugs.c
drivers/misc/lkdtm/core.c
drivers/misc/lkdtm/lkdtm.h
tools/testing/selftests/lkdtm/config
tools/testing/selftests/lkdtm/tests.txt