[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c0bf9c05-9345-b203-611d-411f0237cf26@infradead.org>
Date: Wed, 27 Apr 2022 15:39:04 -0700
From: Randy Dunlap <rdunlap@...radead.org>
To: Kees Cook <keescook@...omium.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: kernel test robot <lkp@...el.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Arnd Bergmann <arnd@...db.de>,
Dan Li <ashimida@...ux.alibaba.com>,
linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH] lkdtm: cfi: Fix type width for masking PAC bits
On 4/26/22 17:12, Kees Cook wrote:
> The masking for PAC bits wasn't handling 32-bit architectures correctly.
> Replace the u64 cast with uintptr_t.
>
> Reported-by: kernel test robot <lkp@...el.com>
> Reported-by: Geert Uytterhoeven <geert@...ux-m68k.org>
> 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@...uxfoundation.org>
> Cc: Arnd Bergmann <arnd@...db.de>
> Signed-off-by: Kees Cook <keescook@...omium.org>
Tested-by: Randy Dunlap <rdunlap@...radead.org>
fwiw
Thanks.
> ---
> drivers/misc/lkdtm/cfi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/misc/lkdtm/cfi.c b/drivers/misc/lkdtm/cfi.c
> index 804965a480b7..666a7f4bc137 100644
> --- 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
--
~Randy
Powered by blists - more mailing lists