From: Dan Carpenter <dan.carpenter@oracle.com> To: kbuild@lists.01.org Subject: [dsahern-linux:nexthops/del-group-03 4/7] net/ipv4/fib_trie.c:1575 fib_table_lookup() error: uninitialized symbol 'nhsel'. Date: Sat, 23 May 2020 11:03:13 +0300 [thread overview] Message-ID: <20200523080313.GP30374@kadam> (raw) [-- Attachment #1: Type: text/plain, Size: 7526 bytes --] tree: https://github.com/dsahern/linux nexthops/del-group-03 head: b8c06bc47e0a04603de20861b8d5f7291ff0bc12 commit: 063512a047f24cd25298dbb37ae1247a407dbdde [4/7] ipv4: Refactor nhc evaluation in fib_table_lookup :::::: branch date: 19 hours ago :::::: commit date: 20 hours ago config: x86_64-defconfig (attached as .config) compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0 reproduce (this is a W=1 build): git checkout 063512a047f24cd25298dbb37ae1247a407dbdde # save the attached .config to linux build tree make ARCH=x86_64 If you fix the issue, kindly add following tag as appropriate Reported-by: kbuild test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> New smatch warnings: net/ipv4/fib_trie.c:1575 fib_table_lookup() error: uninitialized symbol 'nhsel'. # https://github.com/dsahern/linux/commit/063512a047f24cd25298dbb37ae1247a407dbdde git remote add dsahern-linux https://github.com/dsahern/linux git remote update dsahern-linux git checkout 063512a047f24cd25298dbb37ae1247a407dbdde vim +/nhsel +1575 net/ipv4/fib_trie.c 19baf839ff4a8d Robert Olsson 2005-06-21 1519 found: 71e8b67d0fdd2f Alexander Duyck 2015-03-04 1520 /* this line carries forward the xor from earlier in the function */ 71e8b67d0fdd2f Alexander Duyck 2015-03-04 1521 index = key ^ n->key; 71e8b67d0fdd2f Alexander Duyck 2015-03-04 1522 9f9e636d4f89f7 Alexander Duyck 2014-12-31 1523 /* Step 3: Process the leaf, if that fails fall back to backtracing */ 79e5ad2ceb0067 Alexander Duyck 2015-02-25 1524 hlist_for_each_entry_rcu(fa, &n->leaf, fa_list) { 345e9b54268ae0 Alexander Duyck 2014-12-31 1525 struct fib_info *fi = fa->fa_info; 063512a047f24c David Ahern 2020-05-21 1526 struct fib_nh_common *nhc; 345e9b54268ae0 Alexander Duyck 2014-12-31 1527 int nhsel, err; ^^^^^ 345e9b54268ae0 Alexander Duyck 2014-12-31 1528 a5829f536b3d11 Alexander Duyck 2016-01-28 1529 if ((BITS_PER_LONG > KEYLENGTH) || (fa->fa_slen < KEYLENGTH)) { a5829f536b3d11 Alexander Duyck 2016-01-28 1530 if (index >= (1ul << fa->fa_slen)) 9b6ebad5c3a152 Alexander Duyck 2015-02-25 1531 continue; a5829f536b3d11 Alexander Duyck 2016-01-28 1532 } 345e9b54268ae0 Alexander Duyck 2014-12-31 1533 if (fa->fa_tos && fa->fa_tos != flp->flowi4_tos) 345e9b54268ae0 Alexander Duyck 2014-12-31 1534 continue; 345e9b54268ae0 Alexander Duyck 2014-12-31 1535 if (fi->fib_dead) 345e9b54268ae0 Alexander Duyck 2014-12-31 1536 continue; 345e9b54268ae0 Alexander Duyck 2014-12-31 1537 if (fa->fa_info->fib_scope < flp->flowi4_scope) 345e9b54268ae0 Alexander Duyck 2014-12-31 1538 continue; 345e9b54268ae0 Alexander Duyck 2014-12-31 1539 fib_alias_accessed(fa); 345e9b54268ae0 Alexander Duyck 2014-12-31 1540 err = fib_props[fa->fa_type].error; 345e9b54268ae0 Alexander Duyck 2014-12-31 1541 if (unlikely(err < 0)) { 4c7e8084fd467d David Ahern 2019-06-03 1542 out_reject: 345e9b54268ae0 Alexander Duyck 2014-12-31 1543 #ifdef CONFIG_IP_FIB_TRIE_STATS 345e9b54268ae0 Alexander Duyck 2014-12-31 1544 this_cpu_inc(stats->semantic_match_passed); 345e9b54268ae0 Alexander Duyck 2014-12-31 1545 #endif 9f323973c915d4 David Ahern 2018-05-23 1546 trace_fib_table_lookup(tb->tb_id, flp, NULL, err); 345e9b54268ae0 Alexander Duyck 2014-12-31 1547 return err; 345e9b54268ae0 Alexander Duyck 2014-12-31 1548 } 345e9b54268ae0 Alexander Duyck 2014-12-31 1549 if (fi->fib_flags & RTNH_F_DEAD) 345e9b54268ae0 Alexander Duyck 2014-12-31 1550 continue; 4c7e8084fd467d David Ahern 2019-06-03 1551 063512a047f24c David Ahern 2020-05-21 1552 if (unlikely(fi->nh)) { 063512a047f24c David Ahern 2020-05-21 1553 if (nexthop_is_blackhole(fi->nh)) { 4c7e8084fd467d David Ahern 2019-06-03 1554 err = fib_props[RTN_BLACKHOLE].error; 4c7e8084fd467d David Ahern 2019-06-03 1555 goto out_reject; 4c7e8084fd467d David Ahern 2019-06-03 1556 } 4c7e8084fd467d David Ahern 2019-06-03 1557 063512a047f24c David Ahern 2020-05-21 1558 nhc = nexthop_get_nhc_lookup(fi->nh, fib_flags, flp); 063512a047f24c David Ahern 2020-05-21 1559 if (nhc) 063512a047f24c David Ahern 2020-05-21 1560 goto set_result; ^^^^^^^^^^^^^^^ goto 063512a047f24c David Ahern 2020-05-21 1561 goto miss; 063512a047f24c David Ahern 2020-05-21 1562 } 063512a047f24c David Ahern 2020-05-21 1563 5481d73f81549e David Ahern 2019-06-03 1564 for (nhsel = 0; nhsel < fib_info_num_path(fi); nhsel++) { 063512a047f24c David Ahern 2020-05-21 1565 nhc = fib_info_nhc(fi, nhsel); 345e9b54268ae0 Alexander Duyck 2014-12-31 1566 063512a047f24c David Ahern 2020-05-21 1567 if (!fib_lookup_good_nhc(nhc, fib_flags, flp)) 345e9b54268ae0 Alexander Duyck 2014-12-31 1568 continue; 063512a047f24c David Ahern 2020-05-21 1569 set_result: 345e9b54268ae0 Alexander Duyck 2014-12-31 1570 if (!(fib_flags & FIB_LOOKUP_NOREF)) 0029c0deb590bc Reshetova, Elena 2017-07-04 1571 refcount_inc(&fi->fib_clntref); 345e9b54268ae0 Alexander Duyck 2014-12-31 1572 6ffd903415320d David Ahern 2017-05-25 1573 res->prefix = htonl(n->key); 9b6ebad5c3a152 Alexander Duyck 2015-02-25 1574 res->prefixlen = KEYLENGTH - fa->fa_slen; 345e9b54268ae0 Alexander Duyck 2014-12-31 @1575 res->nh_sel = nhsel; ^^^^^^^^^^^^^^^^^^^ Uninitialized. eba618abacade7 David Ahern 2019-04-02 1576 res->nhc = nhc; 345e9b54268ae0 Alexander Duyck 2014-12-31 1577 res->type = fa->fa_type; 345e9b54268ae0 Alexander Duyck 2014-12-31 1578 res->scope = fi->fib_scope; 345e9b54268ae0 Alexander Duyck 2014-12-31 1579 res->fi = fi; 345e9b54268ae0 Alexander Duyck 2014-12-31 1580 res->table = tb; 79e5ad2ceb0067 Alexander Duyck 2015-02-25 1581 res->fa_head = &n->leaf; 345e9b54268ae0 Alexander Duyck 2014-12-31 1582 #ifdef CONFIG_IP_FIB_TRIE_STATS 345e9b54268ae0 Alexander Duyck 2014-12-31 1583 this_cpu_inc(stats->semantic_match_passed); 345e9b54268ae0 Alexander Duyck 2014-12-31 1584 #endif eba618abacade7 David Ahern 2019-04-02 1585 trace_fib_table_lookup(tb->tb_id, flp, nhc, err); f6d3c19274c74f David Ahern 2015-08-28 1586 345e9b54268ae0 Alexander Duyck 2014-12-31 1587 return err; 345e9b54268ae0 Alexander Duyck 2014-12-31 1588 } 345e9b54268ae0 Alexander Duyck 2014-12-31 1589 } 063512a047f24c David Ahern 2020-05-21 1590 miss: 345e9b54268ae0 Alexander Duyck 2014-12-31 1591 #ifdef CONFIG_IP_FIB_TRIE_STATS 345e9b54268ae0 Alexander Duyck 2014-12-31 1592 this_cpu_inc(stats->semantic_match_miss); 345e9b54268ae0 Alexander Duyck 2014-12-31 1593 #endif 9f9e636d4f89f7 Alexander Duyck 2014-12-31 1594 goto backtrace; 19baf839ff4a8d Robert Olsson 2005-06-21 1595 } 6fc01438a94702 Florian Westphal 2011-08-25 1596 EXPORT_SYMBOL_GPL(fib_table_lookup); --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org [-- Attachment #2: config.gz --] [-- Type: application/gzip, Size: 29100 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com> To: kbuild-all@lists.01.org Subject: [dsahern-linux:nexthops/del-group-03 4/7] net/ipv4/fib_trie.c:1575 fib_table_lookup() error: uninitialized symbol 'nhsel'. Date: Sat, 23 May 2020 11:03:13 +0300 [thread overview] Message-ID: <20200523080313.GP30374@kadam> (raw) [-- Attachment #1: Type: text/plain, Size: 7526 bytes --] tree: https://github.com/dsahern/linux nexthops/del-group-03 head: b8c06bc47e0a04603de20861b8d5f7291ff0bc12 commit: 063512a047f24cd25298dbb37ae1247a407dbdde [4/7] ipv4: Refactor nhc evaluation in fib_table_lookup :::::: branch date: 19 hours ago :::::: commit date: 20 hours ago config: x86_64-defconfig (attached as .config) compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0 reproduce (this is a W=1 build): git checkout 063512a047f24cd25298dbb37ae1247a407dbdde # save the attached .config to linux build tree make ARCH=x86_64 If you fix the issue, kindly add following tag as appropriate Reported-by: kbuild test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> New smatch warnings: net/ipv4/fib_trie.c:1575 fib_table_lookup() error: uninitialized symbol 'nhsel'. # https://github.com/dsahern/linux/commit/063512a047f24cd25298dbb37ae1247a407dbdde git remote add dsahern-linux https://github.com/dsahern/linux git remote update dsahern-linux git checkout 063512a047f24cd25298dbb37ae1247a407dbdde vim +/nhsel +1575 net/ipv4/fib_trie.c 19baf839ff4a8d Robert Olsson 2005-06-21 1519 found: 71e8b67d0fdd2f Alexander Duyck 2015-03-04 1520 /* this line carries forward the xor from earlier in the function */ 71e8b67d0fdd2f Alexander Duyck 2015-03-04 1521 index = key ^ n->key; 71e8b67d0fdd2f Alexander Duyck 2015-03-04 1522 9f9e636d4f89f7 Alexander Duyck 2014-12-31 1523 /* Step 3: Process the leaf, if that fails fall back to backtracing */ 79e5ad2ceb0067 Alexander Duyck 2015-02-25 1524 hlist_for_each_entry_rcu(fa, &n->leaf, fa_list) { 345e9b54268ae0 Alexander Duyck 2014-12-31 1525 struct fib_info *fi = fa->fa_info; 063512a047f24c David Ahern 2020-05-21 1526 struct fib_nh_common *nhc; 345e9b54268ae0 Alexander Duyck 2014-12-31 1527 int nhsel, err; ^^^^^ 345e9b54268ae0 Alexander Duyck 2014-12-31 1528 a5829f536b3d11 Alexander Duyck 2016-01-28 1529 if ((BITS_PER_LONG > KEYLENGTH) || (fa->fa_slen < KEYLENGTH)) { a5829f536b3d11 Alexander Duyck 2016-01-28 1530 if (index >= (1ul << fa->fa_slen)) 9b6ebad5c3a152 Alexander Duyck 2015-02-25 1531 continue; a5829f536b3d11 Alexander Duyck 2016-01-28 1532 } 345e9b54268ae0 Alexander Duyck 2014-12-31 1533 if (fa->fa_tos && fa->fa_tos != flp->flowi4_tos) 345e9b54268ae0 Alexander Duyck 2014-12-31 1534 continue; 345e9b54268ae0 Alexander Duyck 2014-12-31 1535 if (fi->fib_dead) 345e9b54268ae0 Alexander Duyck 2014-12-31 1536 continue; 345e9b54268ae0 Alexander Duyck 2014-12-31 1537 if (fa->fa_info->fib_scope < flp->flowi4_scope) 345e9b54268ae0 Alexander Duyck 2014-12-31 1538 continue; 345e9b54268ae0 Alexander Duyck 2014-12-31 1539 fib_alias_accessed(fa); 345e9b54268ae0 Alexander Duyck 2014-12-31 1540 err = fib_props[fa->fa_type].error; 345e9b54268ae0 Alexander Duyck 2014-12-31 1541 if (unlikely(err < 0)) { 4c7e8084fd467d David Ahern 2019-06-03 1542 out_reject: 345e9b54268ae0 Alexander Duyck 2014-12-31 1543 #ifdef CONFIG_IP_FIB_TRIE_STATS 345e9b54268ae0 Alexander Duyck 2014-12-31 1544 this_cpu_inc(stats->semantic_match_passed); 345e9b54268ae0 Alexander Duyck 2014-12-31 1545 #endif 9f323973c915d4 David Ahern 2018-05-23 1546 trace_fib_table_lookup(tb->tb_id, flp, NULL, err); 345e9b54268ae0 Alexander Duyck 2014-12-31 1547 return err; 345e9b54268ae0 Alexander Duyck 2014-12-31 1548 } 345e9b54268ae0 Alexander Duyck 2014-12-31 1549 if (fi->fib_flags & RTNH_F_DEAD) 345e9b54268ae0 Alexander Duyck 2014-12-31 1550 continue; 4c7e8084fd467d David Ahern 2019-06-03 1551 063512a047f24c David Ahern 2020-05-21 1552 if (unlikely(fi->nh)) { 063512a047f24c David Ahern 2020-05-21 1553 if (nexthop_is_blackhole(fi->nh)) { 4c7e8084fd467d David Ahern 2019-06-03 1554 err = fib_props[RTN_BLACKHOLE].error; 4c7e8084fd467d David Ahern 2019-06-03 1555 goto out_reject; 4c7e8084fd467d David Ahern 2019-06-03 1556 } 4c7e8084fd467d David Ahern 2019-06-03 1557 063512a047f24c David Ahern 2020-05-21 1558 nhc = nexthop_get_nhc_lookup(fi->nh, fib_flags, flp); 063512a047f24c David Ahern 2020-05-21 1559 if (nhc) 063512a047f24c David Ahern 2020-05-21 1560 goto set_result; ^^^^^^^^^^^^^^^ goto 063512a047f24c David Ahern 2020-05-21 1561 goto miss; 063512a047f24c David Ahern 2020-05-21 1562 } 063512a047f24c David Ahern 2020-05-21 1563 5481d73f81549e David Ahern 2019-06-03 1564 for (nhsel = 0; nhsel < fib_info_num_path(fi); nhsel++) { 063512a047f24c David Ahern 2020-05-21 1565 nhc = fib_info_nhc(fi, nhsel); 345e9b54268ae0 Alexander Duyck 2014-12-31 1566 063512a047f24c David Ahern 2020-05-21 1567 if (!fib_lookup_good_nhc(nhc, fib_flags, flp)) 345e9b54268ae0 Alexander Duyck 2014-12-31 1568 continue; 063512a047f24c David Ahern 2020-05-21 1569 set_result: 345e9b54268ae0 Alexander Duyck 2014-12-31 1570 if (!(fib_flags & FIB_LOOKUP_NOREF)) 0029c0deb590bc Reshetova, Elena 2017-07-04 1571 refcount_inc(&fi->fib_clntref); 345e9b54268ae0 Alexander Duyck 2014-12-31 1572 6ffd903415320d David Ahern 2017-05-25 1573 res->prefix = htonl(n->key); 9b6ebad5c3a152 Alexander Duyck 2015-02-25 1574 res->prefixlen = KEYLENGTH - fa->fa_slen; 345e9b54268ae0 Alexander Duyck 2014-12-31 @1575 res->nh_sel = nhsel; ^^^^^^^^^^^^^^^^^^^ Uninitialized. eba618abacade7 David Ahern 2019-04-02 1576 res->nhc = nhc; 345e9b54268ae0 Alexander Duyck 2014-12-31 1577 res->type = fa->fa_type; 345e9b54268ae0 Alexander Duyck 2014-12-31 1578 res->scope = fi->fib_scope; 345e9b54268ae0 Alexander Duyck 2014-12-31 1579 res->fi = fi; 345e9b54268ae0 Alexander Duyck 2014-12-31 1580 res->table = tb; 79e5ad2ceb0067 Alexander Duyck 2015-02-25 1581 res->fa_head = &n->leaf; 345e9b54268ae0 Alexander Duyck 2014-12-31 1582 #ifdef CONFIG_IP_FIB_TRIE_STATS 345e9b54268ae0 Alexander Duyck 2014-12-31 1583 this_cpu_inc(stats->semantic_match_passed); 345e9b54268ae0 Alexander Duyck 2014-12-31 1584 #endif eba618abacade7 David Ahern 2019-04-02 1585 trace_fib_table_lookup(tb->tb_id, flp, nhc, err); f6d3c19274c74f David Ahern 2015-08-28 1586 345e9b54268ae0 Alexander Duyck 2014-12-31 1587 return err; 345e9b54268ae0 Alexander Duyck 2014-12-31 1588 } 345e9b54268ae0 Alexander Duyck 2014-12-31 1589 } 063512a047f24c David Ahern 2020-05-21 1590 miss: 345e9b54268ae0 Alexander Duyck 2014-12-31 1591 #ifdef CONFIG_IP_FIB_TRIE_STATS 345e9b54268ae0 Alexander Duyck 2014-12-31 1592 this_cpu_inc(stats->semantic_match_miss); 345e9b54268ae0 Alexander Duyck 2014-12-31 1593 #endif 9f9e636d4f89f7 Alexander Duyck 2014-12-31 1594 goto backtrace; 19baf839ff4a8d Robert Olsson 2005-06-21 1595 } 6fc01438a94702 Florian Westphal 2011-08-25 1596 EXPORT_SYMBOL_GPL(fib_table_lookup); --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org [-- Attachment #2: config.gz --] [-- Type: application/gzip, Size: 29100 bytes --]
next reply other threads:[~2020-05-23 8:03 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-05-23 8:03 Dan Carpenter [this message] 2020-05-23 8:03 ` [dsahern-linux:nexthops/del-group-03 4/7] net/ipv4/fib_trie.c:1575 fib_table_lookup() error: uninitialized symbol 'nhsel' Dan Carpenter -- strict thread matches above, loose matches on Subject: below -- 2020-05-22 17:49 kbuild test robot
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=20200523080313.GP30374@kadam \ --to=dan.carpenter@oracle.com \ --cc=kbuild@lists.01.org \ /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: linkBe 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.