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: <CANn89iL9t78ta1JMecG7b8A+mNytfBy4_wXXYRD2Rosz8iFpVg@mail.gmail.com>
Date:   Wed, 16 Oct 2019 16:35:01 -0700
From:   Eric Dumazet <edumazet@...gle.com>
To:     David Howells <dhowells@...hat.com>
Cc:     "David S . Miller" <davem@...emloft.net>,
        netdev <netdev@...r.kernel.org>,
        Eric Dumazet <eric.dumazet@...il.com>,
        Jakub Kicinski <jakub.kicinski@...ronome.com>
Subject: Re: [PATCH net] rxrpc: use rcu protection while reading sk->sk_user_data

On Wed, Oct 16, 2019 at 4:24 PM David Howells <dhowells@...hat.com> wrote:
>
> Eric Dumazet <edumazet@...gle.com> wrote:
>
> > We need to extend the rcu_read_lock() section in rxrpc_error_report()
> > and use rcu_dereference_sk_user_data() instead of plain access
> > to sk->sk_user_data to make sure all rules are respected.
>
> Should I take it that the caller won't be guaranteed to be holding the RCU
> read lock?
>
> Looking at __udp4_lib_err(), that calls __udp4_lib_err_encap(), which calls
> __udp4_lib_err_encap_no_sk(), which should throw a warning if the RCU read
> lock is not held.
>
> Similarly, icmp_socket_deliver() and icmpv6_notify() should also throw a
> warning before calling ->err_handler().
>
> Does that mean something further up the CPU stack is going to be holding the
> RCU read lock?

Note  that before my patch, the code had a rcu_read_lock()/rcu_read_unlock(),
so I only extended it.

I am not sure that all callers already have rcu_read_lock()  held, I
prefer leaving this matter for net-next

>
> David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ