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] [day] [month] [year] [list]
Message-ID: <3a0d2f44-6f1c-4f79-b8cb-f57387933a5a@roeck-us.net>
Date: Thu, 4 Dec 2025 20:16:46 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: "D. Wythe" <alibuda@...ux.alibaba.com>
Cc: ast@...nel.org, daniel@...earbox.net, andrii@...nel.org,
	martin.lau@...ux.dev, pabeni@...hat.com, song@...nel.org,
	sdf@...gle.com, haoluo@...gle.com, yhs@...com, edumazet@...gle.com,
	john.fastabend@...il.com, kpsingh@...nel.org, jolsa@...nel.org,
	mjambigi@...ux.ibm.com, wenjia@...ux.ibm.com, wintera@...ux.ibm.com,
	dust.li@...ux.alibaba.com, tonylu@...ux.alibaba.com,
	guwen@...ux.alibaba.com, bpf@...r.kernel.org, davem@...emloft.net,
	kuba@...nel.org, netdev@...r.kernel.org, sidraya@...ux.ibm.com,
	jaka@...ux.ibm.com
Subject: Re: [PATCH bpf-next v5 2/3] net/smc: bpf: Introduce generic hook for
 handshake flow

On Fri, Nov 07, 2025 at 11:56:31AM +0800, D. Wythe wrote:
> The introduction of IPPROTO_SMC enables eBPF programs to determine
> whether to use SMC based on the context of socket creation, such as
> network namespaces, PID and comm name, etc.
> 
> As a subsequent enhancement, to introduce a new generic hook that
> allows decisions on whether to use SMC or not at runtime, including
> but not limited to local/remote IP address or ports.
> 
> User can write their own implememtion via bpf_struct_ops now to choose
> whether to use SMC or not before TCP 3rd handshake to be comleted.
> 
> Signed-off-by: D. Wythe <alibuda@...ux.alibaba.com>
> Reviewed-by: Dust Li <dust.li@...ux.alibaba.com>
> ---
...
> +static struct bpf_struct_ops bpf_smc_hs_ctrl_ops = {
> +	.name		= "smc_hs_ctrl",
> +	.init		= smc_bpf_hs_ctrl_init,
> +	.reg		= smc_bpf_hs_ctrl_reg,
> +	.unreg		= smc_bpf_hs_ctrl_unreg,
> +	.cfi_stubs	= &__smc_bpf_hs_ctrl,
> +	.verifier_ops	= &smc_bpf_verifier_ops,
> +	.init_member	= smc_bpf_hs_ctrl_init_member,
> +	.owner		= THIS_MODULE,
> +};
> +
> +int bpf_smc_hs_ctrl_init(void)
> +{
> +	return register_bpf_struct_ops(&bpf_smc_hs_ctrl_ops, smc_hs_ctrl);
> +}

Building csky:allmodconfig ... failed
--------------
Error log:
In file included from include/linux/bpf_verifier.h:7,
                 from net/smc/smc_hs_bpf.c:13:
net/smc/smc_hs_bpf.c: In function 'bpf_smc_hs_ctrl_init':
include/linux/bpf.h:2068:50: error: statement with no effect [-Werror=unused-value]
 2068 | #define register_bpf_struct_ops(st_ops, type) ({ (void *)(st_ops); 0; })
      |                                                  ^~~~~~~~~~~~~~~~
net/smc/smc_hs_bpf.c:139:16: note: in expansion of macro 'register_bpf_struct_ops'
  139 |         return register_bpf_struct_ops(&bpf_smc_hs_ctrl_ops, smc_hs_ctrl);

Should this have been

	return register_bpf_struct_ops(&bpf_smc_hs_ctrl_ops, smc_hs_ctrl_ops);
									^^^^
?

Guenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ