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: <alpine.LRH.2.20.1904121439550.32435@dhcp-10-175-178-216.vpn.oracle.com>
Date:   Fri, 12 Apr 2019 14:45:02 +0100 (BST)
From:   Alan Maguire <alan.maguire@...cle.com>
To:     Willem de Bruijn <willemdebruijn.kernel@...il.com>
cc:     netdev@...r.kernel.org, ast@...nel.org, daniel@...earbox.net,
        alan.maguire@...cle.com, Willem de Bruijn <willemb@...gle.com>
Subject: Re: [PATCH bpf-next] selftests/bpf: reserve flags in
 bpf_skb_net_shrink

On Fri, 12 Apr 2019, Willem de Bruijn wrote:

> From: Willem de Bruijn <willemb@...gle.com>
> 
> The ENCAP flags in bpf_skb_adjust_room are ignored on decap with
> bpf_skb_net_shrink. Reserve these bits for future use.
> 
> Fixes: 868d523535c2d ("bpf: add bpf_skb_adjust_room encap flags")
> Signed-off-by: Willem de Bruijn <willemb@...gle.com>

Reviewed-by: Alan Maguire <alan.maguire@...cle.com>

One thought; should we add a line to the growth-only flags in
the description of bpf_skb_adjust_room (ENCAP_L[234]) in bpf.h;
something like:

"This flag is valid for use with positive len_diff values only."

? Don't want to delay this patch with that suggestion though,
I can spin that up later.

> ---
>  net/core/filter.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/net/core/filter.c b/net/core/filter.c
> index 95a27fdf9a405..bd1f51907b83b 100644
> --- a/net/core/filter.c
> +++ b/net/core/filter.c
> @@ -3069,6 +3069,9 @@ static int bpf_skb_net_shrink(struct sk_buff *skb, u32 off, u32 len_diff,
>  {
>  	int ret;
>  
> +	if (flags & ~BPF_F_ADJ_ROOM_FIXED_GSO)
> +		return -EINVAL;
> +
>  	if (skb_is_gso(skb) && !skb_is_gso_tcp(skb)) {
>  		/* udp gso_size delineates datagrams, only allow if fixed */
>  		if (!(skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4) ||
> -- 
> 2.21.0.392.gf8f6787159e-goog
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ