CC: [email protected]
CC: [email protected]
BCC: [email protected]
CC: "GNU/Weeb Mailing List" <[email protected]>
CC: [email protected]
TO: David Howells <[email protected]>

tree:   https://github.com/ammarfaizi2/linux-block 
dhowells/linux-fs/netfs-linked-list
head:   a20ca5707a9b524115f5ded439fed1f8e552dd6b
commit: c55ea1834885d2b3da3a8c642f4b52e065a378e5 [41/45] netfs: Generate a 
write request from ->writepages()
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: arm-randconfig-c002-20220428 
(https://download.01.org/0day-ci/archive/20220429/[email protected]/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 
c59473aacce38cd7dd77eebceaf3c98c5707ab3b)
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://github.com/ammarfaizi2/linux-block/commit/c55ea1834885d2b3da3a8c642f4b52e065a378e5
        git remote add ammarfaizi2-block 
https://github.com/ammarfaizi2/linux-block
        git fetch --no-tags ammarfaizi2-block 
dhowells/linux-fs/netfs-linked-list
        git checkout c55ea1834885d2b3da3a8c642f4b52e065a378e5
        # save the config file
        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/fortify-string.h:265:2: note: expanded from macro 
'__fortify_memset_chk'
           __underlying_memset(p, c, __fortify_size);                      \
           ^~~~~~~~~~~~~~~~~~~
   include/linux/fortify-string.h:47:29: note: expanded from macro 
'__underlying_memset'
   #define __underlying_memset     __builtin_memset
                                   ^~~~~~~~~~~~~~~~
   fs/btrfs/tests/extent-io-tests.c:353:2: note: Call to function 'memset' is 
insecure as it does not provide security checks introduced in the C11 standard. 
Replace with analogous functions that support length arguments or provides 
boundary checks such as 'memset_s' in case of C11
           memset(bitmap, 0, len);
           ^
   include/linux/fortify-string.h:272:25: note: expanded from macro 'memset'
   #define memset(p, c, s) __fortify_memset_chk(p, c, s,                   \
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/fortify-string.h:265:2: note: expanded from macro 
'__fortify_memset_chk'
           __underlying_memset(p, c, __fortify_size);                      \
           ^~~~~~~~~~~~~~~~~~~
   include/linux/fortify-string.h:47:29: note: expanded from macro 
'__underlying_memset'
   #define __underlying_memset     __builtin_memset
                                   ^~~~~~~~~~~~~~~~
   Suppressed 59 warnings (59 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.
   61 warnings generated.
   fs/btrfs/tests/inode-tests.c:27:2: warning: Call to function 'memset' is 
insecure as it does not provide security checks introduced in the C11 standard. 
Replace with analogous functions that support length arguments or provides 
boundary checks such as 'memset_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           memset(&path, 0, sizeof(path));
           ^
   include/linux/fortify-string.h:272:25: note: expanded from macro 'memset'
   #define memset(p, c, s) __fortify_memset_chk(p, c, s,                   \
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/fortify-string.h:265:2: note: expanded from macro 
'__fortify_memset_chk'
           __underlying_memset(p, c, __fortify_size);                      \
           ^~~~~~~~~~~~~~~~~~~
   include/linux/fortify-string.h:47:29: note: expanded from macro 
'__underlying_memset'
   #define __underlying_memset     __builtin_memset
                                   ^~~~~~~~~~~~~~~~
   fs/btrfs/tests/inode-tests.c:27:2: note: Call to function 'memset' is 
insecure as it does not provide security checks introduced in the C11 standard. 
Replace with analogous functions that support length arguments or provides 
boundary checks such as 'memset_s' in case of C11
           memset(&path, 0, sizeof(path));
           ^
   include/linux/fortify-string.h:272:25: note: expanded from macro 'memset'
   #define memset(p, c, s) __fortify_memset_chk(p, c, s,                   \
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/fortify-string.h:265:2: note: expanded from macro 
'__fortify_memset_chk'
           __underlying_memset(p, c, __fortify_size);                      \
           ^~~~~~~~~~~~~~~~~~~
   include/linux/fortify-string.h:47:29: note: expanded from macro 
'__underlying_memset'
   #define __underlying_memset     __builtin_memset
                                   ^~~~~~~~~~~~~~~~
   fs/btrfs/tests/inode-tests.c:57:2: warning: Call to function 'memset' is 
insecure as it does not provide security checks introduced in the C11 standard. 
Replace with analogous functions that support length arguments or provides 
boundary checks such as 'memset_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           memset(&path, 0, sizeof(path));
           ^
   include/linux/fortify-string.h:272:25: note: expanded from macro 'memset'
   #define memset(p, c, s) __fortify_memset_chk(p, c, s,                   \
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/fortify-string.h:265:2: note: expanded from macro 
'__fortify_memset_chk'
           __underlying_memset(p, c, __fortify_size);                      \
           ^~~~~~~~~~~~~~~~~~~
   include/linux/fortify-string.h:47:29: note: expanded from macro 
'__underlying_memset'
   #define __underlying_memset     __builtin_memset
                                   ^~~~~~~~~~~~~~~~
   fs/btrfs/tests/inode-tests.c:57:2: note: Call to function 'memset' is 
insecure as it does not provide security checks introduced in the C11 standard. 
Replace with analogous functions that support length arguments or provides 
boundary checks such as 'memset_s' in case of C11
           memset(&path, 0, sizeof(path));
           ^
   include/linux/fortify-string.h:272:25: note: expanded from macro 'memset'
   #define memset(p, c, s) __fortify_memset_chk(p, c, s,                   \
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/fortify-string.h:265:2: note: expanded from macro 
'__fortify_memset_chk'
           __underlying_memset(p, c, __fortify_size);                      \
           ^~~~~~~~~~~~~~~~~~~
   include/linux/fortify-string.h:47:29: note: expanded from macro 
'__underlying_memset'
   #define __underlying_memset     __builtin_memset
                                   ^~~~~~~~~~~~~~~~
   Suppressed 59 warnings (59 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.
   15 warnings generated.
   fs/configfs/item.c:60:9: warning: Call to function 'vsnprintf' is insecure 
as it does not provide security checks introduced in the C11 standard. Replace 
with analogous functions that support length arguments or provides boundary 
checks such as 'vsnprintf_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           need = vsnprintf(item->ci_namebuf, limit, fmt, args);
                  ^~~~~~~~~
   fs/configfs/item.c:60:9: note: Call to function 'vsnprintf' is insecure as 
it does not provide security checks introduced in the C11 standard. Replace 
with analogous functions that support length arguments or provides boundary 
checks such as 'vsnprintf_s' in case of C11
           need = vsnprintf(item->ci_namebuf, limit, fmt, args);
                  ^~~~~~~~~
   Suppressed 14 warnings (14 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.
   49 warnings generated.
   fs/devpts/inode.c:584:2: warning: Call to function 'sprintf' is insecure as 
it does not provide security checks introduced in the C11 standard. Replace 
with analogous functions that support length arguments or provides boundary 
checks such as 'sprintf_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           sprintf(s, "%d", index);
           ^~~~~~~
   fs/devpts/inode.c:584:2: note: Call to function 'sprintf' is insecure as it 
does not provide security checks introduced in the C11 standard. Replace with 
analogous functions that support length arguments or provides boundary checks 
such as 'sprintf_s' in case of C11
           sprintf(s, "%d", index);
           ^~~~~~~
   Suppressed 48 warnings (48 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.
   58 warnings generated.
   fs/netfs/buffered_read.c:497:2: warning: Value stored to 'ret' is never read 
[clang-analyzer-deadcode.DeadStores]
           ret = -ENOMEM;
           ^     ~~~~~~~
   fs/netfs/buffered_read.c:497:2: note: Value stored to 'ret' is never read
           ret = -ENOMEM;
           ^     ~~~~~~~
   Suppressed 57 warnings (57 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.
   58 warnings generated.
>> fs/netfs/buffered_flush.c:639:16: warning: Value stored to 'nr_to_write' 
>> during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           unsigned long nr_to_write = wbc->nr_to_write;
                         ^~~~~~~~~~~   ~~~~~~~~~~~~~~~~
   fs/netfs/buffered_flush.c:639:16: note: Value stored to 'nr_to_write' during 
its initialization is never read
           unsigned long nr_to_write = wbc->nr_to_write;
                         ^~~~~~~~~~~   ~~~~~~~~~~~~~~~~
   Suppressed 57 warnings (57 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.
   60 warnings generated.
   include/linux/list.h:137:13: warning: Use of memory after it is freed 
[clang-analyzer-unix.Malloc]
           __list_del(entry->prev, entry->next);
                      ^
   fs/netfs/buffered_write.c:913:2: note: Loop condition is false. Execution 
continues on line 921
           list_for_each_entry_safe(subreq, p, &rreq->subrequests, rreq_link) {
           ^
   include/linux/list.h:725:2: note: expanded from macro 
'list_for_each_entry_safe'
           for (pos = list_first_entry(head, typeof(*pos), member),        \
           ^
   fs/netfs/buffered_write.c:921:2: note: Loop condition is true.  Entering 
loop body
           list_for_each_entry(subreq, &rreq->subrequests, rreq_link) {
           ^
   include/linux/list.h:638:2: note: expanded from macro 'list_for_each_entry'
           for (pos = list_first_entry(head, typeof(*pos), member);        \
           ^
   fs/netfs/buffered_write.c:926:3: note: Loop condition is false. Execution 
continues on line 936
                   while (!list_is_last(&subreq->rreq_link, 
&rreq->subrequests)) {
                   ^
   fs/netfs/buffered_write.c:921:2: note: Loop condition is false. Execution 
continues on line 939
           list_for_each_entry(subreq, &rreq->subrequests, rreq_link) {
           ^
   include/linux/list.h:638:2: note: expanded from macro 'list_for_each_entry'
           for (pos = list_first_entry(head, typeof(*pos), member);        \
           ^
   fs/netfs/buffered_write.c:940:2: note: Calling 'netfs_unpreallocate_regions'
           netfs_unpreallocate_regions(&spare_regions);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/netfs/buffered_write.c:531:14: note: Left side of '||' is false
           while ((p = list_first_entry_or_null(spare_regions,
                       ^
   include/linux/list.h:554:28: note: expanded from macro 
'list_first_entry_or_null'
           struct list_head *pos__ = READ_ONCE(head__->next); \
                                     ^
   include/asm-generic/rwonce.h:49:2: note: expanded from macro 'READ_ONCE'
           compiletime_assert_rwonce_type(x);                              \
           ^
   include/asm-generic/rwonce.h:36:21: note: expanded from macro 
'compiletime_assert_rwonce_type'
           compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long 
long),  \
                              ^
   include/linux/compiler_types.h:319:3: note: expanded from macro 
'__native_word'
           (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || \
            ^
   fs/netfs/buffered_write.c:531:14: note: Left side of '||' is false
           while ((p = list_first_entry_or_null(spare_regions,
                       ^
   include/linux/list.h:554:28: note: expanded from macro 
'list_first_entry_or_null'
           struct list_head *pos__ = READ_ONCE(head__->next); \
                                     ^
   include/asm-generic/rwonce.h:49:2: note: expanded from macro 'READ_ONCE'
           compiletime_assert_rwonce_type(x);                              \
           ^
   include/asm-generic/rwonce.h:36:21: note: expanded from macro 
'compiletime_assert_rwonce_type'
           compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long 
long),  \
                              ^
   include/linux/compiler_types.h:319:3: note: expanded from macro 
'__native_word'
           (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || \
            ^
   fs/netfs/buffered_write.c:531:14: note: Left side of '||' is true
           while ((p = list_first_entry_or_null(spare_regions,
                       ^
   include/linux/list.h:554:28: note: expanded from macro 
'list_first_entry_or_null'
           struct list_head *pos__ = READ_ONCE(head__->next); \
                                     ^
   include/asm-generic/rwonce.h:49:2: note: expanded from macro 'READ_ONCE'
           compiletime_assert_rwonce_type(x);                              \
           ^
   include/asm-generic/rwonce.h:36:21: note: expanded from macro 
'compiletime_assert_rwonce_type'
           compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long 
long),  \
                              ^
   include/linux/compiler_types.h:320:28: note: expanded from macro 
'__native_word'
            sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long))
                                     ^
   fs/netfs/buffered_write.c:531:14: note: Taking false branch
           while ((p = list_first_entry_or_null(spare_regions,
                       ^
   include/linux/list.h:554:28: note: expanded from macro 
'list_first_entry_or_null'
           struct list_head *pos__ = READ_ONCE(head__->next); \
                                     ^
   include/asm-generic/rwonce.h:49:2: note: expanded from macro 'READ_ONCE'
           compiletime_assert_rwonce_type(x);                              \
           ^
   include/asm-generic/rwonce.h:36:2: note: expanded from macro 
'compiletime_assert_rwonce_type'
           compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long 
long),  \
           ^
   include/linux/compiler_types.h:352:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:340:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:332:3: note: expanded from macro 
'__compiletime_assert'
                   if (!(condition))                                       \

vim +/nr_to_write +639 fs/netfs/buffered_flush.c

c55ea1834885d2 David Howells 2021-06-29  622  
c55ea1834885d2 David Howells 2021-06-29  623  /**
c55ea1834885d2 David Howells 2021-06-29  624   * netfs_writepages - Initiate 
writeback to the server and cache
c55ea1834885d2 David Howells 2021-06-29  625   * @mapping: The pagecache to 
write from
c55ea1834885d2 David Howells 2021-06-29  626   * @wbc: Hints from the VM as to 
what to write
c55ea1834885d2 David Howells 2021-06-29  627   *
c55ea1834885d2 David Howells 2021-06-29  628   * This is a helper intended to 
be called directly from a network filesystem's
c55ea1834885d2 David Howells 2021-06-29  629   * address space operations table 
to perform writeback to the server and the
c55ea1834885d2 David Howells 2021-06-29  630   * cache.
c55ea1834885d2 David Howells 2021-06-29  631   *
c55ea1834885d2 David Howells 2021-06-29  632   * We have to be careful as we 
can end up racing with setattr() truncating the
c55ea1834885d2 David Howells 2021-06-29  633   * pagecache since the caller 
doesn't take a lock here to prevent it.
c55ea1834885d2 David Howells 2021-06-29  634   */
c55ea1834885d2 David Howells 2021-06-29  635  int netfs_writepages(struct 
address_space *mapping,
c55ea1834885d2 David Howells 2021-06-29  636                 struct 
writeback_control *wbc)
c55ea1834885d2 David Howells 2021-06-29  637  {
c55ea1834885d2 David Howells 2021-06-29  638    struct netfs_i_context *ctx = 
netfs_i_context(mapping->host);
c55ea1834885d2 David Howells 2021-06-29 @639    unsigned long nr_to_write = 
wbc->nr_to_write;

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to