From: Paolo Abeni <pabeni@redhat.com>
To: Eric Dumazet <eric.dumazet@gmail.com>,
"David S . Miller" <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>, Eric Dumazet <edumazet@google.com>
Subject: Re: [PATCH net] macsec: avoid use-after-free in macsec_handle_frame()
Date: Wed, 07 Oct 2020 16:09:00 +0200 [thread overview]
Message-ID: <4544483dd904540cdda04db3d2e2e70bad84efda.camel@redhat.com> (raw)
In-Reply-To: <20201007084246.4068317-1-eric.dumazet@gmail.com>
Hi,
On Wed, 2020-10-07 at 01:42 -0700, Eric Dumazet wrote:
> @@ -1232,9 +1233,10 @@ static rx_handler_result_t macsec_handle_frame(struct sk_buff **pskb)
> macsec_rxsc_put(rx_sc);
>
> skb_orphan(skb);
> + len = skb->len;
> ret = gro_cells_receive(&macsec->gro_cells, skb);
> if (ret == NET_RX_SUCCESS)
> - count_rx(dev, skb->len);
> + count_rx(dev, len);
> else
> macsec->secy.netdev->stats.rx_dropped++;
I'm sorry I'm low on coffee, but I can't see the race?!? here we are in
a BH section, and the above code dereference the skb only if it's has
been enqueued into the gro_cells napi. It could be dequeued/dropped
only after we leave this section ?!?
Thanks,
Paolo
next prev parent reply other threads:[~2020-10-07 14:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-07 8:42 [PATCH net] macsec: avoid use-after-free in macsec_handle_frame() Eric Dumazet
2020-10-07 14:09 ` Paolo Abeni [this message]
2020-10-07 14:31 ` Eric Dumazet
2020-10-07 14:45 ` Paolo Abeni
2020-10-07 15:54 ` Eric Dumazet
2020-10-08 20:00 ` patchwork-bot+netdevbpf
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=4544483dd904540cdda04db3d2e2e70bad84efda.camel@redhat.com \
--to=pabeni@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--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).