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: <CAADnVQKE1Xmjhx3Xwdidmmn=BGzjgc89i+UMhHR7=6HupPQZSA@mail.gmail.com>
Date: Mon, 22 Jul 2024 12:45:40 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Artem Savkov <asavkov@...hat.com>
Cc: Alexei Starovoitov <ast@...nel.org>, Daniel Borkmann <daniel@...earbox.net>, 
	Andrii Nakryiko <andrii@...nel.org>, bpf <bpf@...r.kernel.org>, 
	Network Development <netdev@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH bpf-next v2] selftests/bpf: fix compilation failure when CONFIG_NET_FOU!=y

On Mon, Jul 22, 2024 at 6:53 AM Artem Savkov <asavkov@...hat.com> wrote:
>
>  bpf_xdp_get_xfrm_state(struct xdp_md *ctx, struct bpf_xfrm_state_opts *opts,
>                        u32 opts__sz) __ksym;
> @@ -745,7 +756,7 @@ SEC("tc")
>  int ipip_gue_set_tunnel(struct __sk_buff *skb)
>  {
>         struct bpf_tunnel_key key = {};
> -       struct bpf_fou_encap encap = {};
> +       struct bpf_fou_encap___local encap = {};
>         void *data = (void *)(long)skb->data;
>         struct iphdr *iph = data;
>         void *data_end = (void *)(long)skb->data_end;
> @@ -769,7 +780,7 @@ int ipip_gue_set_tunnel(struct __sk_buff *skb)
>         encap.sport = 0;
>         encap.dport = bpf_htons(5555);
>
> -       ret = bpf_skb_set_fou_encap(skb, &encap, FOU_BPF_ENCAP_GUE);
> +       ret = bpf_skb_set_fou_encap(skb, &encap, FOU_BPF_ENCAP_GUE___local);

> Casting won't work as the compiler still have no idea about struct
> bpf_fou_encap.


struct bpf_fou_encap;

(struct bpf_fou_encap *)&encap

works just fine.

pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ