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  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]
Date: Mon, 20 Nov 2023 21:37:09 -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>, <llvm@...ts.linux.dev>, <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:17:40 +0800
> Hi Kuniyuki,
> 
> kernel test robot noticed the following build errors:
> 
> [auto build test ERROR 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-spear3xx_defconfig (https://download.01.org/0day-ci/archive/20231121/202311211310.E8pJEsnT-lkp@intel.com/config)
> compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231121/202311211310.E8pJEsnT-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/202311211310.E8pJEsnT-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
>    In file included from net/core/sock.c:142:
>    In file included from include/net/tcp.h:32:
> >> include/net/inet_hashtables.h:472:22: error: use of undeclared identifier 'sock_pfree'
>                            skb->destructor = sock_pfree;
>                                              ^

Ok, sock_pfree is available with CONFIG_INET.

I'll guard the req->syncookie part in inet6?_steal_sock() by
CONFIG_SYN_COOKIE too.

---8<---
diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h
index b6c0ed5a1e3c..9a67f47a5e64 100644
--- a/include/net/inet6_hashtables.h
+++ b/include/net/inet6_hashtables.h
@@ -120,12 +120,14 @@ struct sock *inet6_steal_sock(struct net *net, struct sk_buff *skb, int doff,
 		return sk;
 
 	if (sk->sk_state == TCP_NEW_SYN_RECV) {
+#if IS_ENABLED(CONFIG_SYN_COOKIE)
 		if (inet_reqsk(sk)->syncookie) {
 			*refcounted = false;
 			skb->sk = sk;
 			skb->destructor = sock_pfree;
 			return inet_reqsk(sk)->rsk_listener;
 		}
+#endif
 		return sk;
 	} else if (sk->sk_state == TCP_TIME_WAIT) {
 		return sk;
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index 0f4091112967..36609656a047 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -466,12 +466,14 @@ struct sock *inet_steal_sock(struct net *net, struct sk_buff *skb, int doff,
 		return sk;
 
 	if (sk->sk_state == TCP_NEW_SYN_RECV) {
+#if IS_ENABLED(CONFIG_SYN_COOKIE)
 		if (inet_reqsk(sk)->syncookie) {
 			*refcounted = false;
 			skb->sk = sk;
 			skb->destructor = sock_pfree;
 			return inet_reqsk(sk)->rsk_listener;
 		}
+#endif
 		return sk;
 	} else if (sk->sk_state == TCP_TIME_WAIT) {
 		return sk;
---8<---

Powered by blists - more mailing lists