projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f861d36
)
lkdtm: cfi: Fix type width for masking PAC bits
author
Kees Cook
<keescook@chromium.org>
Wed, 27 Apr 2022 00:12:26 +0000
(17:12 -0700)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Mon, 9 May 2022 13:40:31 +0000
(15:40 +0200)
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: 2e53b877dc12 ("lkdtm: Add CFI_BACKWARD to test ROP mitigations")
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link:
https://lore.kernel.org/r/20220427001226.1224704-1-keescook@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/lkdtm/cfi.c
patch
|
blob
|
history
diff --git
a/drivers/misc/lkdtm/cfi.c
b/drivers/misc/lkdtm/cfi.c
index 804965a480b765c2715731cd4f3229eda092619c..666a7f4bc1375acb40d34a3fccd3e593d2e821a9 100644
(file)
--- a/
drivers/misc/lkdtm/cfi.c
+++ b/
drivers/misc/lkdtm/cfi.c
@@
-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