tree:
https://github.com/zen-kernel/zen-kernel 5.11/futex2
head: ea9a7956b5f6f44f3ee70d82542c64fcb7c86c5e
commit: a64bf661d4fc6dbfde640bf002eae2e22884a419 [1/13] futex2: Implement wait and wake
functions
config: mips-randconfig-r036-20210218 (attached as .config)
compiler: clang version 12.0.0 (
https://github.com/llvm/llvm-project
c9439ca36342fb6013187d0a69aef92736951476)
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 mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
#
https://github.com/zen-kernel/zen-kernel/commit/a64bf661d4fc6dbfde640bf00...
git remote add zen-kernel-zen-kernel
https://github.com/zen-kernel/zen-kernel
git fetch --no-tags zen-kernel-zen-kernel 5.11/futex2
git checkout a64bf661d4fc6dbfde640bf002eae2e22884a419
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips
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 >>):
> kernel/futex2.c:163:16: warning: incompatible integer to pointer
conversion passing 'uintptr_t' (aka 'unsigned long') to parameter of type
'const void *' [-Wint-conversion]
if
(unlikely(!access_ok(address, sizeof(u32))))
~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/mips/include/asm/uaccess.h:134:21: note: expanded from macro 'access_ok'
likely(__access_ok((addr), (size)))
^
include/linux/compiler.h:77:40: note: expanded from macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
arch/mips/include/asm/uaccess.h:127:50: note: passing argument to parameter 'p'
here
static inline int __access_ok(const void __user *p, unsigned long size)
^
1 warning generated.
vim +163 kernel/futex2.c
145
146 /**
147 * futex_get_bucket - Check if the user address is valid, prepare internal
148 * data and calculate the hash
149 * @uaddr: futex user address
150 * @key: data that uniquely identifies a futex
151 *
152 * Return: address of bucket on success, error code otherwise
153 */
154 static struct futex_bucket *futex_get_bucket(void __user *uaddr,
155 struct futex_key *key)
156 {
157 uintptr_t address = (uintptr_t)uaddr;
158 u32 hash_key;
159
160 /* Checking if uaddr is valid and accessible */
161 if (unlikely(!IS_ALIGNED(address, sizeof(u32))))
162 return ERR_PTR(-EINVAL);
163 if (unlikely(!access_ok(address, sizeof(u32))))
164 return ERR_PTR(-EFAULT);
165
166 key->offset = address % PAGE_SIZE;
167 address -= key->offset;
168 key->pointer = (u64)address;
169 key->index = (unsigned long)current->mm;
170
171 /* Generate hash key for this futex using uaddr and current->mm */
172 hash_key = jhash2((u32 *)key, sizeof(*key) / sizeof(u32), 0);
173
174 /* Since HASH_SIZE is 2^n, subtracting 1 makes a perfect bit mask */
175 return &futex_table[hash_key & (futex2_hashsize - 1)];
176 }
177
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org