[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <64ca4c9b.5d0a0220.2f302.b8de@mx.google.com>
Date: Wed, 2 Aug 2023 14:16:54 +0200
From: Andrew Kanner <andrew.kanner@...il.com>
To: David Ahern <dsahern@...il.com>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, jasowang@...hat.com, netdev@...r.kernel.org,
brouer@...hat.com, jbrouer@...hat.com, john.fastabend@...il.com,
linux-kernel@...r.kernel.org,
linux-kernel-mentees@...ts.linuxfoundation.org,
syzbot+f817490f5bd20541b90a@...kaller.appspotmail.com
Subject: Re: [PATCH v4 1/2] drivers: net: prevent tun_build_skb() to exceed
the packet size limit
On Tue, Aug 01, 2023 at 07:07:39PM -0600, David Ahern wrote:
> On 8/1/23 4:07 PM, Andrew Kanner wrote:
> > @@ -1594,7 +1597,13 @@ static bool tun_can_build_skb(struct tun_struct *tun, struct tun_file *tfile,
> > if (zerocopy)
> > return false;
> >
> > - if (SKB_DATA_ALIGN(len + TUN_RX_PAD) +
> > + rcu_read_lock();
> > + xdp_prog = rcu_dereference(tun->xdp_prog);
> > + if (xdp_prog)
> > + pad += XDP_PACKET_HEADROOM;
> > + rcu_read_unlock();
>
>
> since you do not care about the actual xdp_prog (only that one is set) I
> believe you can use rcu_access_pointer here.
Good point. Thanks, David.
I'll resend both as v5.
The correct cc-list for PATCH 2/2 is also needed. It fixes
net/core/filter.c instead of drivers/net/tun.c now.
pw-bot: changes-requested
--
Andrew Kanner
Powered by blists - more mailing lists