Commit 77acbdc0 authored by Kees Cook's avatar Kees Cook Committed by Greg Kroah-Hartman

lkdtm: cfi: Fix type width for masking PAC bits

The masking for PAC bits wasn't handling 32-bit architectures correctly.
Replace the u64 cast with uintptr_t.

Link: https://lore.kernel.org/lkml/CAMuHMdVz-J-1ZQ08u0bsQihDkcRmEPrtX5B_oRJ+Ns5jrasnUw@mail.gmail.com
Fixes: 2e53b877 ("lkdtm: Add CFI_BACKWARD to test ROP mitigations")
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Reported-by: default avatarkernel test robot <lkp@intel.com>
Reported-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Tested-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Tested-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20220427001226.1224704-1-keescook@chromium.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f861d36e
......@@ -59,7 +59,7 @@ static void lkdtm_CFI_FORWARD_PROTO(void)
#endif
#define no_pac_addr(addr) \
((__force __typeof__(addr))((__force u64)(addr) | PAGE_OFFSET))
((__force __typeof__(addr))((uintptr_t)(addr) | PAGE_OFFSET))
/* The ultimate ROP gadget. */
static noinline __no_ret_protection
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment