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: <20220711202756.he4wdhb6zx6ipjge@kafai-mbp.dhcp.thefacebook.com>
Date:   Mon, 11 Jul 2022 13:27:56 -0700
From:   Martin KaFai Lau <kafai@...com>
To:     Jiri Olsa <jolsa@...nel.org>
Cc:     Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>,
        Mat Martineau <mathew.j.martineau@...ux.intel.com>,
        Matthieu Baerts <matthieu.baerts@...sares.net>,
        netdev@...r.kernel.org, bpf@...r.kernel.org,
        Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
        John Fastabend <john.fastabend@...il.com>,
        KP Singh <kpsingh@...omium.org>,
        Geliang Tang <geliang.tang@...e.com>, mptcp@...ts.linux.dev
Subject: Re: [PATCH bpf-next] mptcp: Add struct mptcp_sock definition when
 CONFIG_MPTCP is disabled

On Mon, Jul 11, 2022 at 03:07:31PM +0200, Jiri Olsa wrote:
> The btf_sock_ids array needs struct mptcp_sock BTF ID for
> the bpf_skc_to_mptcp_sock helper.
> 
> When CONFIG_MPTCP is disabled, the 'struct mptcp_sock' is not
> defined and resolve_btfids will complain with:
> 
>   BTFIDS  vmlinux
> WARN: resolve_btfids: unresolved symbol mptcp_sock
BTF_TYPE_EMIT(struct mptcp_sock) did not help here because
'struct mptcp_sock' is not defined anywhere in the include/ ?  :(

> 
> Adding empty difinition for struct mptcp_sock when CONFIG_MPTCP
> is disabled.
> 
> Signed-off-by: Jiri Olsa <jolsa@...nel.org>
> ---
>  include/net/mptcp.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/net/mptcp.h b/include/net/mptcp.h
> index ac9cf7271d46..25741a52c666 100644
> --- a/include/net/mptcp.h
> +++ b/include/net/mptcp.h
> @@ -59,6 +59,10 @@ struct mptcp_addr_info {
>  	};
>  };
>  
> +#if !IS_ENABLED(CONFIG_MPTCP)
> +struct mptcp_sock { };
> +#endif
Considering a similar case in the existing 'struct mptcp_out_options',
this seems reasonable.

Acked-by: Martin KaFai Lau <kafai@...com>

> +
>  struct mptcp_out_options {
>  #if IS_ENABLED(CONFIG_MPTCP)
>  	u16 suboptions;
> -- 
> 2.35.3
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ