All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH bpf-next v1 2/5] af_unix: add unix_stream_proto for sockmap
Date: Wed, 28 Jul 2021 10:13:19 +0800	[thread overview]
Message-ID: <202107281009.MRLeNmdU-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 15517 bytes --]

CC: clang-built-linux(a)googlegroups.com
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20210727001252.1287673-3-jiang.wang@bytedance.com>
References: <20210727001252.1287673-3-jiang.wang@bytedance.com>
TO: Jiang Wang <jiang.wang@bytedance.com>
TO: netdev(a)vger.kernel.org
CC: cong.wang(a)bytedance.com
CC: duanxiongchun(a)bytedance.com
CC: xieyongji(a)bytedance.com
CC: chaiwen.cc(a)bytedance.com
CC: Jakub Kicinski <kuba@kernel.org>
CC: John Fastabend <john.fastabend@gmail.com>
CC: Daniel Borkmann <daniel@iogearbox.net>
CC: Jakub Sitnicki <jakub@cloudflare.com>
CC: Lorenz Bauer <lmb@cloudflare.com>

Hi Jiang,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on bpf-next/master]

url:    https://github.com/0day-ci/linux/commits/Jiang-Wang/sockmap-add-sockmap-support-for-unix-stream-socket/20210727-081531
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
:::::: branch date: 26 hours ago
:::::: commit date: 26 hours ago
config: x86_64-randconfig-c001-20210727 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project c658b472f3e61e1818e1909bf02f3d65470018a5)
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 x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://github.com/0day-ci/linux/commit/607ed02e3232aa57995e87230faad770b810a64a
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Jiang-Wang/sockmap-add-sockmap-support-for-unix-stream-socket/20210727-081531
        git checkout 607ed02e3232aa57995e87230faad770b810a64a
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 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 >>)
                       ^~~~
   net/unix/af_unix.c:1251:34: warning: Dereference of null pointer [clang-analyzer-core.NullDereference]
                   sk->sk_state = other->sk_state = TCP_ESTABLISHED;
                                  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
   net/unix/af_unix.c:1189:6: note: Assuming the condition is false
           if (alen < offsetofend(struct sockaddr, sa_family))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/unix/af_unix.c:1189:2: note: Taking false branch
           if (alen < offsetofend(struct sockaddr, sa_family))
           ^
   net/unix/af_unix.c:1192:6: note: Assuming field 'sa_family' is equal to AF_UNSPEC
           if (addr->sa_family != AF_UNSPEC) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/unix/af_unix.c:1192:2: note: Taking false branch
           if (addr->sa_family != AF_UNSPEC) {
           ^
   net/unix/af_unix.c:1228:3: note: Null pointer value stored to 'other'
                   other = NULL;
                   ^~~~~~~~~~~~
   net/unix/af_unix.c:1235:6: note: Assuming field 'peer' is null
           if (unix_peer(sk)) {
               ^
   net/unix/af_unix.c:180:23: note: expanded from macro 'unix_peer'
   #define unix_peer(sk) (unix_sk(sk)->peer)
                         ^~~~~~~~~~~~~~~~~~~
   net/unix/af_unix.c:1235:2: note: Taking false branch
           if (unix_peer(sk)) {
           ^
   net/unix/af_unix.c:1247:3: note: Calling 'unix_state_double_unlock'
                   unix_state_double_unlock(sk, other);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/unix/af_unix.c:1170:15: note: 'sk1' is not equal to 'sk2'
           if (unlikely(sk1 == sk2) || !sk2) {
                        ^
   include/linux/compiler.h:48:41: note: expanded from macro 'unlikely'
   #  define unlikely(x)   (__branch_check__(x, 0, __builtin_constant_p(x)))
                                             ^
   include/linux/compiler.h:33:34: note: expanded from macro '__branch_check__'
                           ______r = __builtin_expect(!!(x), expect);      \
                                                         ^
   net/unix/af_unix.c:1170:15: note: 'sk1' is not equal to 'sk2'
           if (unlikely(sk1 == sk2) || !sk2) {
                        ^
   include/linux/compiler.h:48:68: note: expanded from macro 'unlikely'
   #  define unlikely(x)   (__branch_check__(x, 0, __builtin_constant_p(x)))
                                                                        ^
   include/linux/compiler.h:35:19: note: expanded from macro '__branch_check__'
                                                expect, is_constant);      \
                                                        ^~~~~~~~~~~
   net/unix/af_unix.c:1170:6: note: Left side of '||' is false
           if (unlikely(sk1 == sk2) || !sk2) {
               ^
   include/linux/compiler.h:48:23: note: expanded from macro 'unlikely'
   #  define unlikely(x)   (__branch_check__(x, 0, __builtin_constant_p(x)))
                           ^
   net/unix/af_unix.c:1170:31: note: 'sk2' is null
           if (unlikely(sk1 == sk2) || !sk2) {
                                        ^~~
   net/unix/af_unix.c:1170:2: note: Taking true branch
           if (unlikely(sk1 == sk2) || !sk2) {
           ^
   net/unix/af_unix.c:1171:3: note: Calling 'spin_unlock'
                   unix_state_unlock(sk1);
                   ^
   include/net/af_unix.h:51:30: note: expanded from macro 'unix_state_unlock'
   #define unix_state_unlock(s)    spin_unlock(&unix_sk(s)->lock)
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/spinlock.h:394:2: note: Value assigned to field 'peer', which participates in a condition later
           raw_spin_unlock(&lock->rlock);
           ^
   include/linux/spinlock.h:284:32: note: expanded from macro 'raw_spin_unlock'
   #define raw_spin_unlock(lock)           _raw_spin_unlock(lock)
                                           ^~~~~~~~~~~~~~~~~~~~~~
   net/unix/af_unix.c:1171:3: note: Returning from 'spin_unlock'
                   unix_state_unlock(sk1);
                   ^
   include/net/af_unix.h:51:30: note: expanded from macro 'unix_state_unlock'
   #define unix_state_unlock(s)    spin_unlock(&unix_sk(s)->lock)
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/unix/af_unix.c:1247:3: note: Returning from 'unix_state_double_unlock'
                   unix_state_double_unlock(sk, other);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/unix/af_unix.c:1250:6: note: Assuming field 'peer' is non-null
           if (unix_peer(sk))
               ^
   net/unix/af_unix.c:180:23: note: expanded from macro 'unix_peer'
   #define unix_peer(sk) (unix_sk(sk)->peer)
                         ^~~~~~~~~~~~~~~~~~~
   net/unix/af_unix.c:1250:2: note: Taking true branch
           if (unix_peer(sk))
           ^
   net/unix/af_unix.c:1251:34: note: Dereference of null pointer
                   sk->sk_state = other->sk_state = TCP_ESTABLISHED;
                                  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
   net/unix/af_unix.c:1558:3: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
                   err = 0;
                   ^     ~
   net/unix/af_unix.c:1558:3: note: Value stored to 'err' is never read
                   err = 0;
                   ^     ~
>> net/unix/af_unix.c:2590:15: warning: Value stored to 'sk' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct sock *sk = sock->sk;
                        ^~   ~~~~~~~~
   net/unix/af_unix.c:2590:15: note: Value stored to 'sk' during its initialization is never read
           struct sock *sk = sock->sk;
                        ^~   ~~~~~~~~
   Suppressed 12 warnings (11 in non-user code, 1 with check filters).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   12 warnings generated.
   net/atm/common.c:238:2: warning: Assigned value is garbage or undefined [clang-analyzer-core.uninitialized.Assign]
           skb_queue_walk_safe(&queue, skb, tmp) {
           ^
   include/linux/skbuff.h:3537:33: note: expanded from macro 'skb_queue_walk_safe'
                   for (skb = (queue)->next, tmp = skb->next;                      \
                                                 ^ ~~~~~~~~~
   net/atm/common.c:231:2: note: Calling '__skb_queue_head_init'
           __skb_queue_head_init(&queue);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/atm/common.c:231:2: note: Returning from '__skb_queue_head_init'
           __skb_queue_head_init(&queue);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/atm/common.c:234:2: note: Loop condition is false.  Exiting loop
           spin_lock_irqsave(&rq->lock, flags);
           ^
   include/linux/spinlock.h:384:2: note: expanded from macro 'spin_lock_irqsave'
           raw_spin_lock_irqsave(spinlock_check(lock), flags);     \
           ^
   include/linux/spinlock.h:250:2: note: expanded from macro 'raw_spin_lock_irqsave'
           do {                                            \
           ^
   net/atm/common.c:234:2: note: Loop condition is false.  Exiting loop
           spin_lock_irqsave(&rq->lock, flags);
           ^
   include/linux/spinlock.h:382:43: note: expanded from macro 'spin_lock_irqsave'
   #define spin_lock_irqsave(lock, flags)                          \
                                                                   ^
   net/atm/common.c:235:2: note: Calling 'skb_queue_splice_init'
           skb_queue_splice_init(rq, &queue);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/skbuff.h:1979:6: note: Assuming the condition is false
           if (!skb_queue_empty(list)) {
               ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/skbuff.h:1979:2: note: Taking false branch
           if (!skb_queue_empty(list)) {
           ^
   net/atm/common.c:235:2: note: Returning from 'skb_queue_splice_init'
           skb_queue_splice_init(rq, &queue);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/atm/common.c:238:2: note: Assigned value is garbage or undefined
           skb_queue_walk_safe(&queue, skb, tmp) {
           ^
   include/linux/skbuff.h:3537:33: note: expanded from macro 'skb_queue_walk_safe'
                   for (skb = (queue)->next, tmp = skb->next;                      \
                                                 ^ ~~~~~~~~~
   Suppressed 11 warnings (11 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.
   11 warnings generated.
   Suppressed 11 warnings (11 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.
   11 warnings generated.
   Suppressed 11 warnings (11 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.
   11 warnings generated.
   Suppressed 11 warnings (11 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.
   11 warnings generated.
   Suppressed 11 warnings (11 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.
   11 warnings generated.
   Suppressed 11 warnings (11 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.
   Suppressed 5 warnings (5 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.
   drivers/thunderbolt/switch.c:498:36: warning: Value stored to 'regs' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           const struct tb_regs_port_header *regs = &port->config;
                                             ^~~~   ~~~~~~~~~~~~~
   drivers/thunderbolt/switch.c:498:36: note: Value stored to 'regs' during its initialization is never read
           const struct tb_regs_port_header *regs = &port->config;
                                             ^~~~   ~~~~~~~~~~~~~
   drivers/thunderbolt/switch.c:1408:38: warning: Value stored to 'regs' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           const struct tb_regs_switch_header *regs = &sw->config;
                                               ^~~~   ~~~~~~~~~~~
   drivers/thunderbolt/switch.c:1408:38: note: Value stored to 'regs' during its initialization is never read
           const struct tb_regs_switch_header *regs = &sw->config;
                                               ^~~~   ~~~~~~~~~~~
   drivers/thunderbolt/switch.c:2268:13: warning: Value stored to 'tb' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct tb *tb = sw->tb;
                      ^~   ~~~~~~
   drivers/thunderbolt/switch.c:2268:13: note: Value stored to 'tb' during its initialization is never read
           struct tb *tb = sw->tb;
                      ^~   ~~~~~~
   drivers/thunderbolt/switch.c:2272:2: warning: Value stored to 'route' is never read [clang-analyzer-deadcode.DeadStores]
           route = tb_route(sw);
           ^       ~~~~~~~~~~~~
   drivers/thunderbolt/switch.c:2272:2: note: Value stored to 'route' is never read
           route = tb_route(sw);
           ^       ~~~~~~~~~~~~
   Suppressed 5 warnings (5 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.

vim +/sk +2590 net/unix/af_unix.c

607ed02e3232aa Jiang Wang           2021-07-27  2578  
2b514574f7e88c Hannes Frederic Sowa 2015-05-21  2579  static int unix_stream_recvmsg(struct socket *sock, struct msghdr *msg,
2b514574f7e88c Hannes Frederic Sowa 2015-05-21  2580  			       size_t size, int flags)
2b514574f7e88c Hannes Frederic Sowa 2015-05-21  2581  {
2b514574f7e88c Hannes Frederic Sowa 2015-05-21  2582  	struct unix_stream_read_state state = {
2b514574f7e88c Hannes Frederic Sowa 2015-05-21  2583  		.recv_actor = unix_stream_read_actor,
2b514574f7e88c Hannes Frederic Sowa 2015-05-21  2584  		.socket = sock,
2b514574f7e88c Hannes Frederic Sowa 2015-05-21  2585  		.msg = msg,
2b514574f7e88c Hannes Frederic Sowa 2015-05-21  2586  		.size = size,
2b514574f7e88c Hannes Frederic Sowa 2015-05-21  2587  		.flags = flags
2b514574f7e88c Hannes Frederic Sowa 2015-05-21  2588  	};
2b514574f7e88c Hannes Frederic Sowa 2015-05-21  2589  
607ed02e3232aa Jiang Wang           2021-07-27 @2590  	struct sock *sk = sock->sk;
607ed02e3232aa Jiang Wang           2021-07-27  2591  

---
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: 34139 bytes --]

             reply	other threads:[~2021-07-28  2:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-28  2:13 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-07-27 16:38 [PATCH bpf-next v1 2/5] af_unix: add unix_stream_proto for sockmap kernel test robot
2021-07-28  0:38 ` kernel test robot
2021-07-28  0:38   ` kernel test robot
2021-07-27  0:12 [PATCH bpf-next v1 0/5] sockmap: add sockmap support for unix stream socket Jiang Wang
2021-07-27  0:12 ` [PATCH bpf-next v1 2/5] af_unix: add unix_stream_proto for sockmap Jiang Wang
2021-07-27 16:37   ` John Fastabend
2021-07-28  2:07     ` Cong Wang
2021-07-28 18:43       ` John Fastabend
2021-07-29 21:27         ` Cong Wang
2021-08-10 17:04           ` John Fastabend

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=202107281009.MRLeNmdU-lkp@intel.com \
    --to=lkp@intel.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: 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.