* net/netfilter/nf_flow_table_ip.c:312:2: warning: Undefined or garbage value returned to caller [clang-analyzer-core.uninitialized.UndefReturn]
@ 2022-01-03 18:59 kernel test robot
0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2022-01-03 18:59 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 20911 bytes --]
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Pablo Neira Ayuso <pablo@netfilter.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: c9e6606c7fe92b50a02ce51dda82586ebdf99b48
commit: 7a27f6ab41356ecba47ec2bec6d635704c169779 netfilter: flowtable: use dev_fill_forward_path() to obtain egress device
date: 10 months ago
:::::: branch date: 21 hours ago
:::::: commit date: 10 months ago
config: arm-randconfig-c002-20211126 (https://download.01.org/0day-ci/archive/20220104/202201040204.TJb4Riwn-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5162b558d8c0b542e752b037e72a69d5fd51eb1e)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7a27f6ab41356ecba47ec2bec6d635704c169779
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 7a27f6ab41356ecba47ec2bec6d635704c169779
# save the config file to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
^
drivers/mtd/ftl.c:1012:6: note: Assuming 'partition' is non-null
if (!partition) {
^~~~~~~~~~
drivers/mtd/ftl.c:1012:2: note: Taking false branch
if (!partition) {
^
drivers/mtd/ftl.c:1020:7: note: Calling 'scan_header'
if ((scan_header(partition) == 0) &&
^~~~~~~~~~~~~~~~~~~~~~
drivers/mtd/ftl.c:158:19: note: Assuming 1048576 is >= field 'size'
max_offset = (0x100000<part->mbd.mtd->size)?0x100000:part->mbd.mtd->size;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/mtd/ftl.c:158:18: note: '?' condition is false
max_offset = (0x100000<part->mbd.mtd->size)?0x100000:part->mbd.mtd->size;
^
drivers/mtd/ftl.c:161:3: note: Assuming the condition is false
(offset + sizeof(header)) < max_offset;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/mtd/ftl.c:160:5: note: Loop condition is false. Execution continues on line 173
for (offset = 0;
^
drivers/mtd/ftl.c:173:9: note: Assuming 'offset' is not equal to 'max_offset'
if (offset == max_offset) {
^~~~~~~~~~~~~~~~~~~~
drivers/mtd/ftl.c:173:5: note: Taking false branch
if (offset == max_offset) {
^
drivers/mtd/ftl.c:177:26: note: The left operand of '!=' is a garbage value
if (header.BlockSize != 9 ||
~~~~~~~~~~~~~~~~ ^
drivers/mtd/ftl.c:482:5: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
ret = 0;
^ ~
drivers/mtd/ftl.c:482:5: note: Value stored to 'ret' is never read
ret = 0;
^ ~
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
>> net/netfilter/nf_flow_table_ip.c:312:2: warning: Undefined or garbage value returned to caller [clang-analyzer-core.uninitialized.UndefReturn]
return ret;
^ ~~~
net/netfilter/nf_flow_table_ip.c:243:2: note: 'ret' declared without an initial value
int ret;
^~~~~~~
net/netfilter/nf_flow_table_ip.c:245:23: note: '?' condition is true
if (skb->protocol != htons(ETH_P_IP))
^
include/linux/byteorder/generic.h:141:18: note: expanded from macro 'htons'
#define htons(x) ___htons(x)
^
include/linux/byteorder/generic.h:135:21: note: expanded from macro '___htons'
#define ___htons(x) __cpu_to_be16(x)
^
include/uapi/linux/byteorder/little_endian.h:41:43: note: expanded from macro '__cpu_to_be16'
#define __cpu_to_be16(x) ((__force __be16)__swab16((x)))
^
include/uapi/linux/swab.h:105:3: note: expanded from macro '__swab16'
(__builtin_constant_p((__u16)(x)) ? \
^
net/netfilter/nf_flow_table_ip.c:245:6: note: Assuming the condition is false
if (skb->protocol != htons(ETH_P_IP))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/netfilter/nf_flow_table_ip.c:245:2: note: Taking false branch
if (skb->protocol != htons(ETH_P_IP))
^
net/netfilter/nf_flow_table_ip.c:248:2: note: Taking false branch
if (nf_flow_tuple_ip(skb, state->in, &tuple, &hdrsize) < 0)
^
net/netfilter/nf_flow_table_ip.c:252:6: note: Assuming 'tuplehash' is not equal to NULL
if (tuplehash == NULL)
^~~~~~~~~~~~~~~~~
net/netfilter/nf_flow_table_ip.c:252:2: note: Taking false branch
if (tuplehash == NULL)
^
net/netfilter/nf_flow_table_ip.c:256:9: note: Left side of '&&' is false
flow = container_of(tuplehash, struct flow_offload, tuplehash[dir]);
^
include/linux/kernel.h:709:61: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
net/netfilter/nf_flow_table_ip.c:256:9: note: Taking false branch
flow = container_of(tuplehash, struct flow_offload, tuplehash[dir]);
^
include/linux/kernel.h:709:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^
include/linux/compiler_types.h:320:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:308:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:300:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
net/netfilter/nf_flow_table_ip.c:256:9: note: Loop condition is false. Exiting loop
flow = container_of(tuplehash, struct flow_offload, tuplehash[dir]);
^
include/linux/kernel.h:709:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^
include/linux/compiler_types.h:320:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:308:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:298:2: note: expanded from macro '__compiletime_assert'
do { \
^
net/netfilter/nf_flow_table_ip.c:258:2: note: Taking false branch
if (unlikely(nf_flow_exceeds_mtu(skb, flow->tuplehash[dir].tuple.mtu)))
^
net/netfilter/nf_flow_table_ip.c:263:6: note: Calling 'nf_flow_state_check'
if (nf_flow_state_check(flow, iph->protocol, skb, thoff))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/netfilter/nf_flow_table_ip.c:25:6: note: Assuming 'proto' is not equal to IPPROTO_TCP
if (proto != IPPROTO_TCP)
^~~~~~~~~~~~~~~~~~~~
net/netfilter/nf_flow_table_ip.c:25:2: note: Taking true branch
if (proto != IPPROTO_TCP)
^
net/netfilter/nf_flow_table_ip.c:26:3: note: Returning zero, which participates in a condition later
return 0;
^~~~~~~~
net/netfilter/nf_flow_table_ip.c:263:6: note: Returning from 'nf_flow_state_check'
if (nf_flow_state_check(flow, iph->protocol, skb, thoff))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/netfilter/nf_flow_table_ip.c:263:2: note: Taking false branch
if (nf_flow_state_check(flow, iph->protocol, skb, thoff))
^
net/netfilter/nf_flow_table_ip.c:266:6: note: Assuming field 'xmit_type' is not equal to FLOW_OFFLOAD_XMIT_NEIGH
if (tuplehash->tuple.xmit_type == FLOW_OFFLOAD_XMIT_NEIGH ||
vim +312 net/netfilter/nf_flow_table_ip.c
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 227
7d208687176292 Felix Fietkau 2018-02-26 228 unsigned int
7d208687176292 Felix Fietkau 2018-02-26 229 nf_flow_offload_ip_hook(void *priv, struct sk_buff *skb,
7d208687176292 Felix Fietkau 2018-02-26 230 const struct nf_hook_state *state)
7d208687176292 Felix Fietkau 2018-02-26 231 {
7d208687176292 Felix Fietkau 2018-02-26 232 struct flow_offload_tuple_rhash *tuplehash;
7d208687176292 Felix Fietkau 2018-02-26 233 struct nf_flowtable *flow_table = priv;
7d208687176292 Felix Fietkau 2018-02-26 234 struct flow_offload_tuple tuple = {};
7d208687176292 Felix Fietkau 2018-02-26 235 enum flow_offload_tuple_dir dir;
7d208687176292 Felix Fietkau 2018-02-26 236 struct flow_offload *flow;
7d208687176292 Felix Fietkau 2018-02-26 237 struct net_device *outdev;
2a79fd3908acd8 Jason A. Donenfeld 2018-05-30 238 struct rtable *rt;
b6f27d322a0a7b Felix Fietkau 2018-02-26 239 unsigned int thoff;
7d208687176292 Felix Fietkau 2018-02-26 240 struct iphdr *iph;
7d208687176292 Felix Fietkau 2018-02-26 241 __be32 nexthop;
2fc11745c3ffa3 Pablo Neira Ayuso 2021-03-17 242 u32 hdrsize;
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 243 int ret;
7d208687176292 Felix Fietkau 2018-02-26 244
7d208687176292 Felix Fietkau 2018-02-26 245 if (skb->protocol != htons(ETH_P_IP))
7d208687176292 Felix Fietkau 2018-02-26 246 return NF_ACCEPT;
7d208687176292 Felix Fietkau 2018-02-26 247
2fc11745c3ffa3 Pablo Neira Ayuso 2021-03-17 248 if (nf_flow_tuple_ip(skb, state->in, &tuple, &hdrsize) < 0)
7d208687176292 Felix Fietkau 2018-02-26 249 return NF_ACCEPT;
7d208687176292 Felix Fietkau 2018-02-26 250
7d208687176292 Felix Fietkau 2018-02-26 251 tuplehash = flow_offload_lookup(flow_table, &tuple);
7d208687176292 Felix Fietkau 2018-02-26 252 if (tuplehash == NULL)
7d208687176292 Felix Fietkau 2018-02-26 253 return NF_ACCEPT;
7d208687176292 Felix Fietkau 2018-02-26 254
7d208687176292 Felix Fietkau 2018-02-26 255 dir = tuplehash->tuple.dir;
7d208687176292 Felix Fietkau 2018-02-26 256 flow = container_of(tuplehash, struct flow_offload, tuplehash[dir]);
7d208687176292 Felix Fietkau 2018-02-26 257
e75b3e1c9bc5b9 Florian Westphal 2019-05-21 258 if (unlikely(nf_flow_exceeds_mtu(skb, flow->tuplehash[dir].tuple.mtu)))
7d208687176292 Felix Fietkau 2018-02-26 259 return NF_ACCEPT;
7d208687176292 Felix Fietkau 2018-02-26 260
2fc11745c3ffa3 Pablo Neira Ayuso 2021-03-17 261 iph = ip_hdr(skb);
2fc11745c3ffa3 Pablo Neira Ayuso 2021-03-17 262 thoff = iph->ihl * 4;
2fc11745c3ffa3 Pablo Neira Ayuso 2021-03-17 263 if (nf_flow_state_check(flow, iph->protocol, skb, thoff))
b6f27d322a0a7b Felix Fietkau 2018-02-26 264 return NF_ACCEPT;
b6f27d322a0a7b Felix Fietkau 2018-02-26 265
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 266 if (tuplehash->tuple.xmit_type == FLOW_OFFLOAD_XMIT_NEIGH ||
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 267 tuplehash->tuple.xmit_type == FLOW_OFFLOAD_XMIT_XFRM) {
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 268 rt = (struct rtable *)tuplehash->tuple.dst_cache;
e5075c0badaaac Pablo Neira Ayuso 2021-03-17 269 if (!dst_check(&rt->dst, 0)) {
589b474a4b7ce4 Florian Westphal 2019-07-30 270 flow_offload_teardown(flow);
589b474a4b7ce4 Florian Westphal 2019-07-30 271 return NF_ACCEPT;
589b474a4b7ce4 Florian Westphal 2019-07-30 272 }
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 273 }
589b474a4b7ce4 Florian Westphal 2019-07-30 274
2babb46c8c825e Pablo Neira Ayuso 2021-03-17 275 if (skb_try_make_writable(skb, thoff + hdrsize))
2babb46c8c825e Pablo Neira Ayuso 2021-03-17 276 return NF_DROP;
2babb46c8c825e Pablo Neira Ayuso 2021-03-17 277
1b9cd7690a1ef6 Pablo Neira Ayuso 2021-03-17 278 flow_offload_refresh(flow_table, flow);
1b9cd7690a1ef6 Pablo Neira Ayuso 2021-03-17 279
2babb46c8c825e Pablo Neira Ayuso 2021-03-17 280 iph = ip_hdr(skb);
f4401262b927b8 Pablo Neira Ayuso 2021-03-17 281 nf_flow_nat_ip(flow, skb, thoff, dir, iph);
7d208687176292 Felix Fietkau 2018-02-26 282
7d208687176292 Felix Fietkau 2018-02-26 283 ip_decrease_ttl(iph);
de20900fbe1c4f Florian Westphal 2019-08-27 284 skb->tstamp = 0;
7d208687176292 Felix Fietkau 2018-02-26 285
53c2b2899af7e6 Pablo Neira Ayuso 2020-03-24 286 if (flow_table->flags & NF_FLOWTABLE_COUNTER)
53c2b2899af7e6 Pablo Neira Ayuso 2020-03-24 287 nf_ct_acct_update(flow->ct, tuplehash->tuple.dir, skb->len);
53c2b2899af7e6 Pablo Neira Ayuso 2020-03-24 288
5139c0c007250c Pablo Neira Ayuso 2021-03-24 289 if (unlikely(tuplehash->tuple.xmit_type == FLOW_OFFLOAD_XMIT_XFRM)) {
589b474a4b7ce4 Florian Westphal 2019-07-30 290 memset(skb->cb, 0, sizeof(struct inet_skb_parm));
589b474a4b7ce4 Florian Westphal 2019-07-30 291 IPCB(skb)->iif = skb->dev->ifindex;
589b474a4b7ce4 Florian Westphal 2019-07-30 292 IPCB(skb)->flags = IPSKB_FORWARDED;
589b474a4b7ce4 Florian Westphal 2019-07-30 293 return nf_flow_xmit_xfrm(skb, state, &rt->dst);
589b474a4b7ce4 Florian Westphal 2019-07-30 294 }
589b474a4b7ce4 Florian Westphal 2019-07-30 295
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 296 switch (tuplehash->tuple.xmit_type) {
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 297 case FLOW_OFFLOAD_XMIT_NEIGH:
5139c0c007250c Pablo Neira Ayuso 2021-03-24 298 outdev = rt->dst.dev;
7d208687176292 Felix Fietkau 2018-02-26 299 skb->dev = outdev;
7d208687176292 Felix Fietkau 2018-02-26 300 nexthop = rt_nexthop(rt, flow->tuplehash[!dir].tuple.src_v4.s_addr);
2a79fd3908acd8 Jason A. Donenfeld 2018-05-30 301 skb_dst_set_noref(skb, &rt->dst);
7d208687176292 Felix Fietkau 2018-02-26 302 neigh_xmit(NEIGH_ARP_TABLE, outdev, &nexthop, skb);
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 303 ret = NF_STOLEN;
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 304 break;
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 305 case FLOW_OFFLOAD_XMIT_DIRECT:
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 306 ret = nf_flow_queue_xmit(state->net, skb, tuplehash, ETH_P_IP);
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 307 if (ret == NF_DROP)
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 308 flow_offload_teardown(flow);
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 309 break;
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 310 }
7d208687176292 Felix Fietkau 2018-02-26 311
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 @312 return ret;
7d208687176292 Felix Fietkau 2018-02-26 313 }
7d208687176292 Felix Fietkau 2018-02-26 314 EXPORT_SYMBOL_GPL(nf_flow_offload_ip_hook);
a908fdec3dda29 Felix Fietkau 2018-02-26 315
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
^ permalink raw reply [flat|nested] 3+ messages in thread
* net/netfilter/nf_flow_table_ip.c:312:2: warning: Undefined or garbage value returned to caller [clang-analyzer-core.uninitialized.UndefReturn]
@ 2022-01-30 22:28 kernel test robot
0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2022-01-30 22:28 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 20652 bytes --]
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Pablo Neira Ayuso <pablo@netfilter.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 26291c54e111ff6ba87a164d85d4a4e134b7315c
commit: 7a27f6ab41356ecba47ec2bec6d635704c169779 netfilter: flowtable: use dev_fill_forward_path() to obtain egress device
date: 10 months ago
:::::: branch date: 8 hours ago
:::::: commit date: 10 months ago
config: riscv-randconfig-c006-20220129 (https://download.01.org/0day-ci/archive/20220131/202201310554.R5dGFZGh-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 33b45ee44b1f32ffdbc995e6fec806271b4b3ba4)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7a27f6ab41356ecba47ec2bec6d635704c169779
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 7a27f6ab41356ecba47ec2bec6d635704c169779
# save the config file to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
drivers/hwmon/lm63.c:1017:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct device *dev = &client->dev;
^~~ ~~~~~~~~~~~~
drivers/hwmon/lm63.c:1017:17: note: Value stored to 'dev' during its initialization is never read
struct device *dev = &client->dev;
^~~ ~~~~~~~~~~~~
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
net/openvswitch/actions.c:136:17: warning: Dereference of null pointer (loaded from variable 'key') [clang-analyzer-core.NullDereference]
da->pkt_key = *key;
^
net/openvswitch/actions.c:1451:8: note: Assuming 'last' is true
skb = last ? skb : skb_clone(skb, GFP_ATOMIC);
^~~~
net/openvswitch/actions.c:1451:8: note: '?' condition is true
net/openvswitch/actions.c:1452:6: note: Assuming 'skb' is non-null
if (!skb) {
^~~~
net/openvswitch/actions.c:1452:2: note: Taking false branch
if (!skb) {
^
net/openvswitch/actions.c:1464:10: note: Assuming 'clone_flow_key' is false
clone = clone_flow_key ? clone_key(key) : key;
^~~~~~~~~~~~~~
net/openvswitch/actions.c:1464:10: note: '?' condition is false
net/openvswitch/actions.c:1465:6: note: Assuming 'clone' is null
if (clone) {
^~~~~
net/openvswitch/actions.c:1465:2: note: Taking false branch
if (clone) {
^
net/openvswitch/actions.c:1485:33: note: Passing null pointer value via 2nd parameter 'key'
da = add_deferred_actions(skb, key, actions, len);
^~~
net/openvswitch/actions.c:1485:7: note: Calling 'add_deferred_actions'
da = add_deferred_actions(skb, key, actions, len);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/openvswitch/actions.c:130:9: note: Loop condition is false. Exiting loop
fifo = this_cpu_ptr(action_fifos);
^
include/linux/percpu-defs.h:265:27: note: expanded from macro 'this_cpu_ptr'
#define this_cpu_ptr(ptr) raw_cpu_ptr(ptr)
^
include/linux/percpu-defs.h:264:26: note: expanded from macro 'raw_cpu_ptr'
#define raw_cpu_ptr(ptr) per_cpu_ptr(ptr, 0)
^
include/linux/percpu-defs.h:263:47: note: expanded from macro 'per_cpu_ptr'
#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); VERIFY_PERCPU_PTR(ptr); })
^
include/linux/percpu-defs.h:259:2: note: expanded from macro 'VERIFY_PERCPU_PTR'
__verify_pcpu_ptr(__p); \
^
include/linux/percpu-defs.h:217:37: note: expanded from macro '__verify_pcpu_ptr'
#define __verify_pcpu_ptr(ptr) \
^
net/openvswitch/actions.c:131:7: note: Calling 'action_fifo_put'
da = action_fifo_put(fifo);
^~~~~~~~~~~~~~~~~~~~~
net/openvswitch/actions.c:115:6: note: Assuming the condition is false
if (fifo->head >= DEFERRED_ACTION_FIFO_SIZE - 1)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/openvswitch/actions.c:115:2: note: Taking false branch
if (fifo->head >= DEFERRED_ACTION_FIFO_SIZE - 1)
^
net/openvswitch/actions.c:118:2: note: Returning pointer, which participates in a condition later
return &fifo->fifo[fifo->head++];
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/openvswitch/actions.c:131:7: note: Returning from 'action_fifo_put'
da = action_fifo_put(fifo);
^~~~~~~~~~~~~~~~~~~~~
net/openvswitch/actions.c:132:6: note: 'da' is non-null
if (da) {
^~
net/openvswitch/actions.c:132:2: note: Taking true branch
if (da) {
^
net/openvswitch/actions.c:136:17: note: Dereference of null pointer (loaded from variable 'key')
da->pkt_key = *key;
^~~~
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
>> net/netfilter/nf_flow_table_ip.c:312:2: warning: Undefined or garbage value returned to caller [clang-analyzer-core.uninitialized.UndefReturn]
return ret;
^ ~~~
net/netfilter/nf_flow_table_ip.c:243:2: note: 'ret' declared without an initial value
int ret;
^~~~~~~
net/netfilter/nf_flow_table_ip.c:245:23: note: '?' condition is true
if (skb->protocol != htons(ETH_P_IP))
^
include/linux/byteorder/generic.h:141:18: note: expanded from macro 'htons'
#define htons(x) ___htons(x)
^
include/linux/byteorder/generic.h:135:21: note: expanded from macro '___htons'
#define ___htons(x) __cpu_to_be16(x)
^
include/uapi/linux/byteorder/little_endian.h:41:43: note: expanded from macro '__cpu_to_be16'
#define __cpu_to_be16(x) ((__force __be16)__swab16((x)))
^
include/uapi/linux/swab.h:105:3: note: expanded from macro '__swab16'
(__builtin_constant_p((__u16)(x)) ? \
^
net/netfilter/nf_flow_table_ip.c:245:6: note: Assuming the condition is false
if (skb->protocol != htons(ETH_P_IP))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/netfilter/nf_flow_table_ip.c:245:2: note: Taking false branch
if (skb->protocol != htons(ETH_P_IP))
^
net/netfilter/nf_flow_table_ip.c:248:2: note: Taking false branch
if (nf_flow_tuple_ip(skb, state->in, &tuple, &hdrsize) < 0)
^
net/netfilter/nf_flow_table_ip.c:252:6: note: Assuming 'tuplehash' is not equal to NULL
if (tuplehash == NULL)
^~~~~~~~~~~~~~~~~
net/netfilter/nf_flow_table_ip.c:252:2: note: Taking false branch
if (tuplehash == NULL)
^
net/netfilter/nf_flow_table_ip.c:256:9: note: Left side of '&&' is false
flow = container_of(tuplehash, struct flow_offload, tuplehash[dir]);
^
include/linux/kernel.h:709:61: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
net/netfilter/nf_flow_table_ip.c:256:9: note: Taking false branch
flow = container_of(tuplehash, struct flow_offload, tuplehash[dir]);
^
include/linux/kernel.h:709:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^
include/linux/compiler_types.h:320:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:308:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:300:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
net/netfilter/nf_flow_table_ip.c:256:9: note: Loop condition is false. Exiting loop
flow = container_of(tuplehash, struct flow_offload, tuplehash[dir]);
^
include/linux/kernel.h:709:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^
include/linux/compiler_types.h:320:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:308:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:298:2: note: expanded from macro '__compiletime_assert'
do { \
^
net/netfilter/nf_flow_table_ip.c:258:2: note: Taking false branch
if (unlikely(nf_flow_exceeds_mtu(skb, flow->tuplehash[dir].tuple.mtu)))
^
net/netfilter/nf_flow_table_ip.c:263:6: note: Calling 'nf_flow_state_check'
if (nf_flow_state_check(flow, iph->protocol, skb, thoff))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/netfilter/nf_flow_table_ip.c:25:6: note: Assuming 'proto' is not equal to IPPROTO_TCP
if (proto != IPPROTO_TCP)
^~~~~~~~~~~~~~~~~~~~
net/netfilter/nf_flow_table_ip.c:25:2: note: Taking true branch
if (proto != IPPROTO_TCP)
^
net/netfilter/nf_flow_table_ip.c:26:3: note: Returning zero, which participates in a condition later
return 0;
^~~~~~~~
net/netfilter/nf_flow_table_ip.c:263:6: note: Returning from 'nf_flow_state_check'
if (nf_flow_state_check(flow, iph->protocol, skb, thoff))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/netfilter/nf_flow_table_ip.c:263:2: note: Taking false branch
if (nf_flow_state_check(flow, iph->protocol, skb, thoff))
^
net/netfilter/nf_flow_table_ip.c:266:6: note: Assuming field 'xmit_type' is not equal to FLOW_OFFLOAD_XMIT_NEIGH
if (tuplehash->tuple.xmit_type == FLOW_OFFLOAD_XMIT_NEIGH ||
vim +312 net/netfilter/nf_flow_table_ip.c
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 227
7d208687176292 Felix Fietkau 2018-02-26 228 unsigned int
7d208687176292 Felix Fietkau 2018-02-26 229 nf_flow_offload_ip_hook(void *priv, struct sk_buff *skb,
7d208687176292 Felix Fietkau 2018-02-26 230 const struct nf_hook_state *state)
7d208687176292 Felix Fietkau 2018-02-26 231 {
7d208687176292 Felix Fietkau 2018-02-26 232 struct flow_offload_tuple_rhash *tuplehash;
7d208687176292 Felix Fietkau 2018-02-26 233 struct nf_flowtable *flow_table = priv;
7d208687176292 Felix Fietkau 2018-02-26 234 struct flow_offload_tuple tuple = {};
7d208687176292 Felix Fietkau 2018-02-26 235 enum flow_offload_tuple_dir dir;
7d208687176292 Felix Fietkau 2018-02-26 236 struct flow_offload *flow;
7d208687176292 Felix Fietkau 2018-02-26 237 struct net_device *outdev;
2a79fd3908acd8 Jason A. Donenfeld 2018-05-30 238 struct rtable *rt;
b6f27d322a0a7b Felix Fietkau 2018-02-26 239 unsigned int thoff;
7d208687176292 Felix Fietkau 2018-02-26 240 struct iphdr *iph;
7d208687176292 Felix Fietkau 2018-02-26 241 __be32 nexthop;
2fc11745c3ffa3 Pablo Neira Ayuso 2021-03-17 242 u32 hdrsize;
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 243 int ret;
7d208687176292 Felix Fietkau 2018-02-26 244
7d208687176292 Felix Fietkau 2018-02-26 245 if (skb->protocol != htons(ETH_P_IP))
7d208687176292 Felix Fietkau 2018-02-26 246 return NF_ACCEPT;
7d208687176292 Felix Fietkau 2018-02-26 247
2fc11745c3ffa3 Pablo Neira Ayuso 2021-03-17 248 if (nf_flow_tuple_ip(skb, state->in, &tuple, &hdrsize) < 0)
7d208687176292 Felix Fietkau 2018-02-26 249 return NF_ACCEPT;
7d208687176292 Felix Fietkau 2018-02-26 250
7d208687176292 Felix Fietkau 2018-02-26 251 tuplehash = flow_offload_lookup(flow_table, &tuple);
7d208687176292 Felix Fietkau 2018-02-26 252 if (tuplehash == NULL)
7d208687176292 Felix Fietkau 2018-02-26 253 return NF_ACCEPT;
7d208687176292 Felix Fietkau 2018-02-26 254
7d208687176292 Felix Fietkau 2018-02-26 255 dir = tuplehash->tuple.dir;
7d208687176292 Felix Fietkau 2018-02-26 256 flow = container_of(tuplehash, struct flow_offload, tuplehash[dir]);
7d208687176292 Felix Fietkau 2018-02-26 257
e75b3e1c9bc5b9 Florian Westphal 2019-05-21 258 if (unlikely(nf_flow_exceeds_mtu(skb, flow->tuplehash[dir].tuple.mtu)))
7d208687176292 Felix Fietkau 2018-02-26 259 return NF_ACCEPT;
7d208687176292 Felix Fietkau 2018-02-26 260
2fc11745c3ffa3 Pablo Neira Ayuso 2021-03-17 261 iph = ip_hdr(skb);
2fc11745c3ffa3 Pablo Neira Ayuso 2021-03-17 262 thoff = iph->ihl * 4;
2fc11745c3ffa3 Pablo Neira Ayuso 2021-03-17 263 if (nf_flow_state_check(flow, iph->protocol, skb, thoff))
b6f27d322a0a7b Felix Fietkau 2018-02-26 264 return NF_ACCEPT;
b6f27d322a0a7b Felix Fietkau 2018-02-26 265
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 266 if (tuplehash->tuple.xmit_type == FLOW_OFFLOAD_XMIT_NEIGH ||
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 267 tuplehash->tuple.xmit_type == FLOW_OFFLOAD_XMIT_XFRM) {
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 268 rt = (struct rtable *)tuplehash->tuple.dst_cache;
e5075c0badaaac Pablo Neira Ayuso 2021-03-17 269 if (!dst_check(&rt->dst, 0)) {
589b474a4b7ce4 Florian Westphal 2019-07-30 270 flow_offload_teardown(flow);
589b474a4b7ce4 Florian Westphal 2019-07-30 271 return NF_ACCEPT;
589b474a4b7ce4 Florian Westphal 2019-07-30 272 }
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 273 }
589b474a4b7ce4 Florian Westphal 2019-07-30 274
2babb46c8c825e Pablo Neira Ayuso 2021-03-17 275 if (skb_try_make_writable(skb, thoff + hdrsize))
2babb46c8c825e Pablo Neira Ayuso 2021-03-17 276 return NF_DROP;
2babb46c8c825e Pablo Neira Ayuso 2021-03-17 277
1b9cd7690a1ef6 Pablo Neira Ayuso 2021-03-17 278 flow_offload_refresh(flow_table, flow);
1b9cd7690a1ef6 Pablo Neira Ayuso 2021-03-17 279
2babb46c8c825e Pablo Neira Ayuso 2021-03-17 280 iph = ip_hdr(skb);
f4401262b927b8 Pablo Neira Ayuso 2021-03-17 281 nf_flow_nat_ip(flow, skb, thoff, dir, iph);
7d208687176292 Felix Fietkau 2018-02-26 282
7d208687176292 Felix Fietkau 2018-02-26 283 ip_decrease_ttl(iph);
de20900fbe1c4f Florian Westphal 2019-08-27 284 skb->tstamp = 0;
7d208687176292 Felix Fietkau 2018-02-26 285
53c2b2899af7e6 Pablo Neira Ayuso 2020-03-24 286 if (flow_table->flags & NF_FLOWTABLE_COUNTER)
53c2b2899af7e6 Pablo Neira Ayuso 2020-03-24 287 nf_ct_acct_update(flow->ct, tuplehash->tuple.dir, skb->len);
53c2b2899af7e6 Pablo Neira Ayuso 2020-03-24 288
5139c0c007250c Pablo Neira Ayuso 2021-03-24 289 if (unlikely(tuplehash->tuple.xmit_type == FLOW_OFFLOAD_XMIT_XFRM)) {
589b474a4b7ce4 Florian Westphal 2019-07-30 290 memset(skb->cb, 0, sizeof(struct inet_skb_parm));
589b474a4b7ce4 Florian Westphal 2019-07-30 291 IPCB(skb)->iif = skb->dev->ifindex;
589b474a4b7ce4 Florian Westphal 2019-07-30 292 IPCB(skb)->flags = IPSKB_FORWARDED;
589b474a4b7ce4 Florian Westphal 2019-07-30 293 return nf_flow_xmit_xfrm(skb, state, &rt->dst);
589b474a4b7ce4 Florian Westphal 2019-07-30 294 }
589b474a4b7ce4 Florian Westphal 2019-07-30 295
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 296 switch (tuplehash->tuple.xmit_type) {
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 297 case FLOW_OFFLOAD_XMIT_NEIGH:
5139c0c007250c Pablo Neira Ayuso 2021-03-24 298 outdev = rt->dst.dev;
7d208687176292 Felix Fietkau 2018-02-26 299 skb->dev = outdev;
7d208687176292 Felix Fietkau 2018-02-26 300 nexthop = rt_nexthop(rt, flow->tuplehash[!dir].tuple.src_v4.s_addr);
2a79fd3908acd8 Jason A. Donenfeld 2018-05-30 301 skb_dst_set_noref(skb, &rt->dst);
7d208687176292 Felix Fietkau 2018-02-26 302 neigh_xmit(NEIGH_ARP_TABLE, outdev, &nexthop, skb);
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 303 ret = NF_STOLEN;
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 304 break;
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 305 case FLOW_OFFLOAD_XMIT_DIRECT:
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 306 ret = nf_flow_queue_xmit(state->net, skb, tuplehash, ETH_P_IP);
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 307 if (ret == NF_DROP)
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 308 flow_offload_teardown(flow);
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 309 break;
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 310 }
7d208687176292 Felix Fietkau 2018-02-26 311
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 @312 return ret;
7d208687176292 Felix Fietkau 2018-02-26 313 }
7d208687176292 Felix Fietkau 2018-02-26 314 EXPORT_SYMBOL_GPL(nf_flow_offload_ip_hook);
a908fdec3dda29 Felix Fietkau 2018-02-26 315
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
^ permalink raw reply [flat|nested] 3+ messages in thread
* net/netfilter/nf_flow_table_ip.c:312:2: warning: Undefined or garbage value returned to caller [clang-analyzer-core.uninitialized.UndefReturn]
@ 2021-12-12 14:09 kernel test robot
0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2021-12-12 14:09 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 21061 bytes --]
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Pablo Neira Ayuso <pablo@netfilter.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: a763d5a5abd65797aec3dd1bf01fe2ccbec32967
commit: 7a27f6ab41356ecba47ec2bec6d635704c169779 netfilter: flowtable: use dev_fill_forward_path() to obtain egress device
date: 9 months ago
:::::: branch date: 14 hours ago
:::::: commit date: 9 months ago
config: arm-randconfig-c002-20211126 (https://download.01.org/0day-ci/archive/20211212/202112122245.4VYxxLtD-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5162b558d8c0b542e752b037e72a69d5fd51eb1e)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7a27f6ab41356ecba47ec2bec6d635704c169779
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 7a27f6ab41356ecba47ec2bec6d635704c169779
# save the config file to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
^
include/linux/byteorder/generic.h:135:21: note: expanded from macro '___htons'
#define ___htons(x) __cpu_to_be16(x)
^
include/uapi/linux/byteorder/little_endian.h:41:43: note: expanded from macro '__cpu_to_be16'
#define __cpu_to_be16(x) ((__force __be16)__swab16((x)))
^
include/uapi/linux/swab.h:105:3: note: expanded from macro '__swab16'
(__builtin_constant_p((__u16)(x)) ? \
^
include/net/llc_pdu.h:266:6: note: Assuming the condition is false
if (skb->protocol == htons(ETH_P_802_2))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/net/llc_pdu.h:266:2: note: Taking false branch
if (skb->protocol == htons(ETH_P_802_2))
^
net/llc/llc_sap.c:425:2: note: Returning from 'llc_pdu_decode_da'
llc_pdu_decode_da(skb, laddr.mac);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/llc/llc_sap.c:428:6: note: Calling 'is_multicast_ether_addr'
if (is_multicast_ether_addr(laddr.mac)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/etherdevice.h:121:2: note: Assigned value is garbage or undefined
u16 a = *(const u16 *)addr;
^ ~~~~~~~~~~~~~~~~~~
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
net/llc/llc_station.c:57:2: warning: Value stored to 'rc' is never read [clang-analyzer-deadcode.DeadStores]
rc = 0;
^ ~
net/llc/llc_station.c:57:2: note: Value stored to 'rc' is never read
rc = 0;
^ ~
net/llc/llc_station.c:86:2: warning: Value stored to 'rc' is never read [clang-analyzer-deadcode.DeadStores]
rc = 0;
^ ~
net/llc/llc_station.c:86:2: note: Value stored to 'rc' is never read
rc = 0;
^ ~
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
10 warnings generated.
drivers/net/dsa/bcm_sf2.c:467:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct device *dev = priv->dev->ds->dev;
^~~ ~~~~~~~~~~~~~~~~~~
drivers/net/dsa/bcm_sf2.c:467:17: note: Value stored to 'dev' during its initialization is never read
struct device *dev = priv->dev->ds->dev;
^~~ ~~~~~~~~~~~~~~~~~~
drivers/net/dsa/bcm_sf2.c:494:2: warning: Value stored to 'reg' is never read [clang-analyzer-deadcode.DeadStores]
reg = reg_readl(priv, REG_CROSSBAR);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/bcm_sf2.c:494:2: note: Value stored to 'reg' is never read
reg = reg_readl(priv, REG_CROSSBAR);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/bcm_sf2.c:496:3: warning: Value stored to 'shift' is never read [clang-analyzer-deadcode.DeadStores]
shift = i * priv->num_crossbar_int_ports;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/bcm_sf2.c:496:3: note: Value stored to 'shift' is never read
shift = i * priv->num_crossbar_int_ports;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
>> net/netfilter/nf_flow_table_ip.c:312:2: warning: Undefined or garbage value returned to caller [clang-analyzer-core.uninitialized.UndefReturn]
return ret;
^ ~~~
net/netfilter/nf_flow_table_ip.c:243:2: note: 'ret' declared without an initial value
int ret;
^~~~~~~
net/netfilter/nf_flow_table_ip.c:245:23: note: '?' condition is true
if (skb->protocol != htons(ETH_P_IP))
^
include/linux/byteorder/generic.h:141:18: note: expanded from macro 'htons'
#define htons(x) ___htons(x)
^
include/linux/byteorder/generic.h:135:21: note: expanded from macro '___htons'
#define ___htons(x) __cpu_to_be16(x)
^
include/uapi/linux/byteorder/little_endian.h:41:43: note: expanded from macro '__cpu_to_be16'
#define __cpu_to_be16(x) ((__force __be16)__swab16((x)))
^
include/uapi/linux/swab.h:105:3: note: expanded from macro '__swab16'
(__builtin_constant_p((__u16)(x)) ? \
^
net/netfilter/nf_flow_table_ip.c:245:6: note: Assuming the condition is false
if (skb->protocol != htons(ETH_P_IP))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/netfilter/nf_flow_table_ip.c:245:2: note: Taking false branch
if (skb->protocol != htons(ETH_P_IP))
^
net/netfilter/nf_flow_table_ip.c:248:2: note: Taking false branch
if (nf_flow_tuple_ip(skb, state->in, &tuple, &hdrsize) < 0)
^
net/netfilter/nf_flow_table_ip.c:252:6: note: Assuming 'tuplehash' is not equal to NULL
if (tuplehash == NULL)
^~~~~~~~~~~~~~~~~
net/netfilter/nf_flow_table_ip.c:252:2: note: Taking false branch
if (tuplehash == NULL)
^
net/netfilter/nf_flow_table_ip.c:256:9: note: Left side of '&&' is false
flow = container_of(tuplehash, struct flow_offload, tuplehash[dir]);
^
include/linux/kernel.h:709:61: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
net/netfilter/nf_flow_table_ip.c:256:9: note: Taking false branch
flow = container_of(tuplehash, struct flow_offload, tuplehash[dir]);
^
include/linux/kernel.h:709:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^
include/linux/compiler_types.h:320:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:308:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:300:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
net/netfilter/nf_flow_table_ip.c:256:9: note: Loop condition is false. Exiting loop
flow = container_of(tuplehash, struct flow_offload, tuplehash[dir]);
^
include/linux/kernel.h:709:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^
include/linux/compiler_types.h:320:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:308:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:298:2: note: expanded from macro '__compiletime_assert'
do { \
^
net/netfilter/nf_flow_table_ip.c:258:2: note: Taking false branch
if (unlikely(nf_flow_exceeds_mtu(skb, flow->tuplehash[dir].tuple.mtu)))
^
net/netfilter/nf_flow_table_ip.c:263:6: note: Calling 'nf_flow_state_check'
if (nf_flow_state_check(flow, iph->protocol, skb, thoff))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/netfilter/nf_flow_table_ip.c:25:6: note: Assuming 'proto' is not equal to IPPROTO_TCP
if (proto != IPPROTO_TCP)
^~~~~~~~~~~~~~~~~~~~
net/netfilter/nf_flow_table_ip.c:25:2: note: Taking true branch
if (proto != IPPROTO_TCP)
^
net/netfilter/nf_flow_table_ip.c:26:3: note: Returning zero, which participates in a condition later
return 0;
^~~~~~~~
net/netfilter/nf_flow_table_ip.c:263:6: note: Returning from 'nf_flow_state_check'
if (nf_flow_state_check(flow, iph->protocol, skb, thoff))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/netfilter/nf_flow_table_ip.c:263:2: note: Taking false branch
if (nf_flow_state_check(flow, iph->protocol, skb, thoff))
^
net/netfilter/nf_flow_table_ip.c:266:6: note: Assuming field 'xmit_type' is not equal to FLOW_OFFLOAD_XMIT_NEIGH
if (tuplehash->tuple.xmit_type == FLOW_OFFLOAD_XMIT_NEIGH ||
vim +312 net/netfilter/nf_flow_table_ip.c
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 227
7d208687176292 Felix Fietkau 2018-02-26 228 unsigned int
7d208687176292 Felix Fietkau 2018-02-26 229 nf_flow_offload_ip_hook(void *priv, struct sk_buff *skb,
7d208687176292 Felix Fietkau 2018-02-26 230 const struct nf_hook_state *state)
7d208687176292 Felix Fietkau 2018-02-26 231 {
7d208687176292 Felix Fietkau 2018-02-26 232 struct flow_offload_tuple_rhash *tuplehash;
7d208687176292 Felix Fietkau 2018-02-26 233 struct nf_flowtable *flow_table = priv;
7d208687176292 Felix Fietkau 2018-02-26 234 struct flow_offload_tuple tuple = {};
7d208687176292 Felix Fietkau 2018-02-26 235 enum flow_offload_tuple_dir dir;
7d208687176292 Felix Fietkau 2018-02-26 236 struct flow_offload *flow;
7d208687176292 Felix Fietkau 2018-02-26 237 struct net_device *outdev;
2a79fd3908acd8 Jason A. Donenfeld 2018-05-30 238 struct rtable *rt;
b6f27d322a0a7b Felix Fietkau 2018-02-26 239 unsigned int thoff;
7d208687176292 Felix Fietkau 2018-02-26 240 struct iphdr *iph;
7d208687176292 Felix Fietkau 2018-02-26 241 __be32 nexthop;
2fc11745c3ffa3 Pablo Neira Ayuso 2021-03-17 242 u32 hdrsize;
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 243 int ret;
7d208687176292 Felix Fietkau 2018-02-26 244
7d208687176292 Felix Fietkau 2018-02-26 245 if (skb->protocol != htons(ETH_P_IP))
7d208687176292 Felix Fietkau 2018-02-26 246 return NF_ACCEPT;
7d208687176292 Felix Fietkau 2018-02-26 247
2fc11745c3ffa3 Pablo Neira Ayuso 2021-03-17 248 if (nf_flow_tuple_ip(skb, state->in, &tuple, &hdrsize) < 0)
7d208687176292 Felix Fietkau 2018-02-26 249 return NF_ACCEPT;
7d208687176292 Felix Fietkau 2018-02-26 250
7d208687176292 Felix Fietkau 2018-02-26 251 tuplehash = flow_offload_lookup(flow_table, &tuple);
7d208687176292 Felix Fietkau 2018-02-26 252 if (tuplehash == NULL)
7d208687176292 Felix Fietkau 2018-02-26 253 return NF_ACCEPT;
7d208687176292 Felix Fietkau 2018-02-26 254
7d208687176292 Felix Fietkau 2018-02-26 255 dir = tuplehash->tuple.dir;
7d208687176292 Felix Fietkau 2018-02-26 256 flow = container_of(tuplehash, struct flow_offload, tuplehash[dir]);
7d208687176292 Felix Fietkau 2018-02-26 257
e75b3e1c9bc5b9 Florian Westphal 2019-05-21 258 if (unlikely(nf_flow_exceeds_mtu(skb, flow->tuplehash[dir].tuple.mtu)))
7d208687176292 Felix Fietkau 2018-02-26 259 return NF_ACCEPT;
7d208687176292 Felix Fietkau 2018-02-26 260
2fc11745c3ffa3 Pablo Neira Ayuso 2021-03-17 261 iph = ip_hdr(skb);
2fc11745c3ffa3 Pablo Neira Ayuso 2021-03-17 262 thoff = iph->ihl * 4;
2fc11745c3ffa3 Pablo Neira Ayuso 2021-03-17 263 if (nf_flow_state_check(flow, iph->protocol, skb, thoff))
b6f27d322a0a7b Felix Fietkau 2018-02-26 264 return NF_ACCEPT;
b6f27d322a0a7b Felix Fietkau 2018-02-26 265
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 266 if (tuplehash->tuple.xmit_type == FLOW_OFFLOAD_XMIT_NEIGH ||
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 267 tuplehash->tuple.xmit_type == FLOW_OFFLOAD_XMIT_XFRM) {
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 268 rt = (struct rtable *)tuplehash->tuple.dst_cache;
e5075c0badaaac Pablo Neira Ayuso 2021-03-17 269 if (!dst_check(&rt->dst, 0)) {
589b474a4b7ce4 Florian Westphal 2019-07-30 270 flow_offload_teardown(flow);
589b474a4b7ce4 Florian Westphal 2019-07-30 271 return NF_ACCEPT;
589b474a4b7ce4 Florian Westphal 2019-07-30 272 }
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 273 }
589b474a4b7ce4 Florian Westphal 2019-07-30 274
2babb46c8c825e Pablo Neira Ayuso 2021-03-17 275 if (skb_try_make_writable(skb, thoff + hdrsize))
2babb46c8c825e Pablo Neira Ayuso 2021-03-17 276 return NF_DROP;
2babb46c8c825e Pablo Neira Ayuso 2021-03-17 277
1b9cd7690a1ef6 Pablo Neira Ayuso 2021-03-17 278 flow_offload_refresh(flow_table, flow);
1b9cd7690a1ef6 Pablo Neira Ayuso 2021-03-17 279
2babb46c8c825e Pablo Neira Ayuso 2021-03-17 280 iph = ip_hdr(skb);
f4401262b927b8 Pablo Neira Ayuso 2021-03-17 281 nf_flow_nat_ip(flow, skb, thoff, dir, iph);
7d208687176292 Felix Fietkau 2018-02-26 282
7d208687176292 Felix Fietkau 2018-02-26 283 ip_decrease_ttl(iph);
de20900fbe1c4f Florian Westphal 2019-08-27 284 skb->tstamp = 0;
7d208687176292 Felix Fietkau 2018-02-26 285
53c2b2899af7e6 Pablo Neira Ayuso 2020-03-24 286 if (flow_table->flags & NF_FLOWTABLE_COUNTER)
53c2b2899af7e6 Pablo Neira Ayuso 2020-03-24 287 nf_ct_acct_update(flow->ct, tuplehash->tuple.dir, skb->len);
53c2b2899af7e6 Pablo Neira Ayuso 2020-03-24 288
5139c0c007250c Pablo Neira Ayuso 2021-03-24 289 if (unlikely(tuplehash->tuple.xmit_type == FLOW_OFFLOAD_XMIT_XFRM)) {
589b474a4b7ce4 Florian Westphal 2019-07-30 290 memset(skb->cb, 0, sizeof(struct inet_skb_parm));
589b474a4b7ce4 Florian Westphal 2019-07-30 291 IPCB(skb)->iif = skb->dev->ifindex;
589b474a4b7ce4 Florian Westphal 2019-07-30 292 IPCB(skb)->flags = IPSKB_FORWARDED;
589b474a4b7ce4 Florian Westphal 2019-07-30 293 return nf_flow_xmit_xfrm(skb, state, &rt->dst);
589b474a4b7ce4 Florian Westphal 2019-07-30 294 }
589b474a4b7ce4 Florian Westphal 2019-07-30 295
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 296 switch (tuplehash->tuple.xmit_type) {
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 297 case FLOW_OFFLOAD_XMIT_NEIGH:
5139c0c007250c Pablo Neira Ayuso 2021-03-24 298 outdev = rt->dst.dev;
7d208687176292 Felix Fietkau 2018-02-26 299 skb->dev = outdev;
7d208687176292 Felix Fietkau 2018-02-26 300 nexthop = rt_nexthop(rt, flow->tuplehash[!dir].tuple.src_v4.s_addr);
2a79fd3908acd8 Jason A. Donenfeld 2018-05-30 301 skb_dst_set_noref(skb, &rt->dst);
7d208687176292 Felix Fietkau 2018-02-26 302 neigh_xmit(NEIGH_ARP_TABLE, outdev, &nexthop, skb);
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 303 ret = NF_STOLEN;
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 304 break;
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 305 case FLOW_OFFLOAD_XMIT_DIRECT:
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 306 ret = nf_flow_queue_xmit(state->net, skb, tuplehash, ETH_P_IP);
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 307 if (ret == NF_DROP)
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 308 flow_offload_teardown(flow);
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 309 break;
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 310 }
7d208687176292 Felix Fietkau 2018-02-26 311
7a27f6ab41356e Pablo Neira Ayuso 2021-03-24 @312 return ret;
7d208687176292 Felix Fietkau 2018-02-26 313 }
7d208687176292 Felix Fietkau 2018-02-26 314 EXPORT_SYMBOL_GPL(nf_flow_offload_ip_hook);
a908fdec3dda29 Felix Fietkau 2018-02-26 315
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-01-30 22:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-03 18:59 net/netfilter/nf_flow_table_ip.c:312:2: warning: Undefined or garbage value returned to caller [clang-analyzer-core.uninitialized.UndefReturn] kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2022-01-30 22:28 kernel test robot
2021-12-12 14:09 kernel test robot
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.