lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdWJczJGLxbFUyO8YDOAcCqdVQmo1zHj5PYtxruL9MzeOg@mail.gmail.com>
Date:   Wed, 27 Apr 2022 09:14:10 +0200
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Kees Cook <keescook@...omium.org>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        kernel test robot <lkp@...el.com>,
        Arnd Bergmann <arnd@...db.de>,
        Dan Li <ashimida@...ux.alibaba.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-hardening@...r.kernel.org
Subject: Re: [PATCH] lkdtm: cfi: Fix type width for masking PAC bits

Hi Kees,

On Wed, Apr 27, 2022 at 2:12 AM Kees Cook <keescook@...omium.org> 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>

Thank you, that fixes the m68k allmodconfig build, so
Tested-by: Geert Uytterhoeven <geert@...ux-m68k.org>

> --- 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))

Not related to this patch, but "| PAGE_OFFSET" is not identical
to "+ PAGE_OFFSET" for large kernel sizes.

More specifically, I'm thinking about platforms where "large" would
be >= 32 MiB:
arch/mips/include/asm/mach-ar7/spaces.h:#define PAGE_OFFSET
_AC(0x94000000, UL)
or >= 128 MiB:
arch/x86/Kconfig:         default 0x78000000 if VMSPLIT_2G_OPT

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ