[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4544483dd904540cdda04db3d2e2e70bad84efda.camel@redhat.com>
Date: Wed, 07 Oct 2020 16:09:00 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: Eric Dumazet <eric.dumazet@...il.com>,
"David S . Miller" <davem@...emloft.net>
Cc: netdev <netdev@...r.kernel.org>, Eric Dumazet <edumazet@...gle.com>
Subject: Re: [PATCH net] macsec: avoid use-after-free in
macsec_handle_frame()
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
Powered by blists - more mailing lists