[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202209241357.TIp0RprD-lkp@intel.com>
Date: Sat, 24 Sep 2022 13:23:01 +0800
From: kernel test robot <lkp@...el.com>
To: Dmitry Safonov <dima@...sta.com>, linux-kernel@...r.kernel.org,
David Ahern <dsahern@...nel.org>,
Eric Dumazet <edumazet@...gle.com>
Cc: kbuild-all@...ts.01.org, Dmitry Safonov <dima@...sta.com>,
Andy Lutomirski <luto@...capital.net>,
Ard Biesheuvel <ardb@...nel.org>,
Bob Gilligan <gilligan@...sta.com>,
Dan Carpenter <error27@...il.com>,
Eric Biggers <ebiggers@...nel.org>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Francesco Ruggeri <fruggeri@...sta.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
Ivan Delalande <colona@...sta.com>,
Jakub Kicinski <kuba@...nel.org>,
Leonard Crestez <cdleonard@...il.com>,
Paolo Abeni <pabeni@...hat.com>,
Salam Noureddine <noureddine@...sta.com>,
Shuah Khan <skhan@...uxfoundation.org>, netdev@...r.kernel.org,
linux-crypto@...r.kernel.org
Subject: Re: [PATCH v2 15/35] net/tcp: Wire TCP-AO to request sockets
Hi Dmitry,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on bf682942cd26ce9cd5e87f73ae099b383041e782]
url: https://github.com/intel-lab-lkp/linux/commits/Dmitry-Safonov/net-tcp-Add-TCP-AO-support/20220924-042311
base: bf682942cd26ce9cd5e87f73ae099b383041e782
config: um-x86_64_defconfig
compiler: gcc-11 (Debian 11.3.0-5) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/714d0dcced0422997aec848b06f2e8f57533e255
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Dmitry-Safonov/net-tcp-Add-TCP-AO-support/20220924-042311
git checkout 714d0dcced0422997aec848b06f2e8f57533e255
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=um SUBARCH=x86_64 SHELL=/bin/bash net/ipv4/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
>> net/ipv4/tcp_ao.c:55:20: warning: no previous prototype for 'tcp_ao_do_lookup_keyid' [-Wmissing-prototypes]
55 | struct tcp_ao_key *tcp_ao_do_lookup_keyid(struct tcp_ao_info *ao,
| ^~~~~~~~~~~~~~~~~~~~~~
>> net/ipv4/tcp_ao.c:212:20: warning: no previous prototype for 'tcp_ao_copy_key' [-Wmissing-prototypes]
212 | struct tcp_ao_key *tcp_ao_copy_key(struct sock *sk, struct tcp_ao_key *key)
| ^~~~~~~~~~~~~~~
vim +/tcp_ao_do_lookup_keyid +55 net/ipv4/tcp_ao.c
54
> 55 struct tcp_ao_key *tcp_ao_do_lookup_keyid(struct tcp_ao_info *ao,
56 int sndid, int rcvid)
57 {
58 struct tcp_ao_key *key;
59
60 hlist_for_each_entry_rcu(key, &ao->head, node) {
61 if ((sndid >= 0 && key->sndid != sndid) ||
62 (rcvid >= 0 && key->rcvid != rcvid))
63 continue;
64 return key;
65 }
66
67 return NULL;
68 }
69
70 static struct tcp_ao_key *tcp_ao_do_lookup_rcvid(struct sock *sk, u8 keyid)
71 {
72 struct tcp_sock *tp = tcp_sk(sk);
73 struct tcp_ao_key *key;
74 struct tcp_ao_info *ao;
75
76 ao = rcu_dereference_check(tp->ao_info, lockdep_sock_is_held(sk));
77
78 if (!ao)
79 return NULL;
80
81 hlist_for_each_entry_rcu(key, &ao->head, node) {
82 if (key->rcvid == keyid)
83 return key;
84 }
85 return NULL;
86 }
87
88 struct tcp_ao_key *tcp_ao_do_lookup_sndid(const struct sock *sk, u8 keyid)
89 {
90 struct tcp_ao_key *key;
91 struct tcp_ao_info *ao;
92
93 if (sk->sk_state == TCP_TIME_WAIT)
94 ao = rcu_dereference_check(tcp_twsk(sk)->ao_info,
95 lockdep_sock_is_held(sk));
96 else
97 ao = rcu_dereference_check(tcp_sk(sk)->ao_info,
98 lockdep_sock_is_held(sk));
99
100 if (!ao)
101 return NULL;
102
103 hlist_for_each_entry_rcu(key, &ao->head, node) {
104 if (key->sndid == keyid)
105 return key;
106 }
107 return NULL;
108 }
109
110 static inline int ipv4_prefix_cmp(const struct in_addr *addr1,
111 const struct in_addr *addr2,
112 unsigned int prefixlen)
113 {
114 __be32 mask = inet_make_mask(prefixlen);
115
116 if ((addr1->s_addr & mask) == (addr2->s_addr & mask))
117 return 0;
118 return ((addr1->s_addr & mask) > (addr2->s_addr & mask)) ? 1 : -1;
119 }
120
121 static int __tcp_ao_key_cmp(const struct tcp_ao_key *key,
122 const union tcp_ao_addr *addr, u8 prefixlen,
123 int family, int sndid, int rcvid, u16 port)
124 {
125 if (sndid >= 0 && key->sndid != sndid)
126 return (key->sndid > sndid) ? 1 : -1;
127 if (rcvid >= 0 && key->rcvid != rcvid)
128 return (key->rcvid > rcvid) ? 1 : -1;
129 if (port != 0 && key->port != 0 && port != key->port)
130 return (key->port > port) ? 1 : -1;
131
132 if (family == AF_UNSPEC)
133 return 0;
134 if (key->family != family)
135 return (key->family > family) ? 1 : -1;
136
137 if (family == AF_INET) {
138 if (key->addr.a4.s_addr == INADDR_ANY)
139 return 0;
140 if (addr->a4.s_addr == INADDR_ANY)
141 return 0;
142 return ipv4_prefix_cmp(&key->addr.a4, &addr->a4, prefixlen);
143 #if IS_ENABLED(CONFIG_IPV6)
144 } else {
145 if (ipv6_addr_any(&key->addr.a6) || ipv6_addr_any(&addr->a6))
146 return 0;
147 if (ipv6_prefix_equal(&key->addr.a6, &addr->a6, prefixlen))
148 return 0;
149 return memcmp(&key->addr.a6, &addr->a6, prefixlen);
150 #endif
151 }
152 return -1;
153 }
154
155 static int tcp_ao_key_cmp(const struct tcp_ao_key *key,
156 const union tcp_ao_addr *addr, u8 prefixlen,
157 int family, int sndid, int rcvid, u16 port)
158 {
159 #if IS_ENABLED(CONFIG_IPV6)
160 if (family == AF_INET6 && ipv6_addr_v4mapped(&addr->a6)) {
161 __be32 addr4 = addr->a6.s6_addr32[3];
162
163 return __tcp_ao_key_cmp(key, (union tcp_ao_addr *)&addr4,
164 prefixlen, AF_INET, sndid, rcvid, port);
165 }
166 #endif
167 return __tcp_ao_key_cmp(key, addr, prefixlen, family, sndid, rcvid, port);
168 }
169
170 struct tcp_ao_key *tcp_ao_do_lookup(const struct sock *sk,
171 const union tcp_ao_addr *addr,
172 int family, int sndid, int rcvid, u16 port)
173 {
174 struct tcp_ao_key *key;
175 struct tcp_ao_info *ao;
176
177 ao = rcu_dereference_check(tcp_sk(sk)->ao_info,
178 lockdep_sock_is_held(sk));
179 if (!ao)
180 return NULL;
181
182 hlist_for_each_entry_rcu(key, &ao->head, node) {
183 if (!tcp_ao_key_cmp(key, addr, key->prefixlen,
184 family, sndid, rcvid, port))
185 return key;
186 }
187 return NULL;
188 }
189 EXPORT_SYMBOL(tcp_ao_do_lookup);
190
191 static struct tcp_ao_info *tcp_ao_alloc_info(gfp_t flags,
192 struct tcp_ao_info *cloned_from)
193 {
194 struct tcp_ao_info *ao;
195
196 ao = kzalloc(sizeof(*ao), flags);
197 if (!ao)
198 return NULL;
199 INIT_HLIST_HEAD(&ao->head);
200 atomic_set(&ao->refcnt, 1);
201
202 if (cloned_from)
203 ao->ao_flags = cloned_from->ao_flags;
204 return ao;
205 }
206
207 static void tcp_ao_link_mkt(struct tcp_ao_info *ao, struct tcp_ao_key *mkt)
208 {
209 hlist_add_head_rcu(&mkt->node, &ao->head);
210 }
211
> 212 struct tcp_ao_key *tcp_ao_copy_key(struct sock *sk, struct tcp_ao_key *key)
213 {
214 struct tcp_ao_key *new_key;
215
216 new_key = sock_kmalloc(sk, tcp_ao_sizeof_key(key),
217 GFP_ATOMIC);
218 if (!new_key)
219 return NULL;
220
221 *new_key = *key;
222 INIT_HLIST_NODE(&new_key->node);
223 crypto_pool_add(new_key->crypto_pool_id);
224
225 return new_key;
226 }
227
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (40715 bytes)
Powered by blists - more mailing lists