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] [day] [month] [year] [list]
Message-ID: <CACRpkdbqoiCpj=-stVm0fG6xfLvuK+1BCm6PVnROqyKD9UNn_Q@mail.gmail.com>
Date:   Thu, 16 Feb 2023 11:20:31 +0100
From:   Linus Walleij <linus.walleij@...aro.org>
To:     Kees Cook <keescook@...omium.org>
Cc:     Arend van Spriel <aspriel@...il.com>,
        Ard Biesheuvel <ardb@...nel.org>,
        Franky Lin <franky.lin@...adcom.com>,
        Hante Meuleman <hante.meuleman@...adcom.com>,
        Kalle Valo <kvalo@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Johannes Berg <johannes@...solutions.net>,
        "Jason A. Donenfeld" <Jason@...c4.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Darrick J. Wong" <djwong@...nel.org>,
        Colin Ian King <colin.i.king@...il.com>,
        Brian Henriquez <brian.henriquez@...ress.com>,
        linux-wireless@...r.kernel.org,
        brcm80211-dev-list.pdl@...adcom.com,
        SHA-cyfmac-dev-list@...ineon.com, netdev@...r.kernel.org,
        Jason Gunthorpe <jgg@...pe.ca>, linux-kernel@...r.kernel.org,
        linux-hardening@...r.kernel.org
Subject: Re: [PATCH] wifi: brcmfmac: p2p: Introduce generic flexible array
 frame member

On Wed, Feb 15, 2023 at 11:41 PM Kees Cook <keescook@...omium.org> wrote:

> Silence run-time memcpy() false positive warning when processing
> management frames:
>
>   memcpy: detected field-spanning write (size 27) of single field "&mgmt_frame->u" at drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c:1469 (size 26)
>
> Due to this (soon to be fixed) GCC bug[1], FORTIFY_SOURCE (via
> __builtin_dynamic_object_size) doesn't recognize that the union may end
> with a flexible array, and returns "26" (the fixed size of the union),
> rather than the remaining size of the allocation. Add an explicit
> flexible array member and set it as the destination here, so that we
> get the correct coverage for the memcpy().
>
> [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101832
>
> Reported-by: Ard Biesheuvel <ardb@...nel.org>
> Cc: Arend van Spriel <aspriel@...il.com>
> Cc: Franky Lin <franky.lin@...adcom.com>
> Cc: Hante Meuleman <hante.meuleman@...adcom.com>
> Cc: Kalle Valo <kvalo@...nel.org>
> Cc: "David S. Miller" <davem@...emloft.net>
> Cc: Eric Dumazet <edumazet@...gle.com>
> Cc: Jakub Kicinski <kuba@...nel.org>
> Cc: Paolo Abeni <pabeni@...hat.com>
> Cc: Johannes Berg <johannes@...solutions.net>
> Cc: "Jason A. Donenfeld" <Jason@...c4.com>
> Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> Cc: "Darrick J. Wong" <djwong@...nel.org>
> Cc: Colin Ian King <colin.i.king@...il.com>
> Cc: Brian Henriquez <brian.henriquez@...ress.com>
> Cc: linux-wireless@...r.kernel.org
> Cc: brcm80211-dev-list.pdl@...adcom.com
> Cc: SHA-cyfmac-dev-list@...ineon.com
> Cc: netdev@...r.kernel.org
> Signed-off-by: Kees Cook <keescook@...omium.org>

Us having to deal with this kind of stuff is why we need Rust.

Thanks for doing this Kees,
Reviewed-by: Linus Walleij <linus.walleij@...aro.org>

Yours,
Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ