From: Andrew Kanner <andrew.kanner@gmail.com>
To: David Ahern <dsahern@gmail.com>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, jasowang@redhat.com, netdev@vger.kernel.org,
brouer@redhat.com, jbrouer@redhat.com, john.fastabend@gmail.com,
linux-kernel@vger.kernel.org,
linux-kernel-mentees@lists.linuxfoundation.org,
syzbot+f817490f5bd20541b90a@syzkaller.appspotmail.com
Subject: Re: [PATCH v4 1/2] drivers: net: prevent tun_build_skb() to exceed the packet size limit
Date: Wed, 2 Aug 2023 14:16:54 +0200 [thread overview]
Message-ID: <64ca4c9b.5d0a0220.2f302.b8de@mx.google.com> (raw)
In-Reply-To: <3fa4d25d-7fea-d25b-fa83-4ada2c550725@gmail.com>
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
next prev parent reply other threads:[~2023-08-02 12:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-01 22:07 [PATCH v4 1/2] drivers: net: prevent tun_build_skb() to exceed the packet size limit Andrew Kanner
2023-08-01 22:07 ` [PATCH v4 2/2] net: core: remove unnecessary frame_sz check in bpf_xdp_adjust_tail() Andrew Kanner
2023-08-02 13:56 ` Jesper Dangaard Brouer
2023-08-03 3:20 ` Jason Wang
2023-08-03 18:06 ` Andrew Kanner
2023-08-02 1:07 ` [PATCH v4 1/2] drivers: net: prevent tun_build_skb() to exceed the packet size limit David Ahern
2023-08-02 12:16 ` Andrew Kanner [this message]
2023-08-02 14:13 ` Jesper Dangaard Brouer
2023-08-03 3:19 ` Jason Wang
2023-08-03 17:53 ` Andrew Kanner
2023-08-04 9:30 ` Jesper Dangaard Brouer
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=64ca4c9b.5d0a0220.2f302.b8de@mx.google.com \
--to=andrew.kanner@gmail.com \
--cc=brouer@redhat.com \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=edumazet@google.com \
--cc=jasowang@redhat.com \
--cc=jbrouer@redhat.com \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=syzbot+f817490f5bd20541b90a@syzkaller.appspotmail.com \
/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