lkml.org 
[lkml]   [2023]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v4 1/2] drivers: net: prevent tun_build_skb() to exceed the packet size limit
From
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.

\
 
 \ /
  Last update: 2023-08-02 03:08    [W:1.517 / U:1.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site