lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240912-organic-spoonbill-of-discourse-ad2e6e@leitao>
Date: Thu, 12 Sep 2024 07:19:54 -0700
From: Breno Leitao <leitao@...ian.org>
To: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
Cc: Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
	Jakub Kicinski <kuba@...nel.org>, andrii@...nel.org, ast@...nel.org,
	syzbot <syzbot+08811615f0e17bc6708b@...kaller.appspotmail.com>,
	bpf@...r.kernel.org, daniel@...earbox.net, davem@...emloft.net,
	eddyz87@...il.com, haoluo@...gle.com, hawk@...nel.org,
	john.fastabend@...il.com, jolsa@...nel.org, kpsingh@...nel.org,
	linux-kernel@...r.kernel.org, martin.lau@...ux.dev,
	netdev@...r.kernel.org, sdf@...ichev.me, song@...nel.org,
	syzkaller-bugs@...glegroups.com, yonghong.song@...ux.dev
Subject: Re: [PATCH net-net] tun: Assign missing bpf_net_context.

Hello Vadim,

On Thu, Sep 12, 2024 at 02:32:55PM +0100, Vadim Fedorenko wrote:
> On 12/09/2024 14:17, Breno Leitao wrote:
> > @@ -72,6 +73,7 @@ static netdev_tx_t netkit_xmit(struct sk_buff *skb, struct net_device *dev)
> >   	struct net_device *peer;
> >   	int len = skb->len;
> > +	bpf_net_ctx = bpf_net_ctx_set(&__bpf_net_ctx);
> >   	rcu_read_lock();
> 
> Hi Breno,
> 
> looks like bpf_net_ctx should be set under rcu read lock...

Why exactly?

I saw in some examples where bpf_net_ctx_set() was set inside the
rcu_read_lock(), but, I was not able to come up with justification to do
the same. Would you mind elaborating why this might be needed inside the
lock?

Thanks for the review,
--breno

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ