[ragnatech:media-tree 247/250] arch/arm64/include/asm/uaccess.h:403:18: note: in expansion of macro '__put_user'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   git://git.ragnatech.se/linux media-tree
head:   343b23a7c6b6680ef949e6112a4ee60688acf39d
commit: f863ce990030cfc5a57a490b4613be4a523ffce1 [247/250] media: dvb: get rid of VIDEO_SET_SPU_PALETTE
config: arm64-allmodconfig (attached as .config)
compiler: aarch64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout f863ce990030cfc5a57a490b4613be4a523ffce1
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=arm64 

All warnings (new ones prefixed by >>):

   fs/compat_ioctl.c: In function 'do_video_set_spu_palette':
   fs/compat_ioctl.c:218:45: error: invalid application of 'sizeof' to incomplete type 'struct video_spu_palette'
     up_native = compat_alloc_user_space(sizeof(struct video_spu_palette));
                                                ^~~~~~
   In file included from include/linux/uaccess.h:14:0,
                    from include/linux/compat.h:19,
                    from fs/compat_ioctl.c:17:
   fs/compat_ioctl.c:219:46: error: dereferencing pointer to incomplete type 'struct video_spu_palette'
     err  = put_user(compat_ptr(palp), &up_native->palette);
                                                 ^
   arch/arm64/include/asm/uaccess.h:380:15: note: in definition of macro '__put_user_check'
     __typeof__(*(ptr)) __user *__p = (ptr);    \
                  ^~~
>> arch/arm64/include/asm/uaccess.h:403:18: note: in expansion of macro '__put_user'
    #define put_user __put_user
                     ^~~~~~~~~~
   fs/compat_ioctl.c:219:9: note: in expansion of macro 'put_user'
     err  = put_user(compat_ptr(palp), &up_native->palette);
            ^~~~~~~~
>> arch/arm64/include/asm/uaccess.h:352:32: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
     __typeof__(*(ptr)) __pu_val = (x);    \
                                   ^
>> arch/arm64/include/asm/uaccess.h:384:3: note: in expansion of macro '__put_user_err'
      __put_user_err((x), __p, (err));   \
      ^~~~~~~~~~~~~~
>> arch/arm64/include/asm/uaccess.h:399:2: note: in expansion of macro '__put_user_check'
     __put_user_check((x), (ptr), __pu_err);    \
     ^~~~~~~~~~~~~~~~
>> arch/arm64/include/asm/uaccess.h:403:18: note: in expansion of macro '__put_user'
    #define put_user __put_user
                     ^~~~~~~~~~
   fs/compat_ioctl.c:219:9: note: in expansion of macro 'put_user'
     err  = put_user(compat_ptr(palp), &up_native->palette);
            ^~~~~~~~
   At top level:
   fs/compat_ioctl.c:206:12: warning: 'do_video_set_spu_palette' defined but not used [-Wunused-function]
    static int do_video_set_spu_palette(struct file *file,
               ^~~~~~~~~~~~~~~~~~~~~~~~

vim +/__put_user +403 arch/arm64/include/asm/uaccess.h

84624087 Will Deacon     2018-02-05  335  
57f4959b James Morse     2016-02-05  336  #define __put_user_asm(instr, alt_instr, reg, x, addr, err, feature)	\
0aea86a2 Catalin Marinas 2012-03-05  337  	asm volatile(							\
57f4959b James Morse     2016-02-05  338  	"1:"ALTERNATIVE(instr "     " reg "1, [%2]\n",			\
57f4959b James Morse     2016-02-05  339  			alt_instr " " reg "1, [%2]\n", feature)		\
0aea86a2 Catalin Marinas 2012-03-05  340  	"2:\n"								\
0aea86a2 Catalin Marinas 2012-03-05  341  	"	.section .fixup,\"ax\"\n"				\
0aea86a2 Catalin Marinas 2012-03-05  342  	"	.align	2\n"						\
0aea86a2 Catalin Marinas 2012-03-05  343  	"3:	mov	%w0, %3\n"					\
0aea86a2 Catalin Marinas 2012-03-05  344  	"	b	2b\n"						\
0aea86a2 Catalin Marinas 2012-03-05  345  	"	.previous\n"						\
6c94f27a Ard Biesheuvel  2016-01-01  346  	_ASM_EXTABLE(1b, 3b)						\
0aea86a2 Catalin Marinas 2012-03-05  347  	: "+r" (err)							\
0aea86a2 Catalin Marinas 2012-03-05  348  	: "r" (x), "r" (addr), "i" (-EFAULT))
0aea86a2 Catalin Marinas 2012-03-05  349  
0aea86a2 Catalin Marinas 2012-03-05  350  #define __put_user_err(x, ptr, err)					\
0aea86a2 Catalin Marinas 2012-03-05  351  do {									\
0aea86a2 Catalin Marinas 2012-03-05 @352  	__typeof__(*(ptr)) __pu_val = (x);				\
0aea86a2 Catalin Marinas 2012-03-05  353  	__chk_user_ptr(ptr);						\
bd38967d Catalin Marinas 2016-07-01  354  	uaccess_enable_not_uao();					\
0aea86a2 Catalin Marinas 2012-03-05  355  	switch (sizeof(*(ptr))) {					\
0aea86a2 Catalin Marinas 2012-03-05  356  	case 1:								\
57f4959b James Morse     2016-02-05  357  		__put_user_asm("strb", "sttrb", "%w", __pu_val, (ptr),	\
57f4959b James Morse     2016-02-05  358  			       (err), ARM64_HAS_UAO);			\
0aea86a2 Catalin Marinas 2012-03-05  359  		break;							\
0aea86a2 Catalin Marinas 2012-03-05  360  	case 2:								\
57f4959b James Morse     2016-02-05  361  		__put_user_asm("strh", "sttrh", "%w", __pu_val, (ptr),	\
57f4959b James Morse     2016-02-05  362  			       (err), ARM64_HAS_UAO);			\
0aea86a2 Catalin Marinas 2012-03-05  363  		break;							\
0aea86a2 Catalin Marinas 2012-03-05  364  	case 4:								\
57f4959b James Morse     2016-02-05  365  		__put_user_asm("str", "sttr", "%w", __pu_val, (ptr),	\
57f4959b James Morse     2016-02-05  366  			       (err), ARM64_HAS_UAO);			\
0aea86a2 Catalin Marinas 2012-03-05  367  		break;							\
0aea86a2 Catalin Marinas 2012-03-05  368  	case 8:								\
d135b8b5 Mark Rutland    2017-05-03  369  		__put_user_asm("str", "sttr", "%x", __pu_val, (ptr),	\
57f4959b James Morse     2016-02-05  370  			       (err), ARM64_HAS_UAO);			\
0aea86a2 Catalin Marinas 2012-03-05  371  		break;							\
0aea86a2 Catalin Marinas 2012-03-05  372  	default:							\
0aea86a2 Catalin Marinas 2012-03-05  373  		BUILD_BUG();						\
0aea86a2 Catalin Marinas 2012-03-05  374  	}								\
bd38967d Catalin Marinas 2016-07-01  375  	uaccess_disable_not_uao();					\
0aea86a2 Catalin Marinas 2012-03-05  376  } while (0)
0aea86a2 Catalin Marinas 2012-03-05  377  
84624087 Will Deacon     2018-02-05  378  #define __put_user_check(x, ptr, err)					\
0aea86a2 Catalin Marinas 2012-03-05  379  ({									\
84624087 Will Deacon     2018-02-05 @380  	__typeof__(*(ptr)) __user *__p = (ptr);				\
84624087 Will Deacon     2018-02-05  381  	might_fault();							\
84624087 Will Deacon     2018-02-05  382  	if (access_ok(VERIFY_WRITE, __p, sizeof(*__p))) {		\
84624087 Will Deacon     2018-02-05  383  		__p = uaccess_mask_ptr(__p);				\
84624087 Will Deacon     2018-02-05 @384  		__put_user_err((x), __p, (err));			\
84624087 Will Deacon     2018-02-05  385  	} else	{							\
84624087 Will Deacon     2018-02-05  386  		(err) = -EFAULT;					\
84624087 Will Deacon     2018-02-05  387  	}								\
0aea86a2 Catalin Marinas 2012-03-05  388  })
0aea86a2 Catalin Marinas 2012-03-05  389  
0aea86a2 Catalin Marinas 2012-03-05  390  #define __put_user_error(x, ptr, err)					\
0aea86a2 Catalin Marinas 2012-03-05  391  ({									\
84624087 Will Deacon     2018-02-05  392  	__put_user_check((x), (ptr), (err));				\
0aea86a2 Catalin Marinas 2012-03-05  393  	(void)0;							\
0aea86a2 Catalin Marinas 2012-03-05  394  })
0aea86a2 Catalin Marinas 2012-03-05  395  
84624087 Will Deacon     2018-02-05  396  #define __put_user(x, ptr)						\
0aea86a2 Catalin Marinas 2012-03-05  397  ({									\
84624087 Will Deacon     2018-02-05  398  	int __pu_err = 0;						\
84624087 Will Deacon     2018-02-05 @399  	__put_user_check((x), (ptr), __pu_err);				\
84624087 Will Deacon     2018-02-05  400  	__pu_err;							\
0aea86a2 Catalin Marinas 2012-03-05  401  })
0aea86a2 Catalin Marinas 2012-03-05  402  
84624087 Will Deacon     2018-02-05 @403  #define put_user	__put_user
84624087 Will Deacon     2018-02-05  404  

:::::: The code at line 403 was first introduced by commit
:::::: 84624087dd7e3b482b7b11c170ebc1f329b3a218 arm64: uaccess: Don't bother eliding access_ok checks in __{get, put}_user

:::::: TO: Will Deacon <will.deacon@xxxxxxx>
:::::: CC: Catalin Marinas <catalin.marinas@xxxxxxx>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux