Re: [PATCH v5] mm: Optional full ASLR for mmap(), mremap(), vdso and stack

kernel test robot
2020-11-30T06:09:29Z

[-- Attachment #1: Type: text/plain, Size: 4621 bytes --]

Hi Topi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on aae5ab854e38151e69f261dbf0e3b7e396403178]

url: https://github.com/0day-ci/linux/commits/Topi-Miettinen/mm-Optional-full-ASLR-for-mmap-mremap-vdso-and-stack/20201130-051703
base: aae5ab854e38151e69f261dbf0e3b7e396403178
config: x86_64-randconfig-a002-20201130 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project f502b14d40e751fe00afc493ef0d08f196524886)
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 x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/c06384c5cecf700db214c69a4565c41a4c4fad82
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Topi-Miettinen/mm-Optional-full-ASLR-for-mmap-mremap-vdso-and-stack/20201130-051703
git checkout c06384c5cecf700db214c69a4565c41a4c4fad82
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64

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 >>):

arch/x86/entry/vdso/vma.c:38:19: warning: no previous prototype for function 'arch_get_vdso_data' [-Wmissing-prototypes]
struct vdso_data *arch_get_vdso_data(void *vvar_page)
^
arch/x86/entry/vdso/vma.c:38:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
struct vdso_data *arch_get_vdso_data(void *vvar_page)
^
static
>> arch/x86/entry/vdso/vma.c:382:9: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
if (!IS_ERR_VALUE(ret))
^~~~~~~~~~~~~~~~~
include/linux/err.h:22:49: note: expanded from macro 'IS_ERR_VALUE'
#define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO)
~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:48:41: note: expanded from macro 'unlikely'
# define unlikely(x) (__branch_check__(x, 0, __builtin_constant_p(x)))
~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:33:34: note: expanded from macro '__branch_check__'
______r = __builtin_expect(!!(x), expect); \
^
>> arch/x86/entry/vdso/vma.c:382:9: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
if (!IS_ERR_VALUE(ret))
^~~~~~~~~~~~~~~~~
include/linux/err.h:22:49: note: expanded from macro 'IS_ERR_VALUE'
#define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO)
~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:48:68: note: expanded from macro 'unlikely'
# define unlikely(x) (__branch_check__(x, 0, __builtin_constant_p(x)))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
include/linux/compiler.h:35:19: note: expanded from macro '__branch_check__'
expect, is_constant); \
^~~~~~~~~~~
3 warnings generated.

vim +382 arch/x86/entry/vdso/vma.c

364
365 static int map_vdso_randomized(const struct vdso_image *image)
366 {
367 unsigned long addr;
368
369 if (randomize_va_space == 3) {
370 /*
371 * Randomize vdso address.
372 */
373 int i = MAX_RANDOM_VDSO_RETRIES;
374
375 do {
376 int ret;
377
378 /* Try a few times to find a free area */
379 addr = arch_mmap_rnd();
380
381 ret = map_vdso(image, addr);
> 382 if (!IS_ERR_VALUE(ret))
383 return ret;
384 } while (--i >= 0);
385
386 /* Give up and try the less random way */
387 }
388 addr = vdso_addr(current->mm->start_stack, image->size-image->sym_vvar_start);
389
390 return map_vdso(image, addr);
391 }
392 #endif
393

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34002 bytes --]