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]
Date:   Wed, 15 Mar 2023 17:34:20 -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 5:23 PM Eric Dumazet <edumazet@...gle.com> wrote:
>
> Oh I might have been fooled, because of course we can not use sk for
> the macro parameter name.

Heh. Yeah, that will rename the 'sk' member name too, and cause some
*very* strange errors.

> Basically something like this should work just fine

Yup.

I'm testing it on the current git tree, and I'm finding a number of
random issues, but it looks manageable. Attached is what I ended up
with.

You have presumably already fixed these issues in your tree.

Btw, it's very much things like 'tcp_sk()' too, and doing that with

   #define tcp_sk(ptr) container_of_const(ptr, struct tcp_sock,
inet_conn.icsk_inet.sk)

actually shows some fundamental problems. For example, we have
tcp_synq_overflow() that takes a const sk pointer, but then it does

        WRITE_ONCE(tcp_sk(sk)->rx_opt.ts_recent_stamp, now);

which is a big no-no and writes to that sock thing.

I didn't even try any of the other 'xyzzy_sk()' conversions.

                   Linus

View attachment "patch.diff" of type "text/x-patch" (4133 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ