tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/mm
head: bf1269766228ef169145af26ae50ef9ef095b6fe
commit: 5744534bdae403270f86d934a6c5878da6a5a64f [5/16] x86/uaccess: Provide untagged_addr() and remove tags before address check
config: x86_64-randconfig-s021-20221114
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=5744534bdae403270f86d934a6c5878da6a5a64f
git remote add tip https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
git fetch --no-tags tip x86/mm
git checkout 5744534bdae403270f86d934a6c5878da6a5a64f
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/char/mwave/ drivers/char/pcmcia/ drivers/gpu/drm/ drivers/input/serio/ drivers/media/mc/ drivers/media/v4l2-core/ drivers/rtc/ drivers/tty/ drivers/usb/class/ drivers/usb/core/ drivers/usb/mon/ drivers/video/fbdev/core/ sound/core/ sound/hda/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>
sparse warnings: (new ones prefixed by >>)
>> sound/core/hwdep.c:243:24: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@
sound/core/hwdep.c:243:24: sparse: expected int [noderef] __user *__ptr_clean
sound/core/hwdep.c:243:24: sparse: got int *
sound/core/hwdep.c:273:29: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@
sound/core/hwdep.c:273:29: sparse: expected int [noderef] __user *__ptr_clean
sound/core/hwdep.c:273:29: sparse: got int *
sound/core/hwdep.c:292:29: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@
sound/core/hwdep.c:292:29: sparse: expected int [noderef] __user *__ptr_clean
sound/core/hwdep.c:292:29: sparse: got int *
>> sound/core/hwdep.c:302:29: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
sound/core/hwdep.c:302:29: sparse: expected unsigned int [noderef] __user *__ptr_clean
sound/core/hwdep.c:302:29: sparse: got unsigned int *
sound/core/hwdep.c: note: in included file:
>> sound/core/hwdep_compat.c:26:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
sound/core/hwdep_compat.c:26:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
sound/core/hwdep_compat.c:26:13: sparse: got unsigned int *
sound/core/hwdep_compat.c:27:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
sound/core/hwdep_compat.c:27:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
sound/core/hwdep_compat.c:27:13: sparse: got unsigned int *
sound/core/hwdep_compat.c:28:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
sound/core/hwdep_compat.c:28:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
sound/core/hwdep_compat.c:28:13: sparse: got unsigned int *
--
>> sound/core/rawmidi.c:705:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
sound/core/rawmidi.c:705:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
sound/core/rawmidi.c:705:13: sparse: got unsigned int *
>> sound/core/rawmidi.c:707:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@
sound/core/rawmidi.c:707:13: sparse: expected int [noderef] __user *__ptr_clean
sound/core/rawmidi.c:707:13: sparse: got int *
sound/core/rawmidi.c:709:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
sound/core/rawmidi.c:709:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
sound/core/rawmidi.c:709:13: sparse: got unsigned int *
sound/core/rawmidi.c:912:24: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@
sound/core/rawmidi.c:912:24: sparse: expected int [noderef] __user *__ptr_clean
sound/core/rawmidi.c:912:24: sparse: got int *
sound/core/rawmidi.c:918:21: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@
sound/core/rawmidi.c:918:21: sparse: expected int [noderef] __user *__ptr_clean
sound/core/rawmidi.c:918:21: sparse: got int *
sound/core/rawmidi.c:930:21: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
sound/core/rawmidi.c:930:21: sparse: expected unsigned int [noderef] __user *__ptr_clean
sound/core/rawmidi.c:930:21: sparse: got unsigned int *
sound/core/rawmidi.c:965:21: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@
sound/core/rawmidi.c:965:21: sparse: expected int [noderef] __user *__ptr_clean
sound/core/rawmidi.c:965:21: sparse: got int *
sound/core/rawmidi.c:980:21: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@
sound/core/rawmidi.c:980:21: sparse: expected int [noderef] __user *__ptr_clean
sound/core/rawmidi.c:980:21: sparse: got int *
sound/core/rawmidi.c:1014:21: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@
sound/core/rawmidi.c:1014:21: sparse: expected int [noderef] __user *__ptr_clean
sound/core/rawmidi.c:1014:21: sparse: got int *
sound/core/rawmidi.c:1028:21: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@
sound/core/rawmidi.c:1028:21: sparse: expected int [noderef] __user *__ptr_clean
sound/core/rawmidi.c:1028:21: sparse: got int *
sound/core/rawmidi.c:1036:21: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@
sound/core/rawmidi.c:1036:21: sparse: expected int [noderef] __user *__ptr_clean
sound/core/rawmidi.c:1036:21: sparse: got int *
sound/core/rawmidi.c: note: in included file:
>> sound/core/rawmidi_compat.c:26:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected signed int [noderef] __user *__ptr_clean @@ got signed int * @@
sound/core/rawmidi_compat.c:26:13: sparse: expected signed int [noderef] __user *__ptr_clean
sound/core/rawmidi_compat.c:26:13: sparse: got signed int *
>> sound/core/rawmidi_compat.c:27:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
sound/core/rawmidi_compat.c:27:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
sound/core/rawmidi_compat.c:27:13: sparse: got unsigned int *
sound/core/rawmidi_compat.c:28:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
sound/core/rawmidi_compat.c:28:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
sound/core/rawmidi_compat.c:28:13: sparse: got unsigned int *
sound/core/rawmidi_compat.c:29:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
sound/core/rawmidi_compat.c:29:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
sound/core/rawmidi_compat.c:29:13: sparse: got unsigned int *
sound/core/rawmidi_compat.c:30:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
sound/core/rawmidi_compat.c:30:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
sound/core/rawmidi_compat.c:30:13: sparse: got unsigned int *
sound/core/rawmidi_compat.c:63:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected signed int [noderef] __user *__ptr_clean @@ got signed int * @@
sound/core/rawmidi_compat.c:63:13: sparse: expected signed int [noderef] __user *__ptr_clean
sound/core/rawmidi_compat.c:63:13: sparse: got signed int *
--
>> sound/hda/hdmi_chmap.c:678:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
sound/hda/hdmi_chmap.c:678:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
sound/hda/hdmi_chmap.c:678:13: sparse: got unsigned int *
sound/hda/hdmi_chmap.c:710:29: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
sound/hda/hdmi_chmap.c:710:29: sparse: expected unsigned int [noderef] __user *__ptr_clean
sound/hda/hdmi_chmap.c:710:29: sparse: got unsigned int *
sound/hda/hdmi_chmap.c:711:29: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
sound/hda/hdmi_chmap.c:711:29: sparse: expected unsigned int [noderef] __user *__ptr_clean
sound/hda/hdmi_chmap.c:711:29: sparse: got unsigned int *
sound/hda/hdmi_chmap.c:732:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
sound/hda/hdmi_chmap.c:732:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
sound/hda/hdmi_chmap.c:732:13: sparse: got unsigned int *
--
>> drivers/input/serio/serio_raw.c:178:29: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected char [noderef] __user *__ptr_clean @@ got char * @@
drivers/input/serio/serio_raw.c:178:29: sparse: expected char [noderef] __user *__ptr_clean
drivers/input/serio/serio_raw.c:178:29: sparse: got char *
>> drivers/input/serio/serio_raw.c:219:21: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected char const [noderef] __user *__ptr_clean @@ got char const * @@
drivers/input/serio/serio_raw.c:219:21: sparse: expected char const [noderef] __user *__ptr_clean
drivers/input/serio/serio_raw.c:219:21: sparse: got char const *
--
>> drivers/rtc/rtc-pcf8563.c:288:24: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/rtc/rtc-pcf8563.c:288:24: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/rtc/rtc-pcf8563.c:288:24: sparse: got unsigned int *
--
>> drivers/rtc/rtc-rv8803.c:484:24: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/rtc/rtc-rv8803.c:484:24: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/rtc/rtc-rv8803.c:484:24: sparse: got unsigned int *
--
>> drivers/rtc/rtc-rv3028.c:596:24: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/rtc/rtc-rv3028.c:596:24: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/rtc/rtc-rv3028.c:596:24: sparse: got unsigned int *
--
>> drivers/tty/n_hdlc.c:606:25: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@
drivers/tty/n_hdlc.c:606:25: sparse: expected int [noderef] __user *__ptr_clean
drivers/tty/n_hdlc.c:606:25: sparse: got int *
drivers/tty/n_hdlc.c:619:25: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@
drivers/tty/n_hdlc.c:619:25: sparse: expected int [noderef] __user *__ptr_clean
drivers/tty/n_hdlc.c:619:25: sparse: got int *
--
drivers/gpu/drm/drm_ioc32.c:228:24: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/gpu/drm/drm_ioc32.c:228:24: sparse: void *
drivers/gpu/drm/drm_ioc32.c:228:24: sparse: void [noderef] __user *
>> drivers/gpu/drm/drm_ioc32.c:245:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/gpu/drm/drm_ioc32.c:245:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/gpu/drm/drm_ioc32.c:245:13: sparse: got unsigned int *
drivers/gpu/drm/drm_ioc32.c:247:20: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *handle @@ got void [noderef] __user * @@
drivers/gpu/drm/drm_ioc32.c:247:20: sparse: expected void *handle
drivers/gpu/drm/drm_ioc32.c:247:20: sparse: got void [noderef] __user *
>> drivers/gpu/drm/drm_ioc32.c:414:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@
drivers/gpu/drm/drm_ioc32.c:414:13: sparse: expected int [noderef] __user *__ptr_clean
drivers/gpu/drm/drm_ioc32.c:414:13: sparse: got int *
drivers/gpu/drm/drm_ioc32.c:477:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@
drivers/gpu/drm/drm_ioc32.c:477:13: sparse: expected int [noderef] __user *__ptr_clean
drivers/gpu/drm/drm_ioc32.c:477:13: sparse: got int *
drivers/gpu/drm/drm_ioc32.c:478:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/gpu/drm/drm_ioc32.c:478:16: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/gpu/drm/drm_ioc32.c:478:16: sparse: got unsigned int *
drivers/gpu/drm/drm_ioc32.c:520:24: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *[assigned] handle @@ got void [noderef] __user * @@
drivers/gpu/drm/drm_ioc32.c:520:24: sparse: expected void *[assigned] handle
drivers/gpu/drm/drm_ioc32.c:520:24: sparse: got void [noderef] __user *
drivers/gpu/drm/drm_ioc32.c:613:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@
drivers/gpu/drm/drm_ioc32.c:613:13: sparse: expected int [noderef] __user *__ptr_clean
drivers/gpu/drm/drm_ioc32.c:613:13: sparse: got int *
drivers/gpu/drm/drm_ioc32.c:614:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@
drivers/gpu/drm/drm_ioc32.c:614:16: sparse: expected int [noderef] __user *__ptr_clean
drivers/gpu/drm/drm_ioc32.c:614:16: sparse: got int *
drivers/gpu/drm/drm_ioc32.c:777:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/gpu/drm/drm_ioc32.c:777:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/gpu/drm/drm_ioc32.c:777:13: sparse: got unsigned int *
drivers/gpu/drm/drm_ioc32.c:786:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/gpu/drm/drm_ioc32.c:786:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/gpu/drm/drm_ioc32.c:786:13: sparse: got unsigned int *
drivers/gpu/drm/drm_ioc32.c:799:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/gpu/drm/drm_ioc32.c:799:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/gpu/drm/drm_ioc32.c:799:13: sparse: got unsigned int *
drivers/gpu/drm/drm_ioc32.c:903:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/gpu/drm/drm_ioc32.c:903:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/gpu/drm/drm_ioc32.c:903:13: sparse: got unsigned int *
--
>> drivers/char/mwave/3780i.c:499:20: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned short [noderef] __user *__ptr_clean @@ got unsigned short * @@
drivers/char/mwave/3780i.c:499:20: sparse: expected unsigned short [noderef] __user *__ptr_clean
drivers/char/mwave/3780i.c:499:20: sparse: got unsigned short *
drivers/char/mwave/3780i.c:541:20: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned short [noderef] __user *__ptr_clean @@ got unsigned short * @@
drivers/char/mwave/3780i.c:541:20: sparse: expected unsigned short [noderef] __user *__ptr_clean
drivers/char/mwave/3780i.c:541:20: sparse: got unsigned short *
drivers/char/mwave/3780i.c:580:20: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned short [noderef] __user *__ptr_clean @@ got unsigned short * @@
drivers/char/mwave/3780i.c:580:20: sparse: expected unsigned short [noderef] __user *__ptr_clean
drivers/char/mwave/3780i.c:580:20: sparse: got unsigned short *
drivers/char/mwave/3780i.c:629:20: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned short [noderef] __user *__ptr_clean @@ got unsigned short * @@
drivers/char/mwave/3780i.c:629:20: sparse: expected unsigned short [noderef] __user *__ptr_clean
drivers/char/mwave/3780i.c:629:20: sparse: got unsigned short *
drivers/char/mwave/3780i.c:631:20: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned short [noderef] __user *__ptr_clean @@ got unsigned short * @@
drivers/char/mwave/3780i.c:631:20: sparse: expected unsigned short [noderef] __user *__ptr_clean
drivers/char/mwave/3780i.c:631:20: sparse: got unsigned short *
drivers/char/mwave/3780i.c:674:20: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned short [noderef] __user *__ptr_clean @@ got unsigned short * @@
drivers/char/mwave/3780i.c:674:20: sparse: expected unsigned short [noderef] __user *__ptr_clean
drivers/char/mwave/3780i.c:674:20: sparse: got unsigned short *
drivers/char/mwave/3780i.c:676:20: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned short [noderef] __user *__ptr_clean @@ got unsigned short * @@
drivers/char/mwave/3780i.c:676:20: sparse: expected unsigned short [noderef] __user *__ptr_clean
drivers/char/mwave/3780i.c:676:20: sparse: got unsigned short *
--
>> drivers/char/pcmcia/synclink_cs.c:2052:17: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@
drivers/char/pcmcia/synclink_cs.c:2052:17: sparse: expected int [noderef] __user *__ptr_clean
drivers/char/pcmcia/synclink_cs.c:2052:17: sparse: got int *
--
>> drivers/media/mc/mc-device.c:502:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/media/mc/mc-device.c:502:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/media/mc/mc-device.c:502:13: sparse: got unsigned int *
drivers/media/mc/mc-device.c:503:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/media/mc/mc-device.c:503:16: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/media/mc/mc-device.c:503:16: sparse: got unsigned int *
drivers/media/mc/mc-device.c:504:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/media/mc/mc-device.c:504:16: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/media/mc/mc-device.c:504:16: sparse: got unsigned int *
--
>> drivers/usb/class/usbtmc.c:568:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned char [noderef] __user *__ptr_clean @@ got unsigned char * @@
drivers/usb/class/usbtmc.c:568:22: sparse: expected unsigned char [noderef] __user *__ptr_clean
drivers/usb/class/usbtmc.c:568:22: sparse: got unsigned char *
drivers/usb/class/usbtmc.c:589:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned char [noderef] __user *__ptr_clean @@ got unsigned char * @@
drivers/usb/class/usbtmc.c:589:22: sparse: expected unsigned char [noderef] __user *__ptr_clean
drivers/usb/class/usbtmc.c:589:22: sparse: got unsigned char *
>> drivers/usb/class/usbtmc.c:614:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/class/usbtmc.c:614:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/class/usbtmc.c:614:13: sparse: got unsigned int *
drivers/usb/class/usbtmc.c:1063:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/class/usbtmc.c:1063:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/class/usbtmc.c:1063:13: sparse: got unsigned int *
drivers/usb/class/usbtmc.c:1274:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/class/usbtmc.c:1274:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/class/usbtmc.c:1274:13: sparse: got unsigned int *
drivers/usb/class/usbtmc.c:1295:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/class/usbtmc.c:1295:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/class/usbtmc.c:1295:13: sparse: got unsigned int *
drivers/usb/class/usbtmc.c:1989:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/class/usbtmc.c:1989:16: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/class/usbtmc.c:1989:16: sparse: got unsigned int *
drivers/usb/class/usbtmc.c:2000:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/class/usbtmc.c:2000:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/class/usbtmc.c:2000:13: sparse: got unsigned int *
drivers/usb/class/usbtmc.c:2136:26: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/class/usbtmc.c:2136:26: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/class/usbtmc.c:2136:26: sparse: got unsigned int *
drivers/usb/class/usbtmc.c:2141:26: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned char [noderef] __user *__ptr_clean @@ got unsigned char * @@
drivers/usb/class/usbtmc.c:2141:26: sparse: expected unsigned char [noderef] __user *__ptr_clean
drivers/usb/class/usbtmc.c:2141:26: sparse: got unsigned char *
drivers/usb/class/usbtmc.c:2175:26: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned char [noderef] __user *__ptr_clean @@ got unsigned char * @@
drivers/usb/class/usbtmc.c:2175:26: sparse: expected unsigned char [noderef] __user *__ptr_clean
drivers/usb/class/usbtmc.c:2175:26: sparse: got unsigned char *
drivers/usb/class/usbtmc.c:2180:26: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned char [noderef] __user *__ptr_clean @@ got unsigned char * @@
drivers/usb/class/usbtmc.c:2180:26: sparse: expected unsigned char [noderef] __user *__ptr_clean
drivers/usb/class/usbtmc.c:2180:26: sparse: got unsigned char *
drivers/usb/class/usbtmc.c:2188:34: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned char [noderef] __user *__ptr_clean @@ got unsigned char * @@
drivers/usb/class/usbtmc.c:2188:34: sparse: expected unsigned char [noderef] __user *__ptr_clean
drivers/usb/class/usbtmc.c:2188:34: sparse: got unsigned char *
--
>> drivers/media/v4l2-core/v4l2-compat-ioctl32.c:147:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:147:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:147:13: sparse: got unsigned int *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:235:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:235:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:235:13: sparse: got unsigned int *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:236:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:236:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:236:13: sparse: got unsigned int *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:255:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:255:16: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:255:16: sparse: got unsigned int *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:261:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:261:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:261:13: sparse: got unsigned int *
>> drivers/media/v4l2-core/v4l2-compat-ioctl32.c:262:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned long long [noderef] __user *__ptr_clean @@ got unsigned long long * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:262:13: sparse: expected unsigned long long [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:262:13: sparse: got unsigned long long *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:266:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:266:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:266:13: sparse: got unsigned int *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:605:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:605:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:605:13: sparse: got unsigned int *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:606:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:606:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:606:13: sparse: got unsigned int *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:607:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:607:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:607:13: sparse: got unsigned int *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:618:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:618:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:618:13: sparse: got unsigned int *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:619:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:619:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:619:13: sparse: got unsigned int *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:620:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:620:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:620:13: sparse: got unsigned int *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:774:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:774:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:774:13: sparse: got unsigned int *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:776:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:776:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:776:13: sparse: got unsigned int *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:777:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:777:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:777:13: sparse: got unsigned int *
>> drivers/media/v4l2-core/v4l2-compat-ioctl32.c:778:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected signed long long [noderef] __user *__ptr_clean @@ got signed long long * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:778:13: sparse: expected signed long long [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:778:13: sparse: got signed long long *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:779:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected signed long long [noderef] __user *__ptr_clean @@ got signed long long * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:779:13: sparse: expected signed long long [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:779:13: sparse: got signed long long *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:780:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:780:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:780:13: sparse: got unsigned int *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:805:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:805:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:805:13: sparse: got unsigned int *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:807:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:807:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:807:13: sparse: got unsigned int *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:808:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:808:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:808:13: sparse: got unsigned int *
>> drivers/media/v4l2-core/v4l2-compat-ioctl32.c:809:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected signed int [noderef] __user *__ptr_clean @@ got signed int * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:809:13: sparse: expected signed int [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:809:13: sparse: got signed int *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:810:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected signed int [noderef] __user *__ptr_clean @@ got signed int * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:810:13: sparse: expected signed int [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:810:13: sparse: got signed int *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:811:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:811:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:811:13: sparse: got unsigned int *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:832:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:832:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:832:13: sparse: got unsigned int *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:1114:37: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:1114:37: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:1114:37: sparse: got unsigned int *
--
>> drivers/usb/core/devio.c:950:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/core/devio.c:950:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:950:13: sparse: got unsigned int *
drivers/usb/core/devio.c:951:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/core/devio.c:951:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:951:13: sparse: got unsigned int *
>> drivers/usb/core/devio.c:966:21: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned char [noderef] __user *__ptr_clean @@ got unsigned char * @@
drivers/usb/core/devio.c:966:21: sparse: expected unsigned char [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:966:21: sparse: got unsigned char *
drivers/usb/core/devio.c:1389:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/core/devio.c:1389:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:1389:13: sparse: got unsigned int *
drivers/usb/core/devio.c:1408:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/core/devio.c:1408:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:1408:13: sparse: got unsigned int *
>> drivers/usb/core/devio.c:1540:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@
drivers/usb/core/devio.c:1540:13: sparse: expected int [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:1540:13: sparse: got int *
drivers/usb/core/devio.c:2043:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@
drivers/usb/core/devio.c:2043:13: sparse: expected int [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:2043:13: sparse: got int *
drivers/usb/core/devio.c:2045:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@
drivers/usb/core/devio.c:2045:13: sparse: expected int [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:2045:13: sparse: got int *
drivers/usb/core/devio.c:2047:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@
drivers/usb/core/devio.c:2047:13: sparse: expected int [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:2047:13: sparse: got int *
drivers/usb/core/devio.c:2052:29: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/core/devio.c:2052:29: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:2052:29: sparse: got unsigned int *
drivers/usb/core/devio.c:2055:29: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/core/devio.c:2055:29: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:2055:29: sparse: got unsigned int *
>> drivers/usb/core/devio.c:2061:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void [noderef] __user *[noderef] __user *__ptr_clean @@ got void [noderef] __user ** @@
drivers/usb/core/devio.c:2061:13: sparse: expected void [noderef] __user *[noderef] __user *__ptr_clean
drivers/usb/core/devio.c:2061:13: sparse: got void [noderef] __user **
drivers/usb/core/devio.c:2133:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/core/devio.c:2133:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:2133:13: sparse: got unsigned int *
drivers/usb/core/devio.c:2145:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/core/devio.c:2145:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:2145:13: sparse: got unsigned int *
drivers/usb/core/devio.c:2146:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/core/devio.c:2146:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:2146:13: sparse: got unsigned int *
drivers/usb/core/devio.c:2147:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/core/devio.c:2147:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:2147:13: sparse: got unsigned int *
drivers/usb/core/devio.c:2148:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/core/devio.c:2148:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:2148:13: sparse: got unsigned int *
>> drivers/usb/core/devio.c:2214:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected signed int [noderef] __user *__ptr_clean @@ got signed int * @@
drivers/usb/core/devio.c:2214:13: sparse: expected signed int [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:2214:13: sparse: got signed int *
drivers/usb/core/devio.c:2216:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected signed int [noderef] __user *__ptr_clean @@ got signed int * @@
drivers/usb/core/devio.c:2216:13: sparse: expected signed int [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:2216:13: sparse: got signed int *
drivers/usb/core/devio.c:2218:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected signed int [noderef] __user *__ptr_clean @@ got signed int * @@
drivers/usb/core/devio.c:2218:13: sparse: expected signed int [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:2218:13: sparse: got signed int *
drivers/usb/core/devio.c:2223:29: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/core/devio.c:2223:29: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:2223:29: sparse: got unsigned int *
drivers/usb/core/devio.c:2226:29: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/core/devio.c:2226:29: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:2226:29: sparse: got unsigned int *
drivers/usb/core/devio.c:2232:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/core/devio.c:2232:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:2232:13: sparse: got unsigned int *
drivers/usb/core/devio.c:2288:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/core/devio.c:2288:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:2288:13: sparse: got unsigned int *
drivers/usb/core/devio.c:2298:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/core/devio.c:2298:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:2298:13: sparse: got unsigned int *
drivers/usb/core/devio.c:2414:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/core/devio.c:2414:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:2414:13: sparse: got unsigned int *
drivers/usb/core/devio.c:2427:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/core/devio.c:2427:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:2427:13: sparse: got unsigned int *
drivers/usb/core/devio.c:2445:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/core/devio.c:2445:13: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/core/devio.c:2445:13: sparse: got unsigned int *
--
>> drivers/video/fbdev/core/fbmem.c:1270:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/video/fbdev/core/fbmem.c:1270:16: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/video/fbdev/core/fbmem.c:1270:16: sparse: got unsigned int *
drivers/video/fbdev/core/fbmem.c:1272:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/video/fbdev/core/fbmem.c:1272:16: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/video/fbdev/core/fbmem.c:1272:16: sparse: got unsigned int *
drivers/video/fbdev/core/fbmem.c:1273:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/video/fbdev/core/fbmem.c:1273:16: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/video/fbdev/core/fbmem.c:1273:16: sparse: got unsigned int *
drivers/video/fbdev/core/fbmem.c:1274:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/video/fbdev/core/fbmem.c:1274:16: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/video/fbdev/core/fbmem.c:1274:16: sparse: got unsigned int *
drivers/video/fbdev/core/fbmem.c:1275:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/video/fbdev/core/fbmem.c:1275:16: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/video/fbdev/core/fbmem.c:1275:16: sparse: got unsigned int *
>> drivers/video/fbdev/core/fbmem.c:1276:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned short [noderef] __user *__ptr_clean @@ got unsigned short * @@
drivers/video/fbdev/core/fbmem.c:1276:16: sparse: expected unsigned short [noderef] __user *__ptr_clean
drivers/video/fbdev/core/fbmem.c:1276:16: sparse: got unsigned short *
drivers/video/fbdev/core/fbmem.c:1277:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned short [noderef] __user *__ptr_clean @@ got unsigned short * @@
drivers/video/fbdev/core/fbmem.c:1277:16: sparse: expected unsigned short [noderef] __user *__ptr_clean
drivers/video/fbdev/core/fbmem.c:1277:16: sparse: got unsigned short *
drivers/video/fbdev/core/fbmem.c:1278:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned short [noderef] __user *__ptr_clean @@ got unsigned short * @@
drivers/video/fbdev/core/fbmem.c:1278:16: sparse: expected unsigned short [noderef] __user *__ptr_clean
drivers/video/fbdev/core/fbmem.c:1278:16: sparse: got unsigned short *
drivers/video/fbdev/core/fbmem.c:1279:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/video/fbdev/core/fbmem.c:1279:16: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/video/fbdev/core/fbmem.c:1279:16: sparse: got unsigned int *
drivers/video/fbdev/core/fbmem.c:1282:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/video/fbdev/core/fbmem.c:1282:16: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/video/fbdev/core/fbmem.c:1282:16: sparse: got unsigned int *
drivers/video/fbdev/core/fbmem.c:1284:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/video/fbdev/core/fbmem.c:1284:16: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/video/fbdev/core/fbmem.c:1284:16: sparse: got unsigned int *
drivers/video/fbdev/core/fbmem.c:1285:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/video/fbdev/core/fbmem.c:1285:16: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/video/fbdev/core/fbmem.c:1285:16: sparse: got unsigned int *
--
>> drivers/usb/mon/mon_bin.c:928:21: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/mon/mon_bin.c:928:21: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/mon/mon_bin.c:928:21: sparse: got unsigned int *
drivers/usb/mon/mon_bin.c:1094:29: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/mon/mon_bin.c:1094:29: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/mon/mon_bin.c:1094:29: sparse: got unsigned int *
drivers/usb/mon/mon_bin.c:1100:21: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/mon/mon_bin.c:1100:21: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/mon/mon_bin.c:1100:21: sparse: got unsigned int *
drivers/usb/mon/mon_bin.c:1118:21: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/mon/mon_bin.c:1118:21: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/mon/mon_bin.c:1118:21: sparse: got unsigned int *
drivers/usb/mon/mon_bin.c:1120:21: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/mon/mon_bin.c:1120:21: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/mon/mon_bin.c:1120:21: sparse: got unsigned int *
drivers/usb/mon/mon_bin.c:1173:29: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/mon/mon_bin.c:1173:29: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/mon/mon_bin.c:1173:29: sparse: got unsigned int *
drivers/usb/mon/mon_bin.c:1180:21: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] __user *__ptr_clean @@ got unsigned int * @@
drivers/usb/mon/mon_bin.c:1180:21: sparse: expected unsigned int [noderef] __user *__ptr_clean
drivers/usb/mon/mon_bin.c:1180:21: sparse: got unsigned int *
vim +243 sound/core/hwdep.c
18d122c0287b29 Arnd Bergmann 2020-09-18 234
18d122c0287b29 Arnd Bergmann 2020-09-18 235
d9a98de218ce18 Takashi Iwai 2005-11-17 236 static long snd_hwdep_ioctl(struct file * file, unsigned int cmd,
d9a98de218ce18 Takashi Iwai 2005-11-17 237 unsigned long arg)
^1da177e4c3f41 Linus Torvalds 2005-04-16 238 {
d9a98de218ce18 Takashi Iwai 2005-11-17 239 struct snd_hwdep *hw = file->private_data;
^1da177e4c3f41 Linus Torvalds 2005-04-16 240 void __user *argp = (void __user *)arg;
^1da177e4c3f41 Linus Torvalds 2005-04-16 241 switch (cmd) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 242 case SNDRV_HWDEP_IOCTL_PVERSION:
^1da177e4c3f41 Linus Torvalds 2005-04-16 @243 return put_user(SNDRV_HWDEP_VERSION, (int __user *)argp);
^1da177e4c3f41 Linus Torvalds 2005-04-16 244 case SNDRV_HWDEP_IOCTL_INFO:
^1da177e4c3f41 Linus Torvalds 2005-04-16 245 return snd_hwdep_info(hw, argp);
^1da177e4c3f41 Linus Torvalds 2005-04-16 246 case SNDRV_HWDEP_IOCTL_DSP_STATUS:
^1da177e4c3f41 Linus Torvalds 2005-04-16 247 return snd_hwdep_dsp_status(hw, argp);
^1da177e4c3f41 Linus Torvalds 2005-04-16 248 case SNDRV_HWDEP_IOCTL_DSP_LOAD:
18d122c0287b29 Arnd Bergmann 2020-09-18 249 return snd_hwdep_dsp_load_user(hw, argp);
^1da177e4c3f41 Linus Torvalds 2005-04-16 250 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 251 if (hw->ops.ioctl)
^1da177e4c3f41 Linus Torvalds 2005-04-16 252 return hw->ops.ioctl(hw, file, cmd, arg);
^1da177e4c3f41 Linus Torvalds 2005-04-16 253 return -ENOTTY;
^1da177e4c3f41 Linus Torvalds 2005-04-16 254 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 255
^1da177e4c3f41 Linus Torvalds 2005-04-16 256 static int snd_hwdep_mmap(struct file * file, struct vm_area_struct * vma)
^1da177e4c3f41 Linus Torvalds 2005-04-16 257 {
d9a98de218ce18 Takashi Iwai 2005-11-17 258 struct snd_hwdep *hw = file->private_data;
^1da177e4c3f41 Linus Torvalds 2005-04-16 259 if (hw->ops.mmap)
^1da177e4c3f41 Linus Torvalds 2005-04-16 260 return hw->ops.mmap(hw, file, vma);
^1da177e4c3f41 Linus Torvalds 2005-04-16 261 return -ENXIO;
^1da177e4c3f41 Linus Torvalds 2005-04-16 262 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 263
d9a98de218ce18 Takashi Iwai 2005-11-17 264 static int snd_hwdep_control_ioctl(struct snd_card *card,
d9a98de218ce18 Takashi Iwai 2005-11-17 265 struct snd_ctl_file * control,
^1da177e4c3f41 Linus Torvalds 2005-04-16 266 unsigned int cmd, unsigned long arg)
^1da177e4c3f41 Linus Torvalds 2005-04-16 267 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 268 switch (cmd) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 269 case SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE:
^1da177e4c3f41 Linus Torvalds 2005-04-16 270 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 271 int device;
^1da177e4c3f41 Linus Torvalds 2005-04-16 272
^1da177e4c3f41 Linus Torvalds 2005-04-16 273 if (get_user(device, (int __user *)arg))
^1da177e4c3f41 Linus Torvalds 2005-04-16 274 return -EFAULT;
1a60d4c5a0c402 Ingo Molnar 2006-01-16 275 mutex_lock(®ister_mutex);
f7b2bb8549e352 Dan Carpenter 2011-10-28 276
f7b2bb8549e352 Dan Carpenter 2011-10-28 277 if (device < 0)
f7b2bb8549e352 Dan Carpenter 2011-10-28 278 device = 0;
f7b2bb8549e352 Dan Carpenter 2011-10-28 279 else if (device < SNDRV_MINOR_HWDEPS)
f7b2bb8549e352 Dan Carpenter 2011-10-28 280 device++;
f7b2bb8549e352 Dan Carpenter 2011-10-28 281 else
f7b2bb8549e352 Dan Carpenter 2011-10-28 282 device = SNDRV_MINOR_HWDEPS;
f7b2bb8549e352 Dan Carpenter 2011-10-28 283
^1da177e4c3f41 Linus Torvalds 2005-04-16 284 while (device < SNDRV_MINOR_HWDEPS) {
f87135f56cb266 Clemens Ladisch 2005-11-20 285 if (snd_hwdep_search(card, device))
^1da177e4c3f41 Linus Torvalds 2005-04-16 286 break;
^1da177e4c3f41 Linus Torvalds 2005-04-16 287 device++;
^1da177e4c3f41 Linus Torvalds 2005-04-16 288 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 289 if (device >= SNDRV_MINOR_HWDEPS)
^1da177e4c3f41 Linus Torvalds 2005-04-16 290 device = -1;
1a60d4c5a0c402 Ingo Molnar 2006-01-16 291 mutex_unlock(®ister_mutex);
^1da177e4c3f41 Linus Torvalds 2005-04-16 292 if (put_user(device, (int __user *)arg))
^1da177e4c3f41 Linus Torvalds 2005-04-16 293 return -EFAULT;
^1da177e4c3f41 Linus Torvalds 2005-04-16 294 return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 295 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 296 case SNDRV_CTL_IOCTL_HWDEP_INFO:
^1da177e4c3f41 Linus Torvalds 2005-04-16 297 {
d9a98de218ce18 Takashi Iwai 2005-11-17 298 struct snd_hwdep_info __user *info = (struct snd_hwdep_info __user *)arg;
f87135f56cb266 Clemens Ladisch 2005-11-20 299 int device, err;
d9a98de218ce18 Takashi Iwai 2005-11-17 300 struct snd_hwdep *hwdep;
^1da177e4c3f41 Linus Torvalds 2005-04-16 301
^1da177e4c3f41 Linus Torvalds 2005-04-16 @302 if (get_user(device, &info->device))
^1da177e4c3f41 Linus Torvalds 2005-04-16 303 return -EFAULT;
1a60d4c5a0c402 Ingo Molnar 2006-01-16 304 mutex_lock(®ister_mutex);
f87135f56cb266 Clemens Ladisch 2005-11-20 305 hwdep = snd_hwdep_search(card, device);
f87135f56cb266 Clemens Ladisch 2005-11-20 306 if (hwdep)
f87135f56cb266 Clemens Ladisch 2005-11-20 307 err = snd_hwdep_info(hwdep, info);
f87135f56cb266 Clemens Ladisch 2005-11-20 308 else
f87135f56cb266 Clemens Ladisch 2005-11-20 309 err = -ENXIO;
1a60d4c5a0c402 Ingo Molnar 2006-01-16 310 mutex_unlock(®ister_mutex);
f87135f56cb266 Clemens Ladisch 2005-11-20 311 return err;
^1da177e4c3f41 Linus Torvalds 2005-04-16 312 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 313 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 314 return -ENOIOCTLCMD;
^1da177e4c3f41 Linus Torvalds 2005-04-16 315 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 316
:::::: The code at line 243 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
:::::: TO: Linus Torvalds <[email protected]>
:::::: CC: Linus Torvalds <[email protected]>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
On 11/14/22 13:41, kernel test robot wrote:
> sound/core/hwdep.c:243:24: sparse: expected int [noderef] __user *__ptr_clean
> sound/core/hwdep.c:243:24: sparse: got int *
> sound/core/hwdep.c:273:29: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@
> sound/core/hwdep.c:273:29: sparse: expected int [noderef] __user *__ptr_clean
> sound/core/hwdep.c:273:29: sparse: got int *
> sound/core/hwdep.c:292:29: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@
> sound/core/hwdep.c:292:29: sparse: expected int [noderef] __user *__ptr_clean
> sound/core/hwdep.c:292:29: sparse: got int *
I think the sparse ends up throwing away all of its annotations once it
dereferences a pointer. So, '*(int __user *)' boils down to a plain
'int'. Confusingly, a '*(int __user *) *' boils down to an 'int *'.
That's what happened here. A __user-annotated point got dereferenced
down to an 'int' and then turned into a pointer again.
I think the trick in this case is to avoid dereferencing the pointer too
early by just moving the dereference outside of the casting, like the
attached patch. But, it also feels kinda wrong. I'd love a second
opinion on this one.
On Mon, Nov 14, 2022 at 02:55:46PM -0800, Dave Hansen wrote:
> On 11/14/22 13:41, kernel test robot wrote:
> > sound/core/hwdep.c:243:24: sparse: expected int [noderef] __user *__ptr_clean
> > sound/core/hwdep.c:243:24: sparse: got int *
> > sound/core/hwdep.c:273:29: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@
> > sound/core/hwdep.c:273:29: sparse: expected int [noderef] __user *__ptr_clean
> > sound/core/hwdep.c:273:29: sparse: got int *
> > sound/core/hwdep.c:292:29: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@
> > sound/core/hwdep.c:292:29: sparse: expected int [noderef] __user *__ptr_clean
> > sound/core/hwdep.c:292:29: sparse: got int *
>
> I think the sparse ends up throwing away all of its annotations once it
> dereferences a pointer. So, '*(int __user *)' boils down to a plain
> 'int'. Confusingly, a '*(int __user *) *' boils down to an 'int *'.
>
> That's what happened here. A __user-annotated point got dereferenced
> down to an 'int' and then turned into a pointer again.
>
> I think the trick in this case is to avoid dereferencing the pointer too
> early by just moving the dereference outside of the casting, like the
> attached patch. But, it also feels kinda wrong. I'd love a second
> opinion on this one.
> diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
> index 0db6f5451854..b8947b623c72 100644
> --- a/arch/x86/include/asm/uaccess.h
> +++ b/arch/x86/include/asm/uaccess.h
> @@ -39,7 +39,7 @@ static inline bool pagefault_disabled(void);
> #define untagged_ptr(mm, ptr) ({ \
> u64 __ptrval = (__force u64)(ptr); \
> __ptrval = untagged_addr(mm, __ptrval); \
> - (__force __typeof__(*(ptr)) *)__ptrval; \
> + *(__force __typeof__((ptr)) *)__ptrval; \
It casts __ptrval to pointer to pointer and then dereferences it, so it
gives a new value on the output. It breaks boot for me.
We can drop all '*' here and get:
(__force __typeof__(ptr))__ptrval; \
It helps with sparse and streamlines the code. But it uncovers error in
sg_scsi_ioctl():
error: cast specifies array type
The line that triggers the error is:
if (get_user(opcode, sic->data))
'sic->data' is an array. And it breaks get_user() contract:
* @ptr must have pointer-to-simple-variable type, and the result of
* dereferencing @ptr must be assignable to @x without a cast.
Array is not pointer-to-simple-variable type. Let's cast it explicitly to
(char __user *). It should match the current behaviour. But double check
would be nice.
With sg_scsi_ioctl() fixed, it builds and boots fine for me.
I also looked again at get_user() and put_user() and I think we can
simplify them. The variable just adds noise.
The change below helps with the sparse complains. I didn't checked all of
them, but what check looks good.
If it looks okay, I will prepare 3 patches: scsi fix, sparse fix,
get/put_user() cleanup.
diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
index 1d2c79246681..bd92e1ee1c1a 100644
--- a/arch/x86/include/asm/uaccess.h
+++ b/arch/x86/include/asm/uaccess.h
@@ -43,7 +43,7 @@ DECLARE_STATIC_KEY_FALSE(tagged_addr_key);
#define untagged_ptr(mm, ptr) ({ \
u64 __ptrval = (__force u64)(ptr); \
__ptrval = untagged_addr(mm, __ptrval); \
- (__force __typeof__(*(ptr)) *)__ptrval; \
+ (__force __typeof__(ptr))__ptrval; \
})
#else
#define untagged_addr(mm, addr) (addr)
@@ -158,10 +158,8 @@ extern int __get_user_bad(void);
*/
#define get_user(x,ptr) \
({ \
- __typeof__(*(ptr)) __user *__ptr_clean; \
- __ptr_clean = untagged_ptr(current->mm, ptr); \
might_fault(); \
- do_get_user_call(get_user,x,__ptr_clean); \
+ do_get_user_call(get_user,x,untagged_ptr(current->mm, ptr)); \
})
/**
@@ -263,10 +261,8 @@ extern void __put_user_nocheck_8(void);
* Return: zero on success, or -EFAULT on error.
*/
#define put_user(x, ptr) ({ \
- __typeof__(*(ptr)) __user *__ptr_clean; \
- __ptr_clean = untagged_ptr(current->mm, ptr); \
might_fault(); \
- do_put_user_call(put_user,x,__ptr_clean); \
+ do_put_user_call(put_user,x,untagged_ptr(current->mm, ptr)); \
})
/**
diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c
index 2d20da55fb64..c285502f5993 100644
--- a/drivers/scsi/scsi_ioctl.c
+++ b/drivers/scsi/scsi_ioctl.c
@@ -519,7 +519,7 @@ static int sg_scsi_ioctl(struct request_queue *q, fmode_t mode,
return -EFAULT;
if (in_len > PAGE_SIZE || out_len > PAGE_SIZE)
return -EINVAL;
- if (get_user(opcode, sic->data))
+ if (get_user(opcode, (char __user *)sic->data))
return -EFAULT;
bytes = max(in_len, out_len);
--
Kiryl Shutsemau / Kirill A. Shutemov
On Tue, Nov 15, 2022 at 06:40:07AM +0300, Kirill A. Shutemov wrote:
> I also looked again at get_user() and put_user() and I think we can
> simplify them. The variable just adds noise.
I just realized that this is not only cleanup, but also fixes sparse
warnings.
--
Kiryl Shutsemau / Kirill A. Shutemov
LKP reported new warnings due to LAM patchset.
Fix them.
Kirill A. Shutemov (2):
scsi: Fix get_user() in call sg_scsi_ioctl()
x86/mm: Fix sparse warnings in untagged_ptr()
arch/x86/include/asm/uaccess.h | 10 +++-------
drivers/scsi/scsi_ioctl.c | 2 +-
2 files changed, 4 insertions(+), 8 deletions(-)
--
2.38.0
Linear Address Masking patchset triggered a lot of sparse warnings.
The root cause is that casting pointer to '__typeof__(*(ptr)) *' will
strip all sparse tags. The type has to be defined based on the pointer
type, not based on what the pointer points to.
Fix cast in untagged_ptr() and avoid __typeof__() usage in
get/put_user().
Signed-off-by: Kirill A. Shutemov <[email protected]>
Reported-by: kernel test robot <[email protected]>
---
arch/x86/include/asm/uaccess.h | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
index 1d2c79246681..bd92e1ee1c1a 100644
--- a/arch/x86/include/asm/uaccess.h
+++ b/arch/x86/include/asm/uaccess.h
@@ -43,7 +43,7 @@ DECLARE_STATIC_KEY_FALSE(tagged_addr_key);
#define untagged_ptr(mm, ptr) ({ \
u64 __ptrval = (__force u64)(ptr); \
__ptrval = untagged_addr(mm, __ptrval); \
- (__force __typeof__(*(ptr)) *)__ptrval; \
+ (__force __typeof__(ptr))__ptrval; \
})
#else
#define untagged_addr(mm, addr) (addr)
@@ -158,10 +158,8 @@ extern int __get_user_bad(void);
*/
#define get_user(x,ptr) \
({ \
- __typeof__(*(ptr)) __user *__ptr_clean; \
- __ptr_clean = untagged_ptr(current->mm, ptr); \
might_fault(); \
- do_get_user_call(get_user,x,__ptr_clean); \
+ do_get_user_call(get_user,x,untagged_ptr(current->mm, ptr)); \
})
/**
@@ -263,10 +261,8 @@ extern void __put_user_nocheck_8(void);
* Return: zero on success, or -EFAULT on error.
*/
#define put_user(x, ptr) ({ \
- __typeof__(*(ptr)) __user *__ptr_clean; \
- __ptr_clean = untagged_ptr(current->mm, ptr); \
might_fault(); \
- do_put_user_call(put_user,x,__ptr_clean); \
+ do_put_user_call(put_user,x,untagged_ptr(current->mm, ptr)); \
})
/**
--
2.38.0
get_user() expects the pointer to be pointer-to-simple-variable type,
but sic->data is array of 'unsigned char'. It violates get_user()
contracts.
Cast it explicitly to 'unsigned char __user *'. It matches current
behaviour.
This is preparation for fixing sparse warnings caused by Linear Address
Masking patchset.
Signed-off-by: Kirill A. Shutemov <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
---
drivers/scsi/scsi_ioctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c
index 2d20da55fb64..72b3ab5137b8 100644
--- a/drivers/scsi/scsi_ioctl.c
+++ b/drivers/scsi/scsi_ioctl.c
@@ -519,7 +519,7 @@ static int sg_scsi_ioctl(struct request_queue *q, fmode_t mode,
return -EFAULT;
if (in_len > PAGE_SIZE || out_len > PAGE_SIZE)
return -EINVAL;
- if (get_user(opcode, sic->data))
+ if (get_user(opcode, (unsigned char __user *)sic->data))
return -EFAULT;
bytes = max(in_len, out_len);
--
2.38.0
From: Kirill A. Shutemov
> Sent: 16 November 2022 00:44
>
> get_user() expects the pointer to be pointer-to-simple-variable type,
> but sic->data is array of 'unsigned char'. It violates get_user()
> contracts.
>
> Cast it explicitly to 'unsigned char __user *'. It matches current
> behaviour.
>
> This is preparation for fixing sparse warnings caused by Linear Address
> Masking patchset.
>
> Signed-off-by: Kirill A. Shutemov <[email protected]>
> Cc: "James E.J. Bottomley" <[email protected]>
> Cc: "Martin K. Petersen" <[email protected]>
> ---
> drivers/scsi/scsi_ioctl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c
> index 2d20da55fb64..72b3ab5137b8 100644
> --- a/drivers/scsi/scsi_ioctl.c
> +++ b/drivers/scsi/scsi_ioctl.c
> @@ -519,7 +519,7 @@ static int sg_scsi_ioctl(struct request_queue *q, fmode_t mode,
> return -EFAULT;
> if (in_len > PAGE_SIZE || out_len > PAGE_SIZE)
> return -EINVAL;
> - if (get_user(opcode, sic->data))
> + if (get_user(opcode, (unsigned char __user *)sic->data))
Using &sic->data[0] should work and is much nicer than the cast.
David
> return -EFAULT;
>
> bytes = max(in_len, out_len);
> --
> 2.38.0
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
On Wed, Nov 16, 2022 at 10:40:09PM +0000, David Laight wrote:
> From: Kirill A. Shutemov
> > Sent: 16 November 2022 00:44
> >
> > get_user() expects the pointer to be pointer-to-simple-variable type,
> > but sic->data is array of 'unsigned char'. It violates get_user()
> > contracts.
> >
> > Cast it explicitly to 'unsigned char __user *'. It matches current
> > behaviour.
> >
> > This is preparation for fixing sparse warnings caused by Linear Address
> > Masking patchset.
> >
> > Signed-off-by: Kirill A. Shutemov <[email protected]>
> > Cc: "James E.J. Bottomley" <[email protected]>
> > Cc: "Martin K. Petersen" <[email protected]>
> > ---
> > drivers/scsi/scsi_ioctl.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c
> > index 2d20da55fb64..72b3ab5137b8 100644
> > --- a/drivers/scsi/scsi_ioctl.c
> > +++ b/drivers/scsi/scsi_ioctl.c
> > @@ -519,7 +519,7 @@ static int sg_scsi_ioctl(struct request_queue *q, fmode_t mode,
> > return -EFAULT;
> > if (in_len > PAGE_SIZE || out_len > PAGE_SIZE)
> > return -EINVAL;
> > - if (get_user(opcode, sic->data))
> > + if (get_user(opcode, (unsigned char __user *)sic->data))
>
> Using &sic->data[0] should work and is much nicer than the cast.
Okay. Fair enough. Adjusted patch is below.
From 86baed963c9295c067940479ab0f844c3644e1c9 Mon Sep 17 00:00:00 2001
From: "Kirill A. Shutemov" <[email protected]>
Date: Wed, 16 Nov 2022 03:22:28 +0300
Subject: [PATCHv2 1/2] scsi: Fix get_user() in call sg_scsi_ioctl()
get_user() expects the pointer to be pointer-to-simple-variable type,
but sic->data is array of 'unsigned char'. It violates get_user()
contracts.
Explicitly take pointer to the first element of the array. It matches
current behaviour.
This is preparation for fixing sparse warnings caused by Linear Address
Masking patchset.
Signed-off-by: Kirill A. Shutemov <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
---
drivers/scsi/scsi_ioctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c
index 2d20da55fb64..fdd47565a311 100644
--- a/drivers/scsi/scsi_ioctl.c
+++ b/drivers/scsi/scsi_ioctl.c
@@ -519,7 +519,7 @@ static int sg_scsi_ioctl(struct request_queue *q, fmode_t mode,
return -EFAULT;
if (in_len > PAGE_SIZE || out_len > PAGE_SIZE)
return -EINVAL;
- if (get_user(opcode, sic->data))
+ if (get_user(opcode, &sic->data[0]))
return -EFAULT;
bytes = max(in_len, out_len);
--
Kiryl Shutsemau / Kirill A. Shutemov
On Wed, Nov 16, 2022 at 03:43:53AM +0300, Kirill A. Shutemov wrote:
> Linear Address Masking patchset triggered a lot of sparse warnings.
>
> The root cause is that casting pointer to '__typeof__(*(ptr)) *' will
> strip all sparse tags. The type has to be defined based on the pointer
> type, not based on what the pointer points to.
>
> Fix cast in untagged_ptr() and avoid __typeof__() usage in
> get/put_user().
Without this patch we have
drivers/auxdisplay/charlcd.c:482:21: warning: incorrect type in assignment (different address spaces)
drivers/auxdisplay/charlcd.c:482:21: expected char const [noderef] __user *__ptr_clean
drivers/auxdisplay/charlcd.c:482:21: got char const *
So,
Tested-by: Andy Shevchenko <[email protected]>
Can we have this series applied, please?
--
With Best Regards,
Andy Shevchenko