All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <lkp@intel.com>
Cc: <andrii@kernel.org>, <ast@kernel.org>, <bpf@vger.kernel.org>,
	<daniel@iogearbox.net>, <davem@davemloft.net>,
	<dsahern@kernel.org>, <edumazet@google.com>, <haoluo@google.com>,
	<john.fastabend@gmail.com>, <jolsa@kernel.org>,
	<kpsingh@kernel.org>, <kuba@kernel.org>, <kuniyu@amazon.com>,
	<llvm@lists.linux.dev>, <martin.lau@linux.dev>, <mykolal@fb.com>,
	<netdev@vger.kernel.org>, <oe-kbuild-all@lists.linux.dev>,
	<pabeni@redhat.com>, <sdf@google.com>, <song@kernel.org>,
	<yonghong.song@linux.dev>
Subject: Re: [PATCH v2 bpf-next 10/11] bpf: tcp: Support arbitrary SYN Cookie.
Date: Mon, 20 Nov 2023 21:37:09 -0800	[thread overview]
Message-ID: <20231121053709.91149-1-kuniyu@amazon.com> (raw)
In-Reply-To: <202311211310.E8pJEsnT-lkp@intel.com>

From: kernel test robot <lkp@intel.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@intel.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<---

  reply	other threads:[~2023-11-21  5:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-20 22:23 [PATCH v2 bpf-next 00/11] bpf: tcp: Support arbitrary SYN Cookie at TC Kuniyuki Iwashima
2023-11-20 22:23 ` [PATCH v2 bpf-next 01/11] tcp: Clean up reverse xmas tree in cookie_v[46]_check() Kuniyuki Iwashima
2023-11-20 22:23 ` [PATCH v2 bpf-next 02/11] tcp: Cache sock_net(sk) " Kuniyuki Iwashima
2023-11-20 22:23 ` [PATCH v2 bpf-next 03/11] tcp: Clean up goto labels " Kuniyuki Iwashima
2023-11-20 22:23 ` [PATCH v2 bpf-next 04/11] tcp: Don't pass cookie to __cookie_v[46]_check() Kuniyuki Iwashima
2023-11-20 22:23 ` [PATCH v2 bpf-next 05/11] tcp: Don't initialise tp->tsoffset in tcp_get_cookie_sock() Kuniyuki Iwashima
2023-11-20 22:23 ` [PATCH v2 bpf-next 06/11] tcp: Move TCP-AO bits from cookie_v[46]_check() to tcp_ao_syncookie() Kuniyuki Iwashima
2023-11-20 22:23 ` [PATCH v2 bpf-next 07/11] tcp: Factorise cookie req initialisation Kuniyuki Iwashima
2023-11-20 22:23 ` [PATCH v2 bpf-next 08/11] tcp: Factorise non-BPF SYN Cookie handling Kuniyuki Iwashima
2023-11-20 22:23 ` [PATCH v2 bpf-next 09/11] bpf: tcp: Handle BPF SYN Cookie in cookie_v[46]_check() Kuniyuki Iwashima
2023-11-20 22:23 ` [PATCH v2 bpf-next 10/11] bpf: tcp: Support arbitrary SYN Cookie Kuniyuki Iwashima
2023-11-21  5:06   ` kernel test robot
2023-11-21  5:18     ` Kuniyuki Iwashima
2023-11-21  5:17   ` kernel test robot
2023-11-21  5:37     ` Kuniyuki Iwashima [this message]
2023-11-21  5:21   ` kernel test robot
2023-11-20 22:23 ` [PATCH v2 bpf-next 11/11] selftest: bpf: Test bpf_sk_assign_tcp_reqsk() Kuniyuki Iwashima

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231121053709.91149-1-kuniyu@amazon.com \
    --to=kuniyu@amazon.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=kuba@kernel.org \
    --cc=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=martin.lau@linux.dev \
    --cc=mykolal@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pabeni@redhat.com \
    --cc=sdf@google.com \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.