[kees:for-next/lkdtm 3/4] drivers/misc/lkdtm/usercopy.c:74:39: error: use of undeclared identifier 'current_stack_pointer'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/lkdtm
head: 2223f39d57e495531165ed5bf1d94bf4f1be7963
commit: d89624a74df284274743400bb318dba7246250a4 [3/4] lkdtm/usercopy: Expand size of "out of frame" object
config: riscv-randconfig-r004-20220216 (https://download.01.org/0day-ci/archive/20220217/202202171116.tFKzkUFI-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0bad7cb56526f2572c74449fcf97c1fcda42b41d)
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 riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/commit/?id...
git remote add kees https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git
git fetch --no-tags kees for-next/lkdtm
git checkout d89624a74df284274743400bb318dba7246250a4
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/misc/lkdtm/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> drivers/misc/lkdtm/usercopy.c:74:39: error: use of undeclared identifier 'current_stack_pointer'
pr_info("stack : %px\n", (void *)current_stack_pointer);
^
1 error generated.
vim +/current_stack_pointer +74 drivers/misc/lkdtm/usercopy.c
53
54 static noinline void do_usercopy_stack(bool to_user, bool bad_frame)
55 {
56 unsigned long user_addr;
57 unsigned char good_stack[32];
58 unsigned char *bad_stack;
59 int i;
60
61 /* Exercise stack to avoid everything living in registers. */
62 for (i = 0; i < sizeof(good_stack); i++)
63 good_stack[i] = test_text[i % sizeof(test_text)];
64
65 /* This is a pointer to outside our current stack frame. */
66 if (bad_frame) {
67 bad_stack = do_usercopy_stack_callee((uintptr_t)&bad_stack);
68 } else {
69 /* Put start address just inside stack. */
70 bad_stack = task_stack_page(current) + THREAD_SIZE;
71 bad_stack -= sizeof(unsigned long);
72 }
73
> 74 pr_info("stack : %px\n", (void *)current_stack_pointer);
75 pr_info("good_stack: %px-%px\n", good_stack, good_stack + sizeof(good_stack));
76 pr_info("bad_stack : %px-%px\n", bad_stack, bad_stack + sizeof(good_stack));
77
78 user_addr = vm_mmap(NULL, 0, PAGE_SIZE,
79 PROT_READ | PROT_WRITE | PROT_EXEC,
80 MAP_ANONYMOUS | MAP_PRIVATE, 0);
81 if (user_addr >= TASK_SIZE) {
82 pr_warn("Failed to allocate user memory\n");
83 return;
84 }
85
86 if (to_user) {
87 pr_info("attempting good copy_to_user of local stack\n");
88 if (copy_to_user((void __user *)user_addr, good_stack,
89 unconst + sizeof(good_stack))) {
90 pr_warn("copy_to_user failed unexpectedly?!\n");
91 goto free_user;
92 }
93
94 pr_info("attempting bad copy_to_user of distant stack\n");
95 if (copy_to_user((void __user *)user_addr, bad_stack,
96 unconst + sizeof(good_stack))) {
97 pr_warn("copy_to_user failed, but lacked Oops\n");
98 goto free_user;
99 }
100 } else {
101 /*
102 * There isn't a safe way to not be protected by usercopy
103 * if we're going to write to another thread's stack.
104 */
105 if (!bad_frame)
106 goto free_user;
107
108 pr_info("attempting good copy_from_user of local stack\n");
109 if (copy_from_user(good_stack, (void __user *)user_addr,
110 unconst + sizeof(good_stack))) {
111 pr_warn("copy_from_user failed unexpectedly?!\n");
112 goto free_user;
113 }
114
115 pr_info("attempting bad copy_from_user of distant stack\n");
116 if (copy_from_user(bad_stack, (void __user *)user_addr,
117 unconst + sizeof(good_stack))) {
118 pr_warn("copy_from_user failed, but lacked Oops\n");
119 goto free_user;
120 }
121 }
122
123 free_user:
124 vm_munmap(user_addr, PAGE_SIZE);
125 }
126
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months
[ammarfaizi2-block:dhowells/linux-fs/netfs-maple 29/42] fs/netfs/buffered_write.c:28:26: warning: comparison of distinct pointer types ('typeof (((1UL) << 12) - offset) *' (aka 'unsigned long *') and 'typeof (size) *' (aka 'unsigned int *'))
by kernel test robot
tree: https://github.com/ammarfaizi2/linux-block dhowells/linux-fs/netfs-maple
head: 5cb7f190822d09757b30cd9539e57eef72552d1f
commit: 261cd621bd0477d43de460dea6c7bf7fa81824be [29/42] netfs: Implement buffered writes through netfs_file_write_iter()
config: i386-randconfig-a015 (https://download.01.org/0day-ci/archive/20220217/202202171009.cJVDSV3U-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0bad7cb56526f2572c74449fcf97c1fcda42b41d)
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/ammarfaizi2/linux-block/commit/261cd621bd0477d43de460d...
git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
git fetch --no-tags ammarfaizi2-block dhowells/linux-fs/netfs-maple
git checkout 261cd621bd0477d43de460dea6c7bf7fa81824be
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash fs/netfs/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> fs/netfs/buffered_write.c:28:26: warning: comparison of distinct pointer types ('typeof (((1UL) << 12) - offset) *' (aka 'unsigned long *') and 'typeof (size) *' (aka 'unsigned int *')) [-Wcompare-distinct-pointer-types]
unsigned int psize = min(PAGE_SIZE - offset, size);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:45:19: note: expanded from macro 'min'
#define min(x, y) __careful_cmp(x, y, <)
^~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:36:24: note: expanded from macro '__careful_cmp'
__builtin_choose_expr(__safe_cmp(x, y), \
^~~~~~~~~~~~~~~~
include/linux/minmax.h:26:4: note: expanded from macro '__safe_cmp'
(__typecheck(x, y) && __no_side_effects(x, y))
^~~~~~~~~~~~~~~~~
include/linux/minmax.h:20:28: note: expanded from macro '__typecheck'
(!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
fs/netfs/buffered_write.c:95:18: warning: comparison of distinct pointer types ('typeof (target->from) *' (aka 'unsigned long long *') and 'typeof (folio_pos(folio) + offset) *' (aka 'long long *')) [-Wcompare-distinct-pointer-types]
target->from = min(target->from, folio_pos(folio) + offset);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:45:19: note: expanded from macro 'min'
#define min(x, y) __careful_cmp(x, y, <)
^~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:36:24: note: expanded from macro '__careful_cmp'
__builtin_choose_expr(__safe_cmp(x, y), \
^~~~~~~~~~~~~~~~
include/linux/minmax.h:26:4: note: expanded from macro '__safe_cmp'
(__typecheck(x, y) && __no_side_effects(x, y))
^~~~~~~~~~~~~~~~~
include/linux/minmax.h:20:28: note: expanded from macro '__typecheck'
(!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
fs/netfs/buffered_write.c:96:18: warning: comparison of distinct pointer types ('typeof (target->to) *' (aka 'unsigned long long *') and 'typeof (folio_pos(folio) + offset + len) *' (aka 'long long *')) [-Wcompare-distinct-pointer-types]
target->to = max(target->to, folio_pos(folio) + offset + len);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:52:19: note: expanded from macro 'max'
#define max(x, y) __careful_cmp(x, y, >)
^~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:36:24: note: expanded from macro '__careful_cmp'
__builtin_choose_expr(__safe_cmp(x, y), \
^~~~~~~~~~~~~~~~
include/linux/minmax.h:26:4: note: expanded from macro '__safe_cmp'
(__typecheck(x, y) && __no_side_effects(x, y))
^~~~~~~~~~~~~~~~~
include/linux/minmax.h:20:28: note: expanded from macro '__typecheck'
(!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
3 warnings generated.
vim +28 fs/netfs/buffered_write.c
18
19 static size_t copy_folio_from_iter_atomic(struct folio *folio,
20 unsigned int offset, size_t size,
21 struct iov_iter *i)
22 {
23 size_t copied = 0, n;
24
25 do {
26 unsigned int index = offset / PAGE_SIZE;
27 unsigned int poffset = offset % PAGE_SIZE;
> 28 unsigned int psize = min(PAGE_SIZE - offset, size);
29
30 n = copy_page_from_iter_atomic(folio_file_page(folio, index),
31 poffset, psize, i);
32 copied += n;
33 if (n < psize)
34 break;
35 size -= n;
36 } while (size);
37 return copied;
38 }
39
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months
[kees:for-next/lkdtm 3/4] drivers/misc/lkdtm/usercopy.c:74:46: error: 'current_stack_pointer' undeclared; did you mean 'user_stack_pointer'?
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/lkdtm
head: 2223f39d57e495531165ed5bf1d94bf4f1be7963
commit: d89624a74df284274743400bb318dba7246250a4 [3/4] lkdtm/usercopy: Expand size of "out of frame" object
config: openrisc-randconfig-r004-20220216 (https://download.01.org/0day-ci/archive/20220217/202202170944.e2X9PAcw-lk...)
compiler: or1k-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://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/commit/?id...
git remote add kees https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git
git fetch --no-tags kees for-next/lkdtm
git checkout d89624a74df284274743400bb318dba7246250a4
# 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=openrisc SHELL=/bin/bash drivers/misc/lkdtm/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/kernel.h:29,
from drivers/misc/lkdtm/lkdtm.h:7,
from drivers/misc/lkdtm/usercopy.c:6:
drivers/misc/lkdtm/usercopy.c: In function 'do_usercopy_stack':
>> drivers/misc/lkdtm/usercopy.c:74:46: error: 'current_stack_pointer' undeclared (first use in this function); did you mean 'user_stack_pointer'?
74 | pr_info("stack : %px\n", (void *)current_stack_pointer);
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/printk.h:418:33: note: in definition of macro 'printk_index_wrap'
418 | _p_func(_fmt, ##__VA_ARGS__); \
| ^~~~~~~~~~~
include/linux/printk.h:519:9: note: in expansion of macro 'printk'
519 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~
drivers/misc/lkdtm/usercopy.c:74:9: note: in expansion of macro 'pr_info'
74 | pr_info("stack : %px\n", (void *)current_stack_pointer);
| ^~~~~~~
drivers/misc/lkdtm/usercopy.c:74:46: note: each undeclared identifier is reported only once for each function it appears in
74 | pr_info("stack : %px\n", (void *)current_stack_pointer);
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/printk.h:418:33: note: in definition of macro 'printk_index_wrap'
418 | _p_func(_fmt, ##__VA_ARGS__); \
| ^~~~~~~~~~~
include/linux/printk.h:519:9: note: in expansion of macro 'printk'
519 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~
drivers/misc/lkdtm/usercopy.c:74:9: note: in expansion of macro 'pr_info'
74 | pr_info("stack : %px\n", (void *)current_stack_pointer);
| ^~~~~~~
vim +74 drivers/misc/lkdtm/usercopy.c
53
54 static noinline void do_usercopy_stack(bool to_user, bool bad_frame)
55 {
56 unsigned long user_addr;
57 unsigned char good_stack[32];
58 unsigned char *bad_stack;
59 int i;
60
61 /* Exercise stack to avoid everything living in registers. */
62 for (i = 0; i < sizeof(good_stack); i++)
63 good_stack[i] = test_text[i % sizeof(test_text)];
64
65 /* This is a pointer to outside our current stack frame. */
66 if (bad_frame) {
67 bad_stack = do_usercopy_stack_callee((uintptr_t)&bad_stack);
68 } else {
69 /* Put start address just inside stack. */
70 bad_stack = task_stack_page(current) + THREAD_SIZE;
71 bad_stack -= sizeof(unsigned long);
72 }
73
> 74 pr_info("stack : %px\n", (void *)current_stack_pointer);
75 pr_info("good_stack: %px-%px\n", good_stack, good_stack + sizeof(good_stack));
76 pr_info("bad_stack : %px-%px\n", bad_stack, bad_stack + sizeof(good_stack));
77
78 user_addr = vm_mmap(NULL, 0, PAGE_SIZE,
79 PROT_READ | PROT_WRITE | PROT_EXEC,
80 MAP_ANONYMOUS | MAP_PRIVATE, 0);
81 if (user_addr >= TASK_SIZE) {
82 pr_warn("Failed to allocate user memory\n");
83 return;
84 }
85
86 if (to_user) {
87 pr_info("attempting good copy_to_user of local stack\n");
88 if (copy_to_user((void __user *)user_addr, good_stack,
89 unconst + sizeof(good_stack))) {
90 pr_warn("copy_to_user failed unexpectedly?!\n");
91 goto free_user;
92 }
93
94 pr_info("attempting bad copy_to_user of distant stack\n");
95 if (copy_to_user((void __user *)user_addr, bad_stack,
96 unconst + sizeof(good_stack))) {
97 pr_warn("copy_to_user failed, but lacked Oops\n");
98 goto free_user;
99 }
100 } else {
101 /*
102 * There isn't a safe way to not be protected by usercopy
103 * if we're going to write to another thread's stack.
104 */
105 if (!bad_frame)
106 goto free_user;
107
108 pr_info("attempting good copy_from_user of local stack\n");
109 if (copy_from_user(good_stack, (void __user *)user_addr,
110 unconst + sizeof(good_stack))) {
111 pr_warn("copy_from_user failed unexpectedly?!\n");
112 goto free_user;
113 }
114
115 pr_info("attempting bad copy_from_user of distant stack\n");
116 if (copy_from_user(bad_stack, (void __user *)user_addr,
117 unconst + sizeof(good_stack))) {
118 pr_warn("copy_from_user failed, but lacked Oops\n");
119 goto free_user;
120 }
121 }
122
123 free_user:
124 vm_munmap(user_addr, PAGE_SIZE);
125 }
126
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months
drivers/net/ethernet/marvell/pxa168_eth.c:1575:34: warning: unused variable 'pxa168_eth_of_match'
by kernel test robot
Hi Masahiro,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 3593030761630e09200072a4bd06468892c27be3
commit: ea29b20a828511de3348334e529a3d046a180416 init/Kconfig: make COMPILE_TEST depend on HAS_IOMEM
date: 11 months ago
config: s390-randconfig-r044-20220217 (https://download.01.org/0day-ci/archive/20220217/202202170947.93cVhp12-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0e628a783b935c70c80815db6c061ec84f884af5)
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 s390 cross compiling tool for clang build
# apt-get install binutils-s390x-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout ea29b20a828511de3348334e529a3d046a180416
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=s390 SHELL=/bin/bash drivers/net/ethernet/marvell/ drivers/staging/media/hantro/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : \
^
include/uapi/linux/swab.h:19:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
^
In file included from drivers/net/ethernet/marvell/pxa168_eth.c:16:
In file included from include/linux/dma-mapping.h:10:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:80:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : \
^
include/uapi/linux/swab.h:20:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \
^
In file included from drivers/net/ethernet/marvell/pxa168_eth.c:16:
In file included from include/linux/dma-mapping.h:10:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:80:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : \
^
include/uapi/linux/swab.h:21:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
^
In file included from drivers/net/ethernet/marvell/pxa168_eth.c:16:
In file included from include/linux/dma-mapping.h:10:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:80:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : \
^
include/uapi/linux/swab.h:22:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0xff000000UL) >> 24)))
^
In file included from drivers/net/ethernet/marvell/pxa168_eth.c:16:
In file included from include/linux/dma-mapping.h:10:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:80:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:120:12: note: expanded from macro '__swab32'
__fswab32(x))
^
In file included from drivers/net/ethernet/marvell/pxa168_eth.c:16:
In file included from include/linux/dma-mapping.h:10:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:80:
include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:609:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:617:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:625:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:634:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:643:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:652:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
>> drivers/net/ethernet/marvell/pxa168_eth.c:1575:34: warning: unused variable 'pxa168_eth_of_match' [-Wunused-const-variable]
static const struct of_device_id pxa168_eth_of_match[] = {
^
21 warnings generated.
--
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : \
^
include/uapi/linux/swab.h:20:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \
^
In file included from drivers/staging/media/hantro/hantro_drv.c:23:
In file included from include/media/v4l2-mem2mem.h:16:
In file included from include/media/videobuf2-v4l2.h:16:
In file included from include/media/videobuf2-core.h:18:
In file included from include/linux/dma-buf.h:16:
In file included from include/linux/dma-buf-map.h:9:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:80:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : \
^
include/uapi/linux/swab.h:21:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
^
In file included from drivers/staging/media/hantro/hantro_drv.c:23:
In file included from include/media/v4l2-mem2mem.h:16:
In file included from include/media/videobuf2-v4l2.h:16:
In file included from include/media/videobuf2-core.h:18:
In file included from include/linux/dma-buf.h:16:
In file included from include/linux/dma-buf-map.h:9:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:80:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : \
^
include/uapi/linux/swab.h:22:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0xff000000UL) >> 24)))
^
In file included from drivers/staging/media/hantro/hantro_drv.c:23:
In file included from include/media/v4l2-mem2mem.h:16:
In file included from include/media/videobuf2-v4l2.h:16:
In file included from include/media/videobuf2-core.h:18:
In file included from include/linux/dma-buf.h:16:
In file included from include/linux/dma-buf-map.h:9:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:80:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:120:12: note: expanded from macro '__swab32'
__fswab32(x))
^
In file included from drivers/staging/media/hantro/hantro_drv.c:23:
In file included from include/media/v4l2-mem2mem.h:16:
In file included from include/media/videobuf2-v4l2.h:16:
In file included from include/media/videobuf2-core.h:18:
In file included from include/linux/dma-buf.h:16:
In file included from include/linux/dma-buf-map.h:9:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:80:
include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:609:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:617:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:625:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:634:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:643:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:652:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
>> drivers/staging/media/hantro/hantro_drv.c:473:34: warning: unused variable 'of_hantro_match' [-Wunused-const-variable]
static const struct of_device_id of_hantro_match[] = {
^
21 warnings generated.
vim +/pxa168_eth_of_match +1575 drivers/net/ethernet/marvell/pxa168_eth.c
a49f37eed22b74 drivers/net/pxa168_eth.c Sachin Sanap 2010-08-13 1574
43d3ddf87a57ce drivers/net/ethernet/marvell/pxa168_eth.c Antoine Tenart 2014-09-30 @1575 static const struct of_device_id pxa168_eth_of_match[] = {
43d3ddf87a57ce drivers/net/ethernet/marvell/pxa168_eth.c Antoine Tenart 2014-09-30 1576 { .compatible = "marvell,pxa168-eth" },
43d3ddf87a57ce drivers/net/ethernet/marvell/pxa168_eth.c Antoine Tenart 2014-09-30 1577 { },
43d3ddf87a57ce drivers/net/ethernet/marvell/pxa168_eth.c Antoine Tenart 2014-09-30 1578 };
43d3ddf87a57ce drivers/net/ethernet/marvell/pxa168_eth.c Antoine Tenart 2014-09-30 1579 MODULE_DEVICE_TABLE(of, pxa168_eth_of_match);
43d3ddf87a57ce drivers/net/ethernet/marvell/pxa168_eth.c Antoine Tenart 2014-09-30 1580
:::::: The code at line 1575 was first introduced by commit
:::::: 43d3ddf87a57ce34fad298138b892744c33bfca5 net: pxa168_eth: add device tree support
:::::: TO: Antoine Ténart <antoine.tenart(a)free-electrons.com>
:::::: CC: David S. Miller <davem(a)davemloft.net>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months
[ceph-client:testing 13/14] fs/ceph/snap.c:438:14: warning: variable '_realm' is uninitialized when used here
by kernel test robot
tree: https://github.com/ceph/ceph-client.git testing
head: 91e59cfc6ca1a2bf594f60474996c71047edd1e5
commit: 7c7e63bc9910b15ffd1f791838ff0a919058f97c [13/14] ceph: eliminate the recursion when rebuilding the snap context
config: hexagon-randconfig-r005-20220216 (https://download.01.org/0day-ci/archive/20220217/202202170318.82LIXBXX-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0e628a783b935c70c80815db6c061ec84f884af5)
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/ceph/ceph-client/commit/7c7e63bc9910b15ffd1f791838ff0a...
git remote add ceph-client https://github.com/ceph/ceph-client.git
git fetch --no-tags ceph-client testing
git checkout 7c7e63bc9910b15ffd1f791838ff0a919058f97c
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash fs/ceph/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> fs/ceph/snap.c:438:14: warning: variable '_realm' is uninitialized when used here [-Wuninitialized]
list_del(&_realm->rebuild_item);
^~~~~~
fs/ceph/snap.c:430:33: note: initialize the variable '_realm' to silence this warning
struct ceph_snap_realm *_realm, *child;
^
= NULL
1 warning generated.
vim +/_realm +438 fs/ceph/snap.c
417
418 /*
419 * rebuild snap context for the given realm and all of its children.
420 */
421 static void rebuild_snap_realms(struct ceph_snap_realm *realm,
422 struct list_head *dirty_realms)
423 {
424 LIST_HEAD(realm_queue);
425 int last = 0;
426
427 list_add_tail(&realm->rebuild_item, &realm_queue);
428
429 while (!list_empty(&realm_queue)) {
430 struct ceph_snap_realm *_realm, *child;
431
432 /*
433 * If the last building failed dues to memory
434 * issue, just empty the realm_queue and return
435 * to avoid infinite loop.
436 */
437 if (last < 0) {
> 438 list_del(&_realm->rebuild_item);
439 continue;
440 }
441
442 _realm = list_first_entry(&realm_queue,
443 struct ceph_snap_realm,
444 rebuild_item);
445 last = build_snap_context(_realm, &realm_queue, dirty_realms);
446 dout("rebuild_snap_realms %llx %p, %s\n", _realm->ino, _realm,
447 last > 0 ? "is deferred" : !last ? "succeeded" : "failed");
448
449 list_for_each_entry(child, &_realm->children, child_item)
450 list_add_tail(&child->rebuild_item, &realm_queue);
451
452 /* last == 1 means need to build parent first */
453 if (last <= 0)
454 list_del(&_realm->rebuild_item);
455 }
456 }
457
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months
Re: [PATCH] usercopy: Check valid lifetime via stack depth
by kernel test robot
Hi Kees,
I love your patch! Yet something to improve:
[auto build test ERROR on hnaz-mm/master]
[also build test ERROR on kees/for-next/pstore v5.17-rc4 next-20220216]
[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/Kees-Cook/usercopy-Check-valid-l...
base: https://github.com/hnaz/linux-mm master
config: openrisc-randconfig-r002-20220216 (https://download.01.org/0day-ci/archive/20220217/202202170844.jnpFFEmh-lk...)
compiler: or1k-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/77944e5fa0cf5a29903b72466a22152c6...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Kees-Cook/usercopy-Check-valid-lifetime-via-stack-depth/20220217-041611
git checkout 77944e5fa0cf5a29903b72466a22152c6a5d41ac
# 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=openrisc SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
mm/usercopy.c: In function 'check_stack_object':
>> mm/usercopy.c:41:42: error: 'current_stack_pointer' undeclared (first use in this function); did you mean 'user_stack_pointer'?
41 | const void * const low = (void *)current_stack_pointer;
| ^~~~~~~~~~~~~~~~~~~~~
| user_stack_pointer
mm/usercopy.c:41:42: note: each undeclared identifier is reported only once for each function it appears in
mm/usercopy.c: In function '__check_object_size':
mm/usercopy.c:287:41: error: 'current_stack_pointer' undeclared (first use in this function); did you mean 'user_stack_pointer'?
287 | (void *)current_stack_pointer - ptr,
| ^~~~~~~~~~~~~~~~~~~~~
| user_stack_pointer
vim +41 mm/usercopy.c
24
25 /*
26 * Checks if a given pointer and length is contained by the current
27 * stack frame (if possible).
28 *
29 * Returns:
30 * NOT_STACK: not at all on the stack
31 * GOOD_FRAME: fully within a valid stack frame
32 * GOOD_STACK: within the current stack (when can't frame-check exactly)
33 * BAD_STACK: error condition (invalid stack position or bad stack frame)
34 */
35 static noinline int check_stack_object(const void *obj, unsigned long len)
36 {
37 const void * const stack = task_stack_page(current);
38 const void * const stackend = stack + THREAD_SIZE;
39 #ifndef CONFIG_STACK_GROWSUP
40 const void * const high = stackend;
> 41 const void * const low = (void *)current_stack_pointer;
42 #else
43 const void * const high = (void *)current_stack_pointer;
44 const void * const low = stack;
45 #endif
46 int ret;
47
48 /* Object is not on the stack at all. */
49 if (obj + len <= stack || stackend <= obj)
50 return NOT_STACK;
51
52 /*
53 * Reject: object partially overlaps the stack (passing the
54 * check above means at least one end is within the stack,
55 * so if this check fails, the other end is outside the stack).
56 */
57 if (obj < stack || stackend < obj + len)
58 return BAD_STACK;
59
60 /* Check if object is safely within a valid frame. */
61 ret = arch_within_stack_frames(stack, stackend, obj, len);
62 if (ret)
63 return ret;
64
65 /*
66 * Reject: object not within current stack depth.
67 */
68 if (obj < low || high < obj + len)
69 return BAD_STACK;
70
71 return GOOD_STACK;
72 }
73
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months