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  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:   Mon, 4 May 2020 05:23:17 -0600
From:   "Jason A. Donenfeld" <>
To:     Eric Dumazet <>
Cc:     syzbot <>,
        David Miller <>,
        Florian Fainelli <>,
        Greg Kroah-Hartman <>,
        Jamal Hadi Salim <>,
        Jiří Pírko <>,
        Krzysztof Kozlowski <>,
        Jakub Kicinski <>,,, LKML <>,, Netdev <>,
        Shuah Khan <>,,
        Thomas Gleixner <>,,
        Cong Wang <>
Subject: Re: INFO: rcu detected stall in wg_packet_tx_worker

So in spite of this Syzkaller bug being unrelated in the end, I've
continued to think about the stacktrace a bit, and combined with some
other [potentially false alarm] bug reports I'm trying to wrap my head
around, I'm a bit a curious about ideal usage for the udp_tunnel API.

All the uses I've seen in the kernel (including wireguard) follow this pattern:

sock = rcu_dereference(obj->sock);
udp_tunnel_xmit_skb(..., sock, ...);

udp_tunnel_xmit_skb calls iptunnel_xmit, which winds up in the usual
ip_local_out path, which eventually winds up calling some other
devices' ndo_xmit, or gets queued up in a qdisc. Calls to
udp_tunnel_xmit_skb aren't exactly cheap. So I wonder: is holding the
rcu lock for all that time really a good thing?

A different pattern that avoids holding the rcu lock would be:

sock = rcu_dereference(obj->sock);
udp_tunnel_xmit_skb(..., sock, ...);

This seems better, but I wonder if it has some drawbacks too. For
example, sock_put has some comment that warns against incrementing it
in response to forwarded packets. And if this isn't necessary to do,
it's marginally more costly than the first pattern.

Any opinions about this?


Powered by blists - more mailing lists