From: "David Woodhouse" <dwmw2@infradead.org>
To: "Eric Dumazet" <eric.dumazet@gmail.com>
Cc: "David Woodhouse" <dwmw2@infradead.org>,
netdev@vger.kernel.org, ldir@darbyshire-bryant.me.uk
Subject: Re: [PATCH] atm: Preserve value of skb->truesize when accounting to vcc
Date: Sat, 16 Jun 2018 15:19:48 -0000 [thread overview]
Message-ID: <10912b7594637a95567a2ffe3ef5dbc1.squirrel@twosheds.infradead.org> (raw)
In-Reply-To: <62fbc51a-4738-6c21-8c53-d84fee7a9bbd@gmail.com>
>> Commit 14afee4b609 ("net: convert sock.sk_wmem_alloc from atomic_t to
>> refcount_t") did exactly what it was intended to do, and turned this
>> mostly-theoretical problem into a real one, causing PPPoATM to fail
>> immediately as sk_wmem_alloc underflows and atm_may_send() *immediately*
>> starts refusing to allow new packets.
...
>> Fixes: 14afee4b ("net: convert sock.sk_wmem_alloc from atomic_t to
>> refcount_t")
>
> This Fixes tag shoots the messenger really.
A little bit, yes. The text hopefully made that clear.
> I suggest to instead use :
>
> Fixes: 158f323b9868 ("net: adjust skb->truesize in pskb_expand_head()")
>
> Because even without the conversion to refcount_t, we could have a LOCKDEP
> splat in :
>
> filter = rcu_dereference_check(sk->sk_filter,
> atomic_read(&sk->sk_wmem_alloc) == 0);
>
> Note that some places make a further check even when LOCKDEP is not used.
>
> net/ipv4/af_inet.c:154: WARN_ON(refcount_read(&sk->sk_wmem_alloc));
> net/iucv/af_iucv.c:405: WARN_ON(refcount_read(&sk->sk_wmem_alloc));
> net/key/af_key.c:112: WARN_ON(refcount_read(&sk->sk_wmem_alloc));
> net/netlink/af_netlink.c:410: WARN_ON(refcount_read(&sk->sk_wmem_alloc));
> net/packet/af_packet.c:1286: WARN_ON(refcount_read(&sk->sk_wmem_alloc));
> net/rxrpc/af_rxrpc.c:852: WARN_ON(refcount_read(&sk->sk_wmem_alloc));
> net/unix/af_unix.c:490: WARN_ON(refcount_read(&sk->sk_wmem_alloc));
>
>
> We might factorize these checks into __sk_destruct()
>
How many of those were likely to trigger in practice on an ATM VCC though?
If we are taking the Fixes: tag as a hint about which stable kernels we
might want to backport to, rather than a moral assignment of blame, then
14afee4b is probably not the worst place to point it. But I don't mind
much...
--
dwmw2
next prev parent reply other threads:[~2018-06-16 15:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-16 10:55 [PATCH] atm: Preserve value of skb->truesize when accounting to vcc David Woodhouse
2018-06-16 12:57 ` Eric Dumazet
2018-06-16 15:19 ` David Woodhouse [this message]
2018-06-16 20:52 ` David Woodhouse
2018-06-16 23:27 ` David Miller
2018-07-05 8:44 ` David Woodhouse
2018-07-05 11:23 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=10912b7594637a95567a2ffe3ef5dbc1.squirrel@twosheds.infradead.org \
--to=dwmw2@infradead.org \
--cc=eric.dumazet@gmail.com \
--cc=ldir@darbyshire-bryant.me.uk \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).