* Re: [PATCH 1/6] Kbuild: compile kernel with gnu11 std
@ 2022-03-10 17:35 kernel test robot
0 siblings, 0 replies; 14+ messages in thread
From: kernel test robot @ 2022-03-10 17:35 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 33806 bytes --]
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
In-Reply-To: <20220301075839.4156-2-xiam0nd.tong@gmail.com>
References: <20220301075839.4156-2-xiam0nd.tong@gmail.com>
TO: Xiaomeng Tong <xiam0nd.tong@gmail.com>
TO: torvalds(a)linux-foundation.org
CC: arnd(a)arndb.de
CC: jakobkoschel(a)gmail.com
CC: linux-kernel(a)vger.kernel.org
CC: gregkh(a)linuxfoundation.org
CC: keescook(a)chromium.org
CC: jannh(a)google.com
CC: linux-kbuild(a)vger.kernel.org
CC: linux-mm(a)kvack.org
CC: netdev(a)vger.kernel.org
CC: Xiaomeng Tong <xiam0nd.tong@gmail.com>
Hi Xiaomeng,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linux/master]
[also build test WARNING on vkoul-dmaengine/next soc/for-next linus/master v5.17-rc7 next-20220309]
[cannot apply to hnaz-mm/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Xiaomeng-Tong/list_for_each_entry-make-iterator-invisiable-outside-the-loop/20220301-160113
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 2c271fe77d52a0555161926c232cd5bc07178b39
:::::: branch date: 9 days ago
:::::: commit date: 9 days ago
config: x86_64-randconfig-c007 (https://download.01.org/0day-ci/archive/20220311/202203110136.AB1vmAMG-lkp(a)intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d271fc04d5b97b12e6b797c6067d3c96a8d7470e)
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
# https://github.com/0day-ci/linux/commit/84ec4077430a7e8c23ea1ebc7b69e254fda25cb1
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Xiaomeng-Tong/list_for_each_entry-make-iterator-invisiable-outside-the-loop/20220301-160113
git checkout 84ec4077430a7e8c23ea1ebc7b69e254fda25cb1
# save the config file 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 >>)
drivers/net/ethernet/intel/e1000/e1000_ethtool.c:513:2: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(ptr, bytes, eeprom->len);
^~~~~~
drivers/net/ethernet/intel/e1000/e1000_ethtool.c:513:2: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11
memcpy(ptr, bytes, eeprom->len);
^~~~~~
drivers/net/ethernet/intel/e1000/e1000_ethtool.c:1222:2: warning: Value stored to 'ctrl_reg' is never read [clang-analyzer-deadcode.DeadStores]
ctrl_reg = er32(CTRL);
^
drivers/net/ethernet/intel/e1000/e1000_ethtool.c:1222:2: note: Value stored to 'ctrl_reg' is never read
drivers/net/ethernet/intel/e1000/e1000_ethtool.c:1360: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(skb->data, 0xFF, frame_size);
^~~~~~
drivers/net/ethernet/intel/e1000/e1000_ethtool.c:1360: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(skb->data, 0xFF, frame_size);
^~~~~~
drivers/net/ethernet/intel/e1000/e1000_ethtool.c:1362: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(&skb->data[frame_size / 2], 0xAA, frame_size / 2 - 1);
^~~~~~
drivers/net/ethernet/intel/e1000/e1000_ethtool.c:1362: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(&skb->data[frame_size / 2], 0xAA, frame_size / 2 - 1);
^~~~~~
drivers/net/ethernet/intel/e1000/e1000_ethtool.c:1847:3: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(data, e1000_gstrings_test, sizeof(e1000_gstrings_test));
^~~~~~
drivers/net/ethernet/intel/e1000/e1000_ethtool.c:1847:3: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11
memcpy(data, e1000_gstrings_test, sizeof(e1000_gstrings_test));
^~~~~~
drivers/net/ethernet/intel/e1000/e1000_ethtool.c:1851:4: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(p, e1000_gstrings_stats[i].stat_string,
^~~~~~
drivers/net/ethernet/intel/e1000/e1000_ethtool.c:1851:4: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11
memcpy(p, e1000_gstrings_stats[i].stat_string,
^~~~~~
Suppressed 76 warnings (76 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.
101 warnings generated.
Suppressed 101 warnings (101 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.
69 warnings generated.
Suppressed 69 warnings (69 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.
101 warnings generated.
Suppressed 101 warnings (101 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.
72 warnings generated.
net/netfilter/nfnetlink.c:429:4: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
err = -EINTR;
^ ~~~~~~
net/netfilter/nfnetlink.c:429:4: note: Value stored to 'err' is never read
err = -EINTR;
^ ~~~~~~
net/netfilter/nfnetlink.c:434:3: 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(&extack, 0, sizeof(extack));
^~~~~~
net/netfilter/nfnetlink.c:434:3: 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(&extack, 0, sizeof(extack));
^~~~~~
net/netfilter/nfnetlink.c:436:3: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
err = 0;
^ ~
net/netfilter/nfnetlink.c:436:3: note: Value stored to 'err' is never read
err = 0;
^ ~
Suppressed 69 warnings (69 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.
69 warnings generated.
Suppressed 69 warnings (69 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.
30 warnings generated.
drivers/base/regmap/regmap-mmio.c:52:3: warning: Value stored to 'min_stride' is never read [clang-analyzer-deadcode.DeadStores]
min_stride = 0;
^ ~
drivers/base/regmap/regmap-mmio.c:52:3: note: Value stored to 'min_stride' is never read
min_stride = 0;
^ ~
Suppressed 29 warnings (29 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.
30 warnings generated.
drivers/base/regmap/regmap-irq.c:444:3: 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(data->status_buf, 0, size);
^~~~~~
drivers/base/regmap/regmap-irq.c:444:3: 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(data->status_buf, 0, size);
^~~~~~
Suppressed 29 warnings (29 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.
28 warnings generated.
Suppressed 28 warnings (28 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.
32 warnings generated.
Suppressed 32 warnings (32 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.
33 warnings generated.
Suppressed 33 warnings (33 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.
12 warnings generated.
Suppressed 12 warnings (12 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.
51 warnings generated.
>> drivers/block/zram/zram_drv.c:457:3: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(buf, "none\n", 5);
^~~~~~
drivers/block/zram/zram_drv.c:457:3: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11
memcpy(buf, "none\n", 5);
^~~~~~
>> drivers/block/zram/zram_drv.c:469:2: warning: Call to function 'memmove' 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 'memmove_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memmove(buf, p, ret);
^~~~~~~
drivers/block/zram/zram_drv.c:469:2: note: Call to function 'memmove' 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 'memmove_s' in case of C11
memmove(buf, p, ret);
^~~~~~~
drivers/block/zram/zram_drv.c:1051: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(zram->compressor, compressor);
^~~~~~
drivers/block/zram/zram_drv.c:1051: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(zram->compressor, compressor);
^~~~~~
>> drivers/block/zram/zram_drv.c:1100: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(&pool_stats, 0x00, sizeof(struct zs_pool_stats));
^~~~~~
drivers/block/zram/zram_drv.c:1100: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(&pool_stats, 0x00, sizeof(struct zs_pool_stats));
^~~~~~
drivers/block/zram/zram_drv.c:1301:3: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(dst, src, PAGE_SIZE);
^~~~~~
drivers/block/zram/zram_drv.c:1301:3: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11
memcpy(dst, src, PAGE_SIZE);
^~~~~~
drivers/block/zram/zram_drv.c:1342:3: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(dst + bvec->bv_offset, src + offset, bvec->bv_len);
^~~~~~
drivers/block/zram/zram_drv.c:1342:3: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11
memcpy(dst + bvec->bv_offset, src + offset, bvec->bv_len);
^~~~~~
drivers/block/zram/zram_drv.c:1435:2: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(dst, src, comp_len);
^~~~~~
drivers/block/zram/zram_drv.c:1435:2: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11
memcpy(dst, src, comp_len);
^~~~~~
drivers/block/zram/zram_drv.c:1495:3: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(dst + offset, src + bvec->bv_offset, bvec->bv_len);
^~~~~~
drivers/block/zram/zram_drv.c:1495:3: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11
memcpy(dst + offset, src + bvec->bv_offset, bvec->bv_len);
^~~~~~
drivers/block/zram/zram_drv.c:1739: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(&zram->stats, 0, sizeof(zram->stats));
^~~~~~
drivers/block/zram/zram_drv.c:1739: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(&zram->stats, 0, sizeof(zram->stats));
^~~~~~
>> drivers/block/zram/zram_drv.c:1946:2: warning: Call to function 'snprintf' 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 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
snprintf(zram->disk->disk_name, 16, "zram%d", device_id);
^~~~~~~~
drivers/block/zram/zram_drv.c:1946:2: note: Call to function 'snprintf' 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 'snprintf_s' in case of C11
snprintf(zram->disk->disk_name, 16, "zram%d", device_id);
^~~~~~~~
Suppressed 41 warnings (41 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.
30 warnings generated.
drivers/input/keyboard/lkkbd.c:627:2: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(lk->keycode, lkkbd_keycode, sizeof(lk->keycode));
^~~~~~
drivers/input/keyboard/lkkbd.c:627:2: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11
memcpy(lk->keycode, lkkbd_keycode, sizeof(lk->keycode));
^~~~~~
drivers/input/keyboard/lkkbd.c:630:2: warning: Call to function 'snprintf' 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 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
snprintf(lk->phys, sizeof(lk->phys), "%s/input0", serio->phys);
^~~~~~~~
drivers/input/keyboard/lkkbd.c:630:2: note: Call to function 'snprintf' 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 'snprintf_s' in case of C11
snprintf(lk->phys, sizeof(lk->phys), "%s/input0", serio->phys);
^~~~~~~~
Suppressed 28 warnings (28 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.
30 warnings generated.
drivers/input/keyboard/matrix_keypad.c:127: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(new_state, 0, sizeof(new_state));
^~~~~~
drivers/input/keyboard/matrix_keypad.c:127: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(new_state, 0, sizeof(new_state));
^~~~~~
drivers/input/keyboard/matrix_keypad.c:161:2: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(keypad->last_key_state, new_state, sizeof(new_state));
^~~~~~
drivers/input/keyboard/matrix_keypad.c:161:2: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11
memcpy(keypad->last_key_state, new_state, sizeof(new_state));
^~~~~~
Suppressed 28 warnings (28 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.
67 warnings generated.
Suppressed 67 warnings (67 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.
68 warnings generated.
net/sched/sch_hfsc.c:1131:17: warning: Although the value stored to 'result' is used in the enclosing expression, the value is never actually read from 'result' [clang-analyzer-deadcode.DeadStores]
while (tcf && (result = tcf_classify(skb, NULL, tcf, &res, false)) >= 0) {
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/sched/sch_hfsc.c:1131:17: note: Although the value stored to 'result' is used in the enclosing expression, the value is never actually read from 'result'
while (tcf && (result = tcf_classify(skb, NULL, tcf, &res, false)) >= 0) {
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 67 warnings (67 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.
39 warnings generated.
Suppressed 39 warnings (39 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.
39 warnings generated.
Suppressed 39 warnings (39 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.
40 warnings generated.
drivers/tty/tty_io.c:1192:2: warning: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or 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(p, "%s%c%x",
^~~~~~~
drivers/tty/tty_io.c:1192:2: note: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or 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(p, "%s%c%x",
^~~~~~~
drivers/tty/tty_io.c:1211:10: warning: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or 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]
return sprintf(p, "%s", driver->name);
^~~~~~~
drivers/tty/tty_io.c:1211:10: note: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or 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
return sprintf(p, "%s", driver->name);
^~~~~~~
drivers/tty/tty_io.c:1213:10: warning: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or 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]
return sprintf(p, "%s%d", driver->name,
^~~~~~~
drivers/tty/tty_io.c:1213:10: note: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or 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
return sprintf(p, "%s%d", driver->name,
^~~~~~~
drivers/tty/tty_io.c:2575: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(icount, 0, sizeof(*icount));
^~~~~~
drivers/tty/tty_io.c:2575: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(icount, 0, sizeof(*icount));
^~~~~~
drivers/tty/tty_io.c:2630: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(&v, 0, sizeof(v));
^~~~~~
drivers/tty/tty_io.c:2630: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(&v, 0, sizeof(v));
^~~~~~
drivers/tty/tty_io.c:3558:13: warning: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or 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]
count += sprintf(buf + count, "%s%d",
^~~~~~~
drivers/tty/tty_io.c:3558:13: note: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or 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
count += sprintf(buf + count, "%s%d",
^~~~~~~
drivers/tty/tty_io.c:3561:12: 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]
count += sprintf(buf + count, "%c", i ? ' ':'\n');
^~~~~~~
drivers/tty/tty_io.c:3561:12: 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
count += sprintf(buf + count, "%c", i ? ' ':'\n');
^~~~~~~
Suppressed 33 warnings (33 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 +457 drivers/block/zram/zram_drv.c
013bf95a83ec760 Minchan Kim 2017-09-06 445
013bf95a83ec760 Minchan Kim 2017-09-06 446 static ssize_t backing_dev_show(struct device *dev,
013bf95a83ec760 Minchan Kim 2017-09-06 447 struct device_attribute *attr, char *buf)
013bf95a83ec760 Minchan Kim 2017-09-06 448 {
f7daefe4231e573 Chenwandun 2019-10-18 449 struct file *file;
013bf95a83ec760 Minchan Kim 2017-09-06 450 struct zram *zram = dev_to_zram(dev);
013bf95a83ec760 Minchan Kim 2017-09-06 451 char *p;
013bf95a83ec760 Minchan Kim 2017-09-06 452 ssize_t ret;
013bf95a83ec760 Minchan Kim 2017-09-06 453
013bf95a83ec760 Minchan Kim 2017-09-06 454 down_read(&zram->init_lock);
f7daefe4231e573 Chenwandun 2019-10-18 455 file = zram->backing_dev;
f7daefe4231e573 Chenwandun 2019-10-18 456 if (!file) {
013bf95a83ec760 Minchan Kim 2017-09-06 @457 memcpy(buf, "none\n", 5);
013bf95a83ec760 Minchan Kim 2017-09-06 458 up_read(&zram->init_lock);
013bf95a83ec760 Minchan Kim 2017-09-06 459 return 5;
013bf95a83ec760 Minchan Kim 2017-09-06 460 }
013bf95a83ec760 Minchan Kim 2017-09-06 461
013bf95a83ec760 Minchan Kim 2017-09-06 462 p = file_path(file, buf, PAGE_SIZE - 1);
013bf95a83ec760 Minchan Kim 2017-09-06 463 if (IS_ERR(p)) {
013bf95a83ec760 Minchan Kim 2017-09-06 464 ret = PTR_ERR(p);
013bf95a83ec760 Minchan Kim 2017-09-06 465 goto out;
013bf95a83ec760 Minchan Kim 2017-09-06 466 }
013bf95a83ec760 Minchan Kim 2017-09-06 467
013bf95a83ec760 Minchan Kim 2017-09-06 468 ret = strlen(p);
013bf95a83ec760 Minchan Kim 2017-09-06 @469 memmove(buf, p, ret);
013bf95a83ec760 Minchan Kim 2017-09-06 470 buf[ret++] = '\n';
013bf95a83ec760 Minchan Kim 2017-09-06 471 out:
013bf95a83ec760 Minchan Kim 2017-09-06 472 up_read(&zram->init_lock);
013bf95a83ec760 Minchan Kim 2017-09-06 473 return ret;
013bf95a83ec760 Minchan Kim 2017-09-06 474 }
013bf95a83ec760 Minchan Kim 2017-09-06 475
---
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] 14+ messages in thread
* Re: [PATCH 1/6] Kbuild: compile kernel with gnu11 std
@ 2022-03-04 2:47 kernel test robot
0 siblings, 0 replies; 14+ messages in thread
From: kernel test robot @ 2022-03-04 2:47 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 35825 bytes --]
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
In-Reply-To: <20220301075839.4156-2-xiam0nd.tong@gmail.com>
References: <20220301075839.4156-2-xiam0nd.tong@gmail.com>
TO: Xiaomeng Tong <xiam0nd.tong@gmail.com>
TO: torvalds(a)linux-foundation.org
CC: arnd(a)arndb.de
CC: jakobkoschel(a)gmail.com
CC: linux-kernel(a)vger.kernel.org
CC: gregkh(a)linuxfoundation.org
CC: keescook(a)chromium.org
CC: jannh(a)google.com
CC: linux-kbuild(a)vger.kernel.org
CC: linux-mm(a)kvack.org
CC: netdev(a)vger.kernel.org
CC: Xiaomeng Tong <xiam0nd.tong@gmail.com>
Hi Xiaomeng,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linux/master]
[also build test WARNING on vkoul-dmaengine/next soc/for-next linus/master v5.17-rc6 next-20220303]
[cannot apply to hnaz-mm/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Xiaomeng-Tong/list_for_each_entry-make-iterator-invisiable-outside-the-loop/20220301-160113
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 2c271fe77d52a0555161926c232cd5bc07178b39
:::::: branch date: 3 days ago
:::::: commit date: 3 days ago
config: x86_64-randconfig-c007 (https://download.01.org/0day-ci/archive/20220304/202203040554.spGLPb81-lkp(a)intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d271fc04d5b97b12e6b797c6067d3c96a8d7470e)
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
# https://github.com/0day-ci/linux/commit/84ec4077430a7e8c23ea1ebc7b69e254fda25cb1
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Xiaomeng-Tong/list_for_each_entry-make-iterator-invisiable-outside-the-loop/20220301-160113
git checkout 84ec4077430a7e8c23ea1ebc7b69e254fda25cb1
# save the config file 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 >>)
^~~~~~
drivers/net/slip/slhc.c:632:4: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(cp, cs->cs_tcpopt, ((thp->doff) - 5) * 4);
^~~~~~
drivers/net/slip/slhc.c:632:4: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11
memcpy(cp, cs->cs_tcpopt, ((thp->doff) - 5) * 4);
^~~~~~
drivers/net/slip/slhc.c:679:2: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(&cs->cs_ip,icp,20);
^~~~~~
drivers/net/slip/slhc.c:679:2: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11
memcpy(&cs->cs_ip,icp,20);
^~~~~~
drivers/net/slip/slhc.c:680:2: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(&cs->cs_tcp,icp + ihl*4,20);
^~~~~~
drivers/net/slip/slhc.c:680:2: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11
memcpy(&cs->cs_tcp,icp + ihl*4,20);
^~~~~~
drivers/net/slip/slhc.c:682:4: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(cs->cs_ipopt, icp + sizeof(struct iphdr), (ihl - 5) * 4);
^~~~~~
drivers/net/slip/slhc.c:682:4: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11
memcpy(cs->cs_ipopt, icp + sizeof(struct iphdr), (ihl - 5) * 4);
^~~~~~
drivers/net/slip/slhc.c:684:4: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(cs->cs_tcpopt, icp + ihl*4 + sizeof(struct tcphdr), (cs->cs_tcp.doff - 5) * 4);
^~~~~~
drivers/net/slip/slhc.c:684:4: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11
memcpy(cs->cs_tcpopt, icp + ihl*4 + sizeof(struct tcphdr), (cs->cs_tcp.doff - 5) * 4);
^~~~~~
Suppressed 99 warnings (99 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.
30 warnings generated.
drivers/input/keyboard/lkkbd.c:627:2: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(lk->keycode, lkkbd_keycode, sizeof(lk->keycode));
^~~~~~
drivers/input/keyboard/lkkbd.c:627:2: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11
memcpy(lk->keycode, lkkbd_keycode, sizeof(lk->keycode));
^~~~~~
drivers/input/keyboard/lkkbd.c:630:2: warning: Call to function 'snprintf' 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 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
snprintf(lk->phys, sizeof(lk->phys), "%s/input0", serio->phys);
^~~~~~~~
drivers/input/keyboard/lkkbd.c:630:2: note: Call to function 'snprintf' 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 'snprintf_s' in case of C11
snprintf(lk->phys, sizeof(lk->phys), "%s/input0", serio->phys);
^~~~~~~~
Suppressed 28 warnings (28 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.
30 warnings generated.
drivers/input/keyboard/matrix_keypad.c:127: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(new_state, 0, sizeof(new_state));
^~~~~~
drivers/input/keyboard/matrix_keypad.c:127: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(new_state, 0, sizeof(new_state));
^~~~~~
drivers/input/keyboard/matrix_keypad.c:161:2: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(keypad->last_key_state, new_state, sizeof(new_state));
^~~~~~
drivers/input/keyboard/matrix_keypad.c:161:2: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11
memcpy(keypad->last_key_state, new_state, sizeof(new_state));
^~~~~~
Suppressed 28 warnings (28 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.
29 warnings generated.
drivers/input/serio/libps2.c:245:2: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(send_param, param, send);
^~~~~~
drivers/input/serio/libps2.c:245:2: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11
memcpy(send_param, param, send);
^~~~~~
Suppressed 28 warnings (28 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.
drivers/input/gameport/gameport.c:462:9: warning: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or 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]
return sprintf(buf, "%s\n", gameport->name);
^~~~~~~
drivers/input/gameport/gameport.c:462:9: note: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or 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
return sprintf(buf, "%s\n", gameport->name);
^~~~~~~
drivers/input/gameport/gameport.c:516:2: 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]
vsnprintf(gameport->phys, sizeof(gameport->phys), fmt, args);
^~~~~~~~~
drivers/input/gameport/gameport.c:516:2: 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
vsnprintf(gameport->phys, sizeof(gameport->phys), fmt, args);
^~~~~~~~~
drivers/input/gameport/gameport.c:681:9: warning: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or 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]
return sprintf(buf, "%s\n", driver->description ? driver->description : "(none)");
^~~~~~~
drivers/input/gameport/gameport.c:681:9: note: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or 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
return sprintf(buf, "%s\n", driver->description ? driver->description : "(none)");
^~~~~~~
Suppressed 12 warnings (12 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.
33 warnings generated.
Suppressed 33 warnings (33 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.
12 warnings generated.
Suppressed 12 warnings (12 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.
51 warnings generated.
>> drivers/block/zram/zram_drv.c:457:3: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(buf, "none\n", 5);
^~~~~~
drivers/block/zram/zram_drv.c:457:3: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11
memcpy(buf, "none\n", 5);
^~~~~~
>> drivers/block/zram/zram_drv.c:469:2: warning: Call to function 'memmove' 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 'memmove_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memmove(buf, p, ret);
^~~~~~~
drivers/block/zram/zram_drv.c:469:2: note: Call to function 'memmove' 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 'memmove_s' in case of C11
memmove(buf, p, ret);
^~~~~~~
drivers/block/zram/zram_drv.c:1051: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(zram->compressor, compressor);
^~~~~~
drivers/block/zram/zram_drv.c:1051: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(zram->compressor, compressor);
^~~~~~
>> drivers/block/zram/zram_drv.c:1100: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(&pool_stats, 0x00, sizeof(struct zs_pool_stats));
^~~~~~
drivers/block/zram/zram_drv.c:1100: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(&pool_stats, 0x00, sizeof(struct zs_pool_stats));
^~~~~~
drivers/block/zram/zram_drv.c:1301:3: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(dst, src, PAGE_SIZE);
^~~~~~
drivers/block/zram/zram_drv.c:1301:3: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11
memcpy(dst, src, PAGE_SIZE);
^~~~~~
drivers/block/zram/zram_drv.c:1342:3: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(dst + bvec->bv_offset, src + offset, bvec->bv_len);
^~~~~~
drivers/block/zram/zram_drv.c:1342:3: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11
memcpy(dst + bvec->bv_offset, src + offset, bvec->bv_len);
^~~~~~
drivers/block/zram/zram_drv.c:1435:2: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(dst, src, comp_len);
^~~~~~
drivers/block/zram/zram_drv.c:1435:2: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11
memcpy(dst, src, comp_len);
^~~~~~
drivers/block/zram/zram_drv.c:1495:3: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(dst + offset, src + bvec->bv_offset, bvec->bv_len);
^~~~~~
drivers/block/zram/zram_drv.c:1495:3: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11
memcpy(dst + offset, src + bvec->bv_offset, bvec->bv_len);
^~~~~~
drivers/block/zram/zram_drv.c:1739: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(&zram->stats, 0, sizeof(zram->stats));
^~~~~~
drivers/block/zram/zram_drv.c:1739: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(&zram->stats, 0, sizeof(zram->stats));
^~~~~~
>> drivers/block/zram/zram_drv.c:1946:2: warning: Call to function 'snprintf' 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 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
snprintf(zram->disk->disk_name, 16, "zram%d", device_id);
^~~~~~~~
drivers/block/zram/zram_drv.c:1946:2: note: Call to function 'snprintf' 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 'snprintf_s' in case of C11
snprintf(zram->disk->disk_name, 16, "zram%d", device_id);
^~~~~~~~
Suppressed 41 warnings (41 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.
57 warnings generated.
drivers/ptp/ptp_kvm_common.c:100:2: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(ts, &tspec, sizeof(struct timespec64));
^~~~~~
drivers/ptp/ptp_kvm_common.c:100:2: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11
memcpy(ts, &tspec, sizeof(struct timespec64));
^~~~~~
Suppressed 56 warnings (56 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.
18 warnings generated.
Suppressed 18 warnings (18 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.
18 warnings generated.
drivers/power/supply/power_supply_sysfs.c:251:13: warning: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or 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]
count += sprintf(buf + count, "[%s] ",
^~~~~~~
drivers/power/supply/power_supply_sysfs.c:251:13: note: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or 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
count += sprintf(buf + count, "[%s] ",
^~~~~~~
drivers/power/supply/power_supply_sysfs.c:255:13: warning: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or 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]
count += sprintf(buf + count, "%s ",
^~~~~~~
drivers/power/supply/power_supply_sysfs.c:255:13: note: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or 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
count += sprintf(buf + count, "%s ",
^~~~~~~
drivers/power/supply/power_supply_sysfs.c:299:10: warning: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or 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]
return sprintf(buf, "%s\n", ps_attr->text_values[value.intval]);
^~~~~~~
drivers/power/supply/power_supply_sysfs.c:299:10: note: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or 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
return sprintf(buf, "%s\n", ps_attr->text_values[value.intval]);
^~~~~~~
drivers/power/supply/power_supply_sysfs.c:308:9: warning: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or 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]
ret = sprintf(buf, "%s\n", value.strval);
^~~~~~~
drivers/power/supply/power_supply_sysfs.c:308:9: note: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or 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
ret = sprintf(buf, "%s\n", value.strval);
^~~~~~~
drivers/power/supply/power_supply_sysfs.c:311:9: 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]
ret = sprintf(buf, "%d\n", value.intval);
^~~~~~~
drivers/power/supply/power_supply_sysfs.c:311:9: 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
ret = sprintf(buf, "%d\n", value.intval);
^~~~~~~
drivers/power/supply/power_supply_sysfs.c:415:4: 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(power_supply_attrs[i].attr_name, "_err_%d", i);
^~~~~~~
drivers/power/supply/power_supply_sysfs.c:415:4: 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(power_supply_attrs[i].attr_name, "_err_%d", i);
^~~~~~~
Suppressed 12 warnings (12 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.
65 warnings generated.
drivers/net/phy/nxp-c45-tja11xx.c:438:3: 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(&shhwtstamps, 0, sizeof(shhwtstamps));
^~~~~~
drivers/net/phy/nxp-c45-tja11xx.c:438:3: 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(&shhwtstamps, 0, sizeof(shhwtstamps));
^~~~~~
drivers/net/phy/nxp-c45-tja11xx.c:845:3: warning: Call to function 'strncpy' 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 'strncpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
strncpy(data + i * ETH_GSTRING_LEN,
^~~~~~~
drivers/net/phy/nxp-c45-tja11xx.c:845:3: note: Call to function 'strncpy' 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 'strncpy_s' in case of C11
strncpy(data + i * ETH_GSTRING_LEN,
^~~~~~~
Suppressed 63 warnings (63 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.
65 warnings generated.
Suppressed 65 warnings (65 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.
62 warnings generated.
drivers/net/phy/realtek.c:813:3: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
err = phy_write_paged(phydev, 0xa42, RTL9000A_GINMR, val);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/phy/realtek.c:813:3: note: Value stored to 'err' is never read
err = phy_write_paged(phydev, 0xa42, RTL9000A_GINMR, val);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/phy/realtek.c:820:3: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
err = rtl9000a_ack_interrupt(phydev);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/phy/realtek.c:820:3: note: Value stored to 'err' is never read
err = rtl9000a_ack_interrupt(phydev);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 60 warnings (60 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.
59 warnings generated.
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.
63 warnings generated.
Suppressed 63 warnings (63 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.
59 warnings generated.
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.
vim +457 drivers/block/zram/zram_drv.c
013bf95a83ec760 Minchan Kim 2017-09-06 445
013bf95a83ec760 Minchan Kim 2017-09-06 446 static ssize_t backing_dev_show(struct device *dev,
013bf95a83ec760 Minchan Kim 2017-09-06 447 struct device_attribute *attr, char *buf)
013bf95a83ec760 Minchan Kim 2017-09-06 448 {
f7daefe4231e573 Chenwandun 2019-10-18 449 struct file *file;
013bf95a83ec760 Minchan Kim 2017-09-06 450 struct zram *zram = dev_to_zram(dev);
013bf95a83ec760 Minchan Kim 2017-09-06 451 char *p;
013bf95a83ec760 Minchan Kim 2017-09-06 452 ssize_t ret;
013bf95a83ec760 Minchan Kim 2017-09-06 453
013bf95a83ec760 Minchan Kim 2017-09-06 454 down_read(&zram->init_lock);
f7daefe4231e573 Chenwandun 2019-10-18 455 file = zram->backing_dev;
f7daefe4231e573 Chenwandun 2019-10-18 456 if (!file) {
013bf95a83ec760 Minchan Kim 2017-09-06 @457 memcpy(buf, "none\n", 5);
013bf95a83ec760 Minchan Kim 2017-09-06 458 up_read(&zram->init_lock);
013bf95a83ec760 Minchan Kim 2017-09-06 459 return 5;
013bf95a83ec760 Minchan Kim 2017-09-06 460 }
013bf95a83ec760 Minchan Kim 2017-09-06 461
013bf95a83ec760 Minchan Kim 2017-09-06 462 p = file_path(file, buf, PAGE_SIZE - 1);
013bf95a83ec760 Minchan Kim 2017-09-06 463 if (IS_ERR(p)) {
013bf95a83ec760 Minchan Kim 2017-09-06 464 ret = PTR_ERR(p);
013bf95a83ec760 Minchan Kim 2017-09-06 465 goto out;
013bf95a83ec760 Minchan Kim 2017-09-06 466 }
013bf95a83ec760 Minchan Kim 2017-09-06 467
013bf95a83ec760 Minchan Kim 2017-09-06 468 ret = strlen(p);
013bf95a83ec760 Minchan Kim 2017-09-06 @469 memmove(buf, p, ret);
013bf95a83ec760 Minchan Kim 2017-09-06 470 buf[ret++] = '\n';
013bf95a83ec760 Minchan Kim 2017-09-06 471 out:
013bf95a83ec760 Minchan Kim 2017-09-06 472 up_read(&zram->init_lock);
013bf95a83ec760 Minchan Kim 2017-09-06 473 return ret;
013bf95a83ec760 Minchan Kim 2017-09-06 474 }
013bf95a83ec760 Minchan Kim 2017-09-06 475
---
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] 14+ messages in thread
* Re: [PATCH 1/6] Kbuild: compile kernel with gnu11 std
2022-03-01 21:15 ` Linus Torvalds
@ 2022-03-01 21:43 ` Xiaomeng Tong
-1 siblings, 0 replies; 14+ messages in thread
From: Xiaomeng Tong @ 2022-03-01 21:43 UTC (permalink / raw)
To: torvalds
Cc: arnd, gregkh, jakobkoschel, jannh, kbuild-all, keescook,
linux-kbuild, linux-kernel, linux-mm, lkp, netdev, xiam0nd.tong
Sincerely thank you for your reply. I also look forward to your comments
on other patches, especially PATCH 2/6 which provides new *_inside macros
to make iterator invisiable outside the list_for_each_entry* loop.
Best regards,
--
Xiaomeng Tong
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/6] Kbuild: compile kernel with gnu11 std
@ 2022-03-01 21:43 ` Xiaomeng Tong
0 siblings, 0 replies; 14+ messages in thread
From: Xiaomeng Tong @ 2022-03-01 21:43 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 251 bytes --]
Sincerely thank you for your reply. I also look forward to your comments
on other patches, especially PATCH 2/6 which provides new *_inside macros
to make iterator invisiable outside the list_for_each_entry* loop.
Best regards,
--
Xiaomeng Tong
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/6] Kbuild: compile kernel with gnu11 std
2022-03-01 21:04 ` Linus Torvalds
@ 2022-03-01 21:15 ` Linus Torvalds
-1 siblings, 0 replies; 14+ messages in thread
From: Linus Torvalds @ 2022-03-01 21:15 UTC (permalink / raw)
To: Arnd Bergmann
Cc: kernel test robot, Xiaomeng Tong, kbuild-all, Jakob Koschel,
Linux Kernel Mailing List, Greg Kroah-Hartman, Kees Cook,
Jann Horn, Linux Kbuild mailing list, Linux-MM, Netdev
On Tue, Mar 1, 2022 at 1:04 PM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> Yeah, looks like that "<< 16" is likely just wrong.
.. and perhaps more importantly, I guess that means that -Wshift-overflow is
(a) somehow new to -std=gnu11
(b) possibly a lot more relevant and good than that
-Wshift-negative-value thing was
doing some grepping, it seems like we have never had that
'-Wshift-overflow' even in any extra warnings.
And trying it myself (keeping -std=gnu89), enabling it doesn't report
anything on a x86-64 allmodconfig build.
So I think this is likely a good new warning that -std=gnu11 brought
in by accident. No false positives that I can see, and one report for
a MIPS bug that looks real (but admittedly not a "sky-is-falling" one
;)
There's apparently a '-Wshift-overflow=2' mode too, but that warns
about things that change the sign bit, ie expressions like
1<<31
warns.
And I would not be in the least surprised if we had a ton of those
kinds of things all over (but I didn't check).
So the plain -Wshift-overflow seems to work just fine, and while it's
surprising that it got enabled by gnu11, I think it's all good.
Famous last words.
Linus
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/6] Kbuild: compile kernel with gnu11 std
@ 2022-03-01 21:15 ` Linus Torvalds
0 siblings, 0 replies; 14+ messages in thread
From: Linus Torvalds @ 2022-03-01 21:15 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 1252 bytes --]
On Tue, Mar 1, 2022 at 1:04 PM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> Yeah, looks like that "<< 16" is likely just wrong.
.. and perhaps more importantly, I guess that means that -Wshift-overflow is
@ somehow new to -std=gnu11
(b) possibly a lot more relevant and good than that
-Wshift-negative-value thing was
doing some grepping, it seems like we have never had that
'-Wshift-overflow' even in any extra warnings.
And trying it myself (keeping -std=gnu89), enabling it doesn't report
anything on a x86-64 allmodconfig build.
So I think this is likely a good new warning that -std=gnu11 brought
in by accident. No false positives that I can see, and one report for
a MIPS bug that looks real (but admittedly not a "sky-is-falling" one
;)
There's apparently a '-Wshift-overflow=2' mode too, but that warns
about things that change the sign bit, ie expressions like
1<<31
warns.
And I would not be in the least surprised if we had a ton of those
kinds of things all over (but I didn't check).
So the plain -Wshift-overflow seems to work just fine, and while it's
surprising that it got enabled by gnu11, I think it's all good.
Famous last words.
Linus
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/6] Kbuild: compile kernel with gnu11 std
2022-03-01 20:54 ` Arnd Bergmann
@ 2022-03-01 21:04 ` Linus Torvalds
-1 siblings, 0 replies; 14+ messages in thread
From: Linus Torvalds @ 2022-03-01 21:04 UTC (permalink / raw)
To: Arnd Bergmann
Cc: kernel test robot, Xiaomeng Tong, kbuild-all, Jakob Koschel,
Linux Kernel Mailing List, Greg Kroah-Hartman, Kees Cook,
Jann Horn, Linux Kbuild mailing list, Linux-MM, Netdev
On Tue, Mar 1, 2022 at 12:54 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> gcc-11 only shows the one line warning here.
What an odd warning. Not even a filename, much less a line number?
> The source is
>
> /* PCI CFG04 status fields */
> #define PCI_CFG04_STAT_BIT 16
> #define PCI_CFG04_STAT 0xffff0000
> #define PCI_CFG04_STAT_66_MHZ (1 << 21)
> #define PCI_CFG04_STAT_FBB (1 << 23)
> #define PCI_CFG04_STAT_MDPE (1 << 24)
> #define PCI_CFG04_STAT_DST (1 << 25)
> #define PCI_CFG04_STAT_STA (1 << 27)
> #define PCI_CFG04_STAT_RTA (1 << 28)
> #define PCI_CFG04_STAT_RMA (1 << 29)
> #define PCI_CFG04_STAT_SSE (1 << 30)
> #define PCI_CFG04_STAT_PE (1 << 31)
> #define KORINA_STAT (PCI_CFG04_STAT_MDPE | \
> PCI_CFG04_STAT_STA | \
> PCI_CFG04_STAT_RTA | \
> PCI_CFG04_STAT_RMA | \
> PCI_CFG04_STAT_SSE | \
> PCI_CFG04_STAT_PE)
> #define KORINA_CNFG1 ((KORINA_STAT<<16)|KORINA_CMD)
Yeah, looks like that "<< 16" is likely just wrong.
I'm guessing that that KORINA_CNFG1 thing either ends up not
mattering, or - probably more likely - nobody really used that
platform at all. It has had pretty much zero updates sinced 2008.
Linus
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/6] Kbuild: compile kernel with gnu11 std
@ 2022-03-01 21:04 ` Linus Torvalds
0 siblings, 0 replies; 14+ messages in thread
From: Linus Torvalds @ 2022-03-01 21:04 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 1421 bytes --]
On Tue, Mar 1, 2022 at 12:54 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> gcc-11 only shows the one line warning here.
What an odd warning. Not even a filename, much less a line number?
> The source is
>
> /* PCI CFG04 status fields */
> #define PCI_CFG04_STAT_BIT 16
> #define PCI_CFG04_STAT 0xffff0000
> #define PCI_CFG04_STAT_66_MHZ (1 << 21)
> #define PCI_CFG04_STAT_FBB (1 << 23)
> #define PCI_CFG04_STAT_MDPE (1 << 24)
> #define PCI_CFG04_STAT_DST (1 << 25)
> #define PCI_CFG04_STAT_STA (1 << 27)
> #define PCI_CFG04_STAT_RTA (1 << 28)
> #define PCI_CFG04_STAT_RMA (1 << 29)
> #define PCI_CFG04_STAT_SSE (1 << 30)
> #define PCI_CFG04_STAT_PE (1 << 31)
> #define KORINA_STAT (PCI_CFG04_STAT_MDPE | \
> PCI_CFG04_STAT_STA | \
> PCI_CFG04_STAT_RTA | \
> PCI_CFG04_STAT_RMA | \
> PCI_CFG04_STAT_SSE | \
> PCI_CFG04_STAT_PE)
> #define KORINA_CNFG1 ((KORINA_STAT<<16)|KORINA_CMD)
Yeah, looks like that "<< 16" is likely just wrong.
I'm guessing that that KORINA_CNFG1 thing either ends up not
mattering, or - probably more likely - nobody really used that
platform@all. It has had pretty much zero updates sinced 2008.
Linus
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/6] Kbuild: compile kernel with gnu11 std
2022-03-01 20:16 ` Linus Torvalds
@ 2022-03-01 20:54 ` Arnd Bergmann
-1 siblings, 0 replies; 14+ messages in thread
From: Arnd Bergmann @ 2022-03-01 20:54 UTC (permalink / raw)
To: Linus Torvalds
Cc: kernel test robot, Xiaomeng Tong, kbuild-all, Arnd Bergmann,
Jakob Koschel, Linux Kernel Mailing List, Greg Kroah-Hartman,
Kees Cook, Jann Horn, Linux Kbuild mailing list, Linux-MM,
Netdev
On Tue, Mar 1, 2022 at 9:16 PM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> On Tue, Mar 1, 2022 at 10:00 AM kernel test robot <lkp@intel.com> wrote:
> >
> > All warnings (new ones prefixed by >>):
> >
> > >> cc1: warning: result of '-117440512 << 16' requires 44 bits to represent, but 'int' only has 32 bits [-Wshift-overflow=]
>
> So that's potentially an interesting warning, but this email doesn't
> actually tell *where* that warning happens.
>
> I'm not entirely sure why this warning is new to this '-std=gnu11'
> change, but it's intriguing.
...
>
> Is there some place to actually see the full log (or some way to get a
> better pointer to just the new warning) to see that actual shift
> overflow thing?
gcc-11 only shows the one line warning here. The source is
/* PCI CFG04 status fields */
#define PCI_CFG04_STAT_BIT 16
#define PCI_CFG04_STAT 0xffff0000
#define PCI_CFG04_STAT_66_MHZ (1 << 21)
#define PCI_CFG04_STAT_FBB (1 << 23)
#define PCI_CFG04_STAT_MDPE (1 << 24)
#define PCI_CFG04_STAT_DST (1 << 25)
#define PCI_CFG04_STAT_STA (1 << 27)
#define PCI_CFG04_STAT_RTA (1 << 28)
#define PCI_CFG04_STAT_RMA (1 << 29)
#define PCI_CFG04_STAT_SSE (1 << 30)
#define PCI_CFG04_STAT_PE (1 << 31)
#define KORINA_STAT (PCI_CFG04_STAT_MDPE | \
PCI_CFG04_STAT_STA | \
PCI_CFG04_STAT_RTA | \
PCI_CFG04_STAT_RMA | \
PCI_CFG04_STAT_SSE | \
PCI_CFG04_STAT_PE)
#define KORINA_CNFG1 ((KORINA_STAT<<16)|KORINA_CMD)
unsigned int korina_cnfg_regs[25] = {
KORINA_CNFG1, /* ... */
};
This looks like an actual bug to me, the bits are shifted 16 bits twice
by accident, and it's been like this since rb532 was introduced in
2008.
Arnd
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/6] Kbuild: compile kernel with gnu11 std
@ 2022-03-01 20:54 ` Arnd Bergmann
0 siblings, 0 replies; 14+ messages in thread
From: Arnd Bergmann @ 2022-03-01 20:54 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 1954 bytes --]
On Tue, Mar 1, 2022 at 9:16 PM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> On Tue, Mar 1, 2022 at 10:00 AM kernel test robot <lkp@intel.com> wrote:
> >
> > All warnings (new ones prefixed by >>):
> >
> > >> cc1: warning: result of '-117440512 << 16' requires 44 bits to represent, but 'int' only has 32 bits [-Wshift-overflow=]
>
> So that's potentially an interesting warning, but this email doesn't
> actually tell *where* that warning happens.
>
> I'm not entirely sure why this warning is new to this '-std=gnu11'
> change, but it's intriguing.
...
>
> Is there some place to actually see the full log (or some way to get a
> better pointer to just the new warning) to see that actual shift
> overflow thing?
gcc-11 only shows the one line warning here. The source is
/* PCI CFG04 status fields */
#define PCI_CFG04_STAT_BIT 16
#define PCI_CFG04_STAT 0xffff0000
#define PCI_CFG04_STAT_66_MHZ (1 << 21)
#define PCI_CFG04_STAT_FBB (1 << 23)
#define PCI_CFG04_STAT_MDPE (1 << 24)
#define PCI_CFG04_STAT_DST (1 << 25)
#define PCI_CFG04_STAT_STA (1 << 27)
#define PCI_CFG04_STAT_RTA (1 << 28)
#define PCI_CFG04_STAT_RMA (1 << 29)
#define PCI_CFG04_STAT_SSE (1 << 30)
#define PCI_CFG04_STAT_PE (1 << 31)
#define KORINA_STAT (PCI_CFG04_STAT_MDPE | \
PCI_CFG04_STAT_STA | \
PCI_CFG04_STAT_RTA | \
PCI_CFG04_STAT_RMA | \
PCI_CFG04_STAT_SSE | \
PCI_CFG04_STAT_PE)
#define KORINA_CNFG1 ((KORINA_STAT<<16)|KORINA_CMD)
unsigned int korina_cnfg_regs[25] = {
KORINA_CNFG1, /* ... */
};
This looks like an actual bug to me, the bits are shifted 16 bits twice
by accident, and it's been like this since rb532 was introduced in
2008.
Arnd
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/6] Kbuild: compile kernel with gnu11 std
2022-03-01 17:59 ` kernel test robot
@ 2022-03-01 20:16 ` Linus Torvalds
0 siblings, 0 replies; 14+ messages in thread
From: Linus Torvalds @ 2022-03-01 20:16 UTC (permalink / raw)
To: kernel test robot
Cc: Xiaomeng Tong, kbuild-all, Arnd Bergmann, Jakob Koschel,
Linux Kernel Mailing List, Greg Kroah-Hartman, Kees Cook,
Jann Horn, Linux Kbuild mailing list, Linux-MM, Netdev
On Tue, Mar 1, 2022 at 10:00 AM kernel test robot <lkp@intel.com> wrote:
>
> All warnings (new ones prefixed by >>):
>
> >> cc1: warning: result of '-117440512 << 16' requires 44 bits to represent, but 'int' only has 32 bits [-Wshift-overflow=]
So that's potentially an interesting warning, but this email doesn't
actually tell *where* that warning happens.
I'm not entirely sure why this warning is new to this '-std=gnu11'
change, but it's intriguing.
Instead it then gives the location for another warning:
> arch/mips/pci/pci-rc32434.c: In function 'rc32434_pcibridge_init':
> arch/mips/pci/pci-rc32434.c:111:22: warning: variable 'dummyread' set but not used [-Wunused-but-set-variable]
> 111 | unsigned int dummyread, pcicntlval;
> | ^~~~~~~~~
but that wasn't the new one (and that 'dummyread' is obviously
_intentionally_ set but not used, as implied by the name).
Is there some place to actually see the full log (or some way to get a
better pointer to just the new warning) to see that actual shift
overflow thing?
Linus
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/6] Kbuild: compile kernel with gnu11 std
@ 2022-03-01 20:16 ` Linus Torvalds
0 siblings, 0 replies; 14+ messages in thread
From: Linus Torvalds @ 2022-03-01 20:16 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 1125 bytes --]
On Tue, Mar 1, 2022 at 10:00 AM kernel test robot <lkp@intel.com> wrote:
>
> All warnings (new ones prefixed by >>):
>
> >> cc1: warning: result of '-117440512 << 16' requires 44 bits to represent, but 'int' only has 32 bits [-Wshift-overflow=]
So that's potentially an interesting warning, but this email doesn't
actually tell *where* that warning happens.
I'm not entirely sure why this warning is new to this '-std=gnu11'
change, but it's intriguing.
Instead it then gives the location for another warning:
> arch/mips/pci/pci-rc32434.c: In function 'rc32434_pcibridge_init':
> arch/mips/pci/pci-rc32434.c:111:22: warning: variable 'dummyread' set but not used [-Wunused-but-set-variable]
> 111 | unsigned int dummyread, pcicntlval;
> | ^~~~~~~~~
but that wasn't the new one (and that 'dummyread' is obviously
_intentionally_ set but not used, as implied by the name).
Is there some place to actually see the full log (or some way to get a
better pointer to just the new warning) to see that actual shift
overflow thing?
Linus
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/6] Kbuild: compile kernel with gnu11 std
2022-03-01 7:58 ` [PATCH 1/6] Kbuild: compile kernel with gnu11 std Xiaomeng Tong
@ 2022-03-01 17:59 ` kernel test robot
2022-03-01 20:16 ` Linus Torvalds
0 siblings, 1 reply; 14+ messages in thread
From: kernel test robot @ 2022-03-01 17:59 UTC (permalink / raw)
To: Xiaomeng Tong, torvalds
Cc: kbuild-all, arnd, jakobkoschel, linux-kernel, gregkh, keescook,
jannh, linux-kbuild, linux-mm, netdev, Xiaomeng Tong
Hi Xiaomeng,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linux/master]
[also build test WARNING on vkoul-dmaengine/next soc/for-next linus/master v5.17-rc6 next-20220301]
[cannot apply to hnaz-mm/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Xiaomeng-Tong/list_for_each_entry-make-iterator-invisiable-outside-the-loop/20220301-160113
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 2c271fe77d52a0555161926c232cd5bc07178b39
config: mips-rb532_defconfig (https://download.01.org/0day-ci/archive/20220302/202203020135.5duGpXM2-lkp@intel.com/config)
compiler: mipsel-linux-gcc (GCC) 11.2.0
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
# https://github.com/0day-ci/linux/commit/84ec4077430a7e8c23ea1ebc7b69e254fda25cb1
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Xiaomeng-Tong/list_for_each_entry-make-iterator-invisiable-outside-the-loop/20220301-160113
git checkout 84ec4077430a7e8c23ea1ebc7b69e254fda25cb1
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=mips SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> cc1: warning: result of '-117440512 << 16' requires 44 bits to represent, but 'int' only has 32 bits [-Wshift-overflow=]
arch/mips/pci/pci-rc32434.c: In function 'rc32434_pcibridge_init':
arch/mips/pci/pci-rc32434.c:111:22: warning: variable 'dummyread' set but not used [-Wunused-but-set-variable]
111 | unsigned int dummyread, pcicntlval;
| ^~~~~~~~~
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 1/6] Kbuild: compile kernel with gnu11 std
2022-03-01 7:58 [PATCH 0/6] list_for_each_entry*: make iterator invisiable outside the loop Xiaomeng Tong
@ 2022-03-01 7:58 ` Xiaomeng Tong
2022-03-01 17:59 ` kernel test robot
0 siblings, 1 reply; 14+ messages in thread
From: Xiaomeng Tong @ 2022-03-01 7:58 UTC (permalink / raw)
To: torvalds
Cc: arnd, jakobkoschel, linux-kernel, gregkh, keescook, jannh,
linux-kbuild, linux-mm, netdev, Xiaomeng Tong
This patch is suggested by linus[1], there may be some corner cases which
should be considered before merge, and is just for prove PATCH 2.
[1]: https://lore.kernel.org/all/CAHk-=wh97QY9fEQUK6zMVQwaQ_JWDvR=R+TxQ_0OYrMHQ+egvQ@mail.gmail.com/
Signed-off-by: Xiaomeng Tong <xiam0nd.tong@gmail.com>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 289ce2be8..84a96ae3c 100644
--- a/Makefile
+++ b/Makefile
@@ -515,7 +515,7 @@ KBUILD_CFLAGS := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \
-fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
-Werror=implicit-function-declaration -Werror=implicit-int \
-Werror=return-type -Wno-format-security \
- -std=gnu89
+ -std=gnu11 -Wno-shift-negative-value
KBUILD_CPPFLAGS := -D__KERNEL__
KBUILD_AFLAGS_KERNEL :=
KBUILD_CFLAGS_KERNEL :=
--
2.17.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
end of thread, other threads:[~2022-03-10 17:35 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-10 17:35 [PATCH 1/6] Kbuild: compile kernel with gnu11 std kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2022-03-04 2:47 kernel test robot
2022-03-01 7:58 [PATCH 0/6] list_for_each_entry*: make iterator invisiable outside the loop Xiaomeng Tong
2022-03-01 7:58 ` [PATCH 1/6] Kbuild: compile kernel with gnu11 std Xiaomeng Tong
2022-03-01 17:59 ` kernel test robot
2022-03-01 20:16 ` Linus Torvalds
2022-03-01 20:16 ` Linus Torvalds
2022-03-01 20:54 ` Arnd Bergmann
2022-03-01 20:54 ` Arnd Bergmann
2022-03-01 21:04 ` Linus Torvalds
2022-03-01 21:04 ` Linus Torvalds
2022-03-01 21:15 ` Linus Torvalds
2022-03-01 21:15 ` Linus Torvalds
2022-03-01 21:43 ` Xiaomeng Tong
2022-03-01 21:43 ` Xiaomeng Tong
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.