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: <20231121051857.89600-1-kuniyu@amazon.com>
Date: Mon, 20 Nov 2023 21:18:57 -0800
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <lkp@...el.com>
CC: <andrii@...nel.org>, <ast@...nel.org>, <bpf@...r.kernel.org>,
	<daniel@...earbox.net>, <davem@...emloft.net>, <dsahern@...nel.org>,
	<edumazet@...gle.com>, <haoluo@...gle.com>, <john.fastabend@...il.com>,
	<jolsa@...nel.org>, <kpsingh@...nel.org>, <kuba@...nel.org>,
	<kuniyu@...zon.com>, <martin.lau@...ux.dev>, <mykolal@...com>,
	<netdev@...r.kernel.org>, <oe-kbuild-all@...ts.linux.dev>,
	<pabeni@...hat.com>, <sdf@...gle.com>, <song@...nel.org>,
	<yonghong.song@...ux.dev>
Subject: Re: [PATCH v2 bpf-next 10/11] bpf: tcp: Support arbitrary SYN Cookie.

From: kernel test robot <lkp@...el.com>
Date: Tue, 21 Nov 2023 13:06:23 +0800
> Hi Kuniyuki,
> 
> kernel test robot noticed the following build warnings:
> 
> [auto build test WARNING on bpf-next/master]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Kuniyuki-Iwashima/tcp-Clean-up-reverse-xmas-tree-in-cookie_v-46-_check/20231121-063036
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
> patch link:    https://lore.kernel.org/r/20231120222341.54776-11-kuniyu%40amazon.com
> patch subject: [PATCH v2 bpf-next 10/11] bpf: tcp: Support arbitrary SYN Cookie.
> config: arm-randconfig-001-20231121 (https://download.01.org/0day-ci/archive/20231121/202311211229.8GAmfTPp-lkp@intel.com/config)
> compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231121/202311211229.8GAmfTPp-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@...el.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202311211229.8GAmfTPp-lkp@intel.com/
> 
> All warnings (new ones prefixed by >>):
> 
> >> net/core/filter.c:11812:48: warning: 'struct tcp_cookie_attributes' declared inside parameter list will not be visible outside of this definition or declaration
>    11812 |                                         struct tcp_cookie_attributes *attr,
>          |                                                ^~~~~~~~~~~~~~~~~~~~~
>    net/core/filter.c: In function 'bpf_sk_assign_tcp_reqsk':
>    net/core/filter.c:11821:31: error: invalid application of 'sizeof' to incomplete type 'struct tcp_cookie_attributes'
>    11821 |         if (attr__sz != sizeof(*attr))
>          |                               ^
>    net/core/filter.c:11851:17: error: invalid use of undefined type 'struct tcp_cookie_attributes'
>    11851 |         if (attr->tcp_opt.mss_clamp < min_mss) {
>          |                 ^~
>    net/core/filter.c:11856:17: error: invalid use of undefined type 'struct tcp_cookie_attributes'
>    11856 |         if (attr->tcp_opt.wscale_ok &&
>          |                 ^~
>    net/core/filter.c:11857:17: error: invalid use of undefined type 'struct tcp_cookie_attributes'
>    11857 |             attr->tcp_opt.snd_wscale > TCP_MAX_WSCALE) {
>          |                 ^~
>    net/core/filter.c:11875:24: error: invalid use of undefined type 'struct tcp_cookie_attributes'
>    11875 |         req->mss = attr->tcp_opt.mss_clamp;
>          |                        ^~
>    net/core/filter.c:11877:32: error: invalid use of undefined type 'struct tcp_cookie_attributes'
>    11877 |         ireq->snd_wscale = attr->tcp_opt.snd_wscale;
>          |                                ^~
>    net/core/filter.c:11878:31: error: invalid use of undefined type 'struct tcp_cookie_attributes'
>    11878 |         ireq->wscale_ok = attr->tcp_opt.wscale_ok;
>          |                               ^~
>    net/core/filter.c:11879:31: error: invalid use of undefined type 'struct tcp_cookie_attributes'
>    11879 |         ireq->tstamp_ok = attr->tcp_opt.tstamp_ok;
>          |                               ^~
>    net/core/filter.c:11880:29: error: invalid use of undefined type 'struct tcp_cookie_attributes'
>    11880 |         ireq->sack_ok = attr->tcp_opt.sack_ok;
>          |                             ^~
>    net/core/filter.c:11881:28: error: invalid use of undefined type 'struct tcp_cookie_attributes'
>    11881 |         ireq->ecn_ok = attr->ecn_ok;
>          |                            ^~
>    net/core/filter.c:11883:33: error: invalid use of undefined type 'struct tcp_cookie_attributes'
>    11883 |         treq->req_usec_ts = attr->usec_ts_ok;
>          |                                 ^~
> 
> 
> vim +11812 net/core/filter.c
> 
>  11810	
>  11811	__bpf_kfunc int bpf_sk_assign_tcp_reqsk(struct sk_buff *skb, struct sock *sk,
>  11812						struct tcp_cookie_attributes *attr,
>  11813						int attr__sz)
>  11814	{

bpf_sk_assign_tcp_reqsk() needs to be guarded by CONFIG_SYN_COOKIE.

Will fix in v3.

Thanks!

---8<---
diff --git a/net/core/filter.c b/net/core/filter.c
index 58b567aaf577..7beba469e8a7 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -11808,6 +11808,7 @@ __bpf_kfunc int bpf_sock_addr_set_sun_path(struct bpf_sock_addr_kern *sa_kern,
 	return 0;
 }
 
+#if IS_ENABLED(CONFIG_SYN_COOKIE)
 __bpf_kfunc int bpf_sk_assign_tcp_reqsk(struct sk_buff *skb, struct sock *sk,
 					struct tcp_cookie_attributes *attr,
 					int attr__sz)
@@ -11888,6 +11889,7 @@ __bpf_kfunc int bpf_sk_assign_tcp_reqsk(struct sk_buff *skb, struct sock *sk,
 
 	return 0;
 }
+#endif
 
 __bpf_kfunc_end_defs();
 
---8<---

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ