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:   Fri, 24 Jan 2020 06:52:44 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Daniel Borkmann <daniel@...earbox.net>
Cc:     Luigi Rizzo <lrizzo@...gle.com>, netdev@...r.kernel.org,
        Jesper Dangaard Brouer <hawk@...nel.org>,
        "David S. Miller" <davem@...emloft.net>, sameehj@...zon.com,
        toke@...hat.com
Subject: Re: [PATCH net-next] v2 net-xdp: netdev attribute to control
 xdpgeneric skb linearization

On Fri, 24 Jan 2020 10:55:19 +0100, Daniel Borkmann wrote:
> > diff --git a/net/core/dev.c b/net/core/dev.c
> > index 4dcc1b390667..13a671e45b61 100644
> > --- a/net/core/dev.c
> > +++ b/net/core/dev.c
> > @@ -4484,8 +4484,8 @@ static u32 netif_receive_generic_xdp(struct sk_buff *skb,
> >   	 * of XDP_PACKET_HEADROOM bytes. This is the guarantee that also
> >   	 * native XDP provides, thus we need to do it here as well.
> >   	 */
> > -	if (skb_is_nonlinear(skb) ||
> > -	    skb_headroom(skb) < XDP_PACKET_HEADROOM) {
> > +	if (skb->dev->xdp_linearize && (skb_is_nonlinear(skb) ||
> > +	    skb_headroom(skb) < XDP_PACKET_HEADROOM)) {
> >   		int hroom = XDP_PACKET_HEADROOM - skb_headroom(skb);
> >   		int troom = skb->tail + skb->data_len - skb->end;  
> 
> I still think in order for this knob to be generally useful, we would need to
> provide an equivalent of bpf_skb_pull_data() helper, which in generic XDP would then
> pull in more data from non-linear section, and in native XDP would be a "no-op" since
> the frame is already linear. Otherwise, as mentioned in previous thread, users would
> have no chance to examine headers if they are not pre-pulled by the driver.

Which takes us to the point of the ongoing work to allow multi-buffer
frames in native mode. Sorry if this was already mentioned but this
seems like the other side of the same coin, once we have multi-buffer
semantics in native mode we can likely just replicate them for skbs, no?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ