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]
Date:   Wed, 15 Mar 2023 17:02:13 -0700
From:   Linus Torvalds <torvalds@...ux-foundation.org>
To:     Eric Dumazet <edumazet@...gle.com>
Cc:     Jakub Kicinski <kuba@...nel.org>,
        "David S . Miller" <davem@...emloft.net>,
        Paolo Abeni <pabeni@...hat.com>,
        David Ahern <dsahern@...nel.org>, netdev@...r.kernel.org,
        eric.dumazet@...il.com,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH net-next 1/8] inet: preserve const qualifier in inet_sk()

On Wed, Mar 15, 2023 at 4:56 PM Eric Dumazet <edumazet@...gle.com> wrote:
>
> container_of_const() does not detect this bug at compile time, does it ?
>
> struct sk_buff *skb = ...;
>
> struct inet_sk *inet = inet_sk(skb);

You didn't actually test it, did you?

I get about 40 lines of error messages about how broken that is, starting with

   ./include/linux/build_bug.h:78:41: error: static assertion failed:
"pointer type mismatch in container_of()"

exactly because yes, 'container_of()' is very pissy indeed about bogus
conversions.

You can only convert a named member into a containing structure, and
'inet_sk' does not contain a member named 'sk' that is of type 'struct
skb_buff'.

            Linus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ