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]
Date: Tue, 28 Nov 2023 23:27:29 +0100
From: Lorenzo Bianconi <lorenzo@...nel.org>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Lorenzo Bianconi <lorenzo.bianconi@...hat.com>, netdev@...r.kernel.org,
	davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
	bpf@...r.kernel.org, hawk@...nel.org, toke@...hat.com
Subject: Re: [PATCH net-next] xdp: add multi-buff support for xdp running in
 generic mode

> On Tue, 28 Nov 2023 18:29:20 +0100 Lorenzo Bianconi wrote:
> > @Jakub: iirc we were discussing something similar for veth [0].
> > Here pskb_expand_head() reallocates skb paged data (skb_shinfo()->frags[])
> > just if the skb is cloned and if it is zero-copied [1] while in skb_cow_data()
> > we always reallocate the paged area if skb_shinfo()->nr_frags is set [2].
> > Since the eBPF program can theoretically modify paged data, I would say we
> > should do the same we did for veth even here, right?
> 
> Yes, don't we allow writes to fragments in XDP based on the assumption
> that it runs on Rx so that paged data must not be zero copy?
> bpf_xdp_store_bytes() doesn't seem to have any checks which would
> stop it from writing fragments, as far as I can see.

do you mean in the skb use-case we could write to fragments (without copying
them) if the skb is not cloned and the paged area is not 'zero-copied'?
With respect to this patch it would mean we can rely on pskb_expand_head() to
reallocate the skb and to covert it to a xdp_buff and we do not need to explicitly
reallocate fragments as we currently do for veth in veth_convert_skb_to_xdp_buff() [0].
Is my understanding correct or am I missing something?

Regards,
Lorenzo

[0] https://elixir.bootlin.com/linux/v6.6.2/source/drivers/net/veth.c#L738

> 
> I don't see how we can ever correctly support this form of mbuf for veth
> or generic XDP :(

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ