CC: [email protected]
CC: [email protected]
CC: [email protected]
TO: David Howells <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git 
fscache-rewrite-indexing-3
head:   d2eff33286af9373ec469be3146d6e122c07264f
commit: 9c9776d88423ae7064bd18101f15cad1008df812 [51/55] 9p: Use fscache 
indexing rewrite and reenable caching
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: arm-randconfig-c002-20211103 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 
264d3b6d4e08401c5b50a85bd76e80b3461d77e6)
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/dhowells/linux-fs.git/commit/?id=9c9776d88423ae7064bd18101f15cad1008df812
        git remote add dhowells-fs 
https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
        git fetch --no-tags dhowells-fs fscache-rewrite-indexing-3
        git checkout 9c9776d88423ae7064bd18101f15cad1008df812
        # save the attached .config 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 <[email protected]>


clang-analyzer warnings: (new ones prefixed by >>)
           ^
   include/linux/build_bug.h:50:2: note: expanded from macro 'BUILD_BUG_ON'
           BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
           ^
   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:317:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:305:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:297:3: note: expanded from macro 
'__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   include/linux/sched.h:1632:2: note: Loop condition is false.  Exiting loop
           BUILD_BUG_ON(1 + ilog2(TASK_REPORT_MAX) != sizeof(state_char) - 1);
           ^
   include/linux/build_bug.h:50:2: note: expanded from macro 'BUILD_BUG_ON'
           BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
           ^
   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:317:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:305:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:295:2: note: expanded from macro 
'__compiletime_assert'
           do {                                                            \
           ^
   include/linux/sched.h:1634:2: note: Undefined or garbage value returned to 
caller
           return state_char[state];
           ^      ~~~~~~~~~~~~~~~~~
   kernel/sched/core.c:5492:16: warning: Value stored to 'preempt_disable_ip' 
during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           unsigned long preempt_disable_ip = get_preempt_disable_ip(current);
                         ^~~~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/sched/core.c:5492:16: note: Value stored to 'preempt_disable_ip' 
during its initialization is never read
           unsigned long preempt_disable_ip = get_preempt_disable_ip(current);
                         ^~~~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/sched/core.c:6250:3: warning: Value stored to 'rq' is never read 
[clang-analyzer-deadcode.DeadStores]
                   rq = context_switch(rq, prev, next, &rf);
                   ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/sched/core.c:6250:3: note: Value stored to 'rq' is never read
                   rq = context_switch(rq, prev, next, &rf);
                   ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/sched/core.c:9285:3: warning: Value stored to 'ptr' is never read 
[clang-analyzer-deadcode.DeadStores]
                   ptr = (unsigned long)kzalloc(ptr, GFP_NOWAIT);
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/sched/core.c:9285:3: note: Value stored to 'ptr' is never read
                   ptr = (unsigned long)kzalloc(ptr, GFP_NOWAIT);
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 11 warnings (4 in non-user code, 7 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.
   7 warnings generated.
   fs/9p/vfs_inode.c:164:2: warning: Value stored to 'ret' is never read 
[clang-analyzer-deadcode.DeadStores]
           ret = 0;
           ^     ~
   fs/9p/vfs_inode.c:164:2: note: Value stored to 'ret' is never read
           ret = 0;
           ^     ~
   fs/9p/vfs_inode.c:603:2: warning: Value stored to 'err' is never read 
[clang-analyzer-deadcode.DeadStores]
           err = 0;
           ^     ~
   fs/9p/vfs_inode.c:603:2: note: Value stored to 'err' is never read
           err = 0;
           ^     ~
   fs/9p/vfs_inode.c:822:2: warning: Value stored to 'err' is never read 
[clang-analyzer-deadcode.DeadStores]
           err = 0;
           ^     ~
   fs/9p/vfs_inode.c:822:2: note: Value stored to 'err' is never read
           err = 0;
           ^     ~
   fs/9p/vfs_inode.c:932:2: warning: Value stored to 'retval' is never read 
[clang-analyzer-deadcode.DeadStores]
           retval = 0;
           ^        ~
   fs/9p/vfs_inode.c:932:2: note: Value stored to 'retval' is never read
           retval = 0;
           ^        ~
   fs/9p/vfs_inode.c:1079:2: warning: Value stored to 'retval' is never read 
[clang-analyzer-deadcode.DeadStores]
           retval = -EPERM;
           ^        ~~~~~~
   fs/9p/vfs_inode.c:1079:2: note: Value stored to 'retval' is never read
           retval = -EPERM;
           ^        ~~~~~~
   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.
   3 warnings generated.
   fs/9p/vfs_inode_dotl.c:391:2: warning: Value stored to 'err' is never read 
[clang-analyzer-deadcode.DeadStores]
           err = 0;
           ^     ~
   fs/9p/vfs_inode_dotl.c:391:2: note: Value stored to 'err' is never read
           err = 0;
           ^     ~
   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.
   3 warnings generated.
>> fs/9p/vfs_addr.c:81:25: warning: Value stored to 'cookie' during its 
>> initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct fscache_cookie *cookie = v9fs_inode_cookie(V9FS_I(inode));
                                  ^~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/9p/vfs_addr.c:81:25: note: Value stored to 'cookie' during its 
initialization is never read
           struct fscache_cookie *cookie = v9fs_inode_cookie(V9FS_I(inode));
                                  ^~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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.
   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.
   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.
   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.
   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.
   5 warnings generated.
   fs/cifs/ioctl.c:334:4: warning: Value stored to 'caps' is never read 
[clang-analyzer-deadcode.DeadStores]
                           caps = le64_to_cpu(tcon->fsUnixInfo.Capability);
                           ^
   fs/cifs/ioctl.c:334:4: note: Value stored to 'caps' is never read
   Suppressed 4 warnings (3 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.
   9 warnings generated.
   fs/cifs/sess.c:175:22: warning: Value stored to 'ipv4' during its 
initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct sockaddr_in *ipv4 = (struct sockaddr_in *)&iface->sockaddr;
                               ^~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/cifs/sess.c:175:22: note: Value stored to 'ipv4' during its 
initialization is never read
           struct sockaddr_in *ipv4 = (struct sockaddr_in *)&iface->sockaddr;
                               ^~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/cifs/sess.c:176:23: warning: Value stored to 'ipv6' during its 
initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)&iface->sockaddr;
                                ^~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/cifs/sess.c:176:23: note: Value stored to 'ipv6' during its 
initialization is never read
           struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)&iface->sockaddr;
                                ^~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/cifs/sess.c:454:2: warning: Call to function 'strcpy' is insecure as it 
does not provide bounding of the memory buffer. Replace unbounded copy 
functions with analogous functions that support length arguments such as 
'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
           strcpy(bcc_ptr, "Linux version ");
           ^~~~~~
   fs/cifs/sess.c:454:2: note: Call to function 'strcpy' is insecure as it does 
not provide bounding of the memory buffer. Replace unbounded copy functions 
with analogous functions that support length arguments such as 'strlcpy'. 
CWE-119
           strcpy(bcc_ptr, "Linux version ");
           ^~~~~~
   fs/cifs/sess.c:456:2: warning: Call to function 'strcpy' is insecure as it 
does not provide bounding of the memory buffer. Replace unbounded copy 
functions with analogous functions that support length arguments such as 
'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
           strcpy(bcc_ptr, init_utsname()->release);
           ^~~~~~
   fs/cifs/sess.c:456:2: note: Call to function 'strcpy' is insecure as it does 
not provide bounding of the memory buffer. Replace unbounded copy functions 
with analogous functions that support length arguments such as 'strlcpy'. 
CWE-119
           strcpy(bcc_ptr, init_utsname()->release);
           ^~~~~~
   fs/cifs/sess.c:459:2: warning: Call to function 'strcpy' is insecure as it 
does not provide bounding of the memory buffer. Replace unbounded copy 
functions with analogous functions that support length arguments such as 
'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
           strcpy(bcc_ptr, CIFS_NETWORK_OPSYS);
           ^~~~~~
   fs/cifs/sess.c:459:2: note: Call to function 'strcpy' is insecure as it does 
not provide bounding of the memory buffer. Replace unbounded copy functions 
with analogous functions that support length arguments such as 'strlcpy'. 
CWE-119
           strcpy(bcc_ptr, CIFS_NETWORK_OPSYS);
           ^~~~~~
   fs/cifs/sess.c:878:2: warning: Attempt to free released memory 
[clang-analyzer-unix.Malloc]
           kfree(sess_data->iov[2].iov_base);
           ^
   fs/cifs/sess.c:1467:6: note: Assuming 'ses' is not equal to NULL
           if (ses == NULL) {
               ^~~~~~~~~~~
   fs/cifs/sess.c:1467:2: note: Taking false branch
           if (ses == NULL) {
           ^
   fs/cifs/sess.c:1473:6: note: Assuming 'sess_data' is non-null
           if (!sess_data)
               ^~~~~~~~~~
   fs/cifs/sess.c:1473:2: note: Taking false branch
           if (!sess_data)
           ^
   fs/cifs/sess.c:1477:6: note: 'rc' is 0
           if (rc)
               ^~
   fs/cifs/sess.c:1477:2: note: Taking false branch
           if (rc)
           ^
   fs/cifs/sess.c:1485:2: note: Loop condition is true.  Entering loop body
           while (sess_data->func)
           ^
   fs/cifs/sess.c:1486:3: note: Calling 'sess_auth_rawntlmssp_negotiate'
                   sess_data->func(sess_data);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/cifs/sess.c:1235:2: note: Taking false branch
           cifs_dbg(FYI, "rawntlmssp session setup negotiate phase\n");
           ^
   fs/cifs/cifs_debug.h:139:2: note: expanded from macro 'cifs_dbg'

vim +/cookie +81 fs/9p/vfs_addr.c

147b31cf09ee49 Eric Van Hensbergen 2006-01-18  74  
44bf5408ff3753 David Howells       2020-11-18  75  /**
44bf5408ff3753 David Howells       2020-11-18  76   * v9fs_is_cache_enabled - 
Determine if caching is enabled for an inode
44bf5408ff3753 David Howells       2020-11-18  77   * @inode: The inode to check
44bf5408ff3753 David Howells       2020-11-18  78   */
44bf5408ff3753 David Howells       2020-11-18  79  static bool 
v9fs_is_cache_enabled(struct inode *inode)
44bf5408ff3753 David Howells       2020-11-18  80  {
9c9776d88423ae David Howells       2020-11-18 @81       struct fscache_cookie 
*cookie = v9fs_inode_cookie(V9FS_I(inode));
9c9776d88423ae David Howells       2020-11-18  82  
9c9776d88423ae David Howells       2020-11-18  83       return 
fscache_cookie_enabled(cookie) && cookie->cache_priv;
44bf5408ff3753 David Howells       2020-11-18  84  }
147b31cf09ee49 Eric Van Hensbergen 2006-01-18  85  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to