# git rev-parse -q --verify a180bd1d7e16173d965b263c5a536aa40afa2a2a^{commit} a180bd1d7e16173d965b263c5a536aa40afa2a2a already have revision, skipping fetch # git checkout -q -f -B kisskb a180bd1d7e16173d965b263c5a536aa40afa2a2a # git clean -qxdf # < git log -1 # commit a180bd1d7e16173d965b263c5a536aa40afa2a2a # Author: Linus Torvalds # Date: Sun Jul 4 16:12:42 2021 -0700 # # iov_iter: remove uaccess_kernel() warning from iov_iter_init() # # This warning was there to catch any architectures that still use # CONFIG_SET_FS, and that would mis-use iov_iter_init() for anything that # wasn't a proper user space pointer. So that # # WARN_ON_ONCE(uaccess_kernel()); # # makes perfect conceptual sense: you really shouldn't use a kernel # pointer with set_fs(KERNEL_DS) and then pass it to iov_iter_init(). # # HOWEVER. # # Guenter Roeck reports that this warning actually triggers in no-mmu # configurations of both ARM and m68k. And the reason isn't that they # pass in a kernel pointer under set_fs(KERNEL_DS) at all: the reason is # that in those configurations, "uaccess_kernel()" is simply not reliable. # # Those no-mmu setups set USER_DS and KERNEL_DS to the same values, so you # can't test for the difference. # # In particular, the no-mmu case for ARM does # # #define USER_DS KERNEL_DS # #define uaccess_kernel() (true) # # so USER_DS and KERNEL_DS have the same value, and uaccess_kernel() is # always trivially true. # # The m68k case is slightly different and not quite as obvious. It does # (spread out over multiple header files just to be extra exciting: # asm/processor.h, asm/segment.h and asm-generic/uaccess.h): # # #define TASK_SIZE (0xFFFFFFFFUL) # #define USER_DS MAKE_MM_SEG(TASK_SIZE) # #define KERNEL_DS MAKE_MM_SEG(~0UL) # #define get_fs() (current_thread_info()->addr_limit) # #define uaccess_kernel() (get_fs().seg == KERNEL_DS.seg) # # but the end result is the same: uaccess_kernel() will always be true, # because USER_DS and KERNEL_DS end up having the same value, even if that # value is defined differently. # # This is very arguably a misfeature in those implementations, but in the # end we don't really care. All modern architectures have gotten rid of # set_fs() already, and generic kernel code never uses it. And while the # sanity check was a nice idea, an architecture would have to go the extra # mile to actually break this. # # So this well-intentioned warning isn't really all that likely to find # anything but these known false positives, and as such just isn't worth # maintaining. # # Reported-by: Guenter Roeck # Fixes: 8cd54c1c8480 ("iov_iter: separate direction from flavour") # Cc: Matthew Wilcox # Cc: Al Viro # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux-gcc --version # < /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux-ld --version # < git log --format=%s --max-count=1 a180bd1d7e16173d965b263c5a536aa40afa2a2a # < make -s -j 10 ARCH=mips O=/kisskb/build/linus_mips-defconfig_mipsel CROSS_COMPILE=/opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux- defconfig # < make -s -j 10 ARCH=mips O=/kisskb/build/linus_mips-defconfig_mipsel CROSS_COMPILE=/opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux- help # make -s -j 10 ARCH=mips O=/kisskb/build/linus_mips-defconfig_mipsel CROSS_COMPILE=/opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux- olddefconfig # make -s -j 10 ARCH=mips O=/kisskb/build/linus_mips-defconfig_mipsel CROSS_COMPILE=/opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux- FIT description: Linux 5.13.0-ga180bd1d7e16 Created: Fri Jul 16 14:47:57 2021 Image 0 (kernel) Description: Linux 5.13.0-ga180bd1d7e16 Created: Fri Jul 16 14:47:57 2021 Type: Kernel Image Compression: gzip compressed Data Size: 5377575 Bytes = 5251.54 KiB = 5.13 MiB Architecture: MIPS OS: Linux Load Address: 0x80100000 Entry Point: 0x809dc7bc Hash algo: sha1 Hash value: 866c14c650ce319d9813c15041d1fae921ff0e34 Image 1 (fdt-boston) Description: img,boston Device Tree Created: Fri Jul 16 14:47:57 2021 Type: Flat Device Tree Compression: uncompressed Data Size: 3793 Bytes = 3.70 KiB = 0.00 MiB Architecture: MIPS Hash algo: sha1 Hash value: 4799f50d688573234da6e9d7701234d394759ef4 Image 2 (fdt-ni169445) Description: NI 169445 device tree Created: Fri Jul 16 14:47:57 2021 Type: Flat Device Tree Compression: uncompressed Data Size: 1871 Bytes = 1.83 KiB = 0.00 MiB Architecture: MIPS Hash algo: sha1 Hash value: 51b89b31605ee62038c8468c429af091dfc75ec7 Image 3 (fdt-ocelot_pcb123) Description: MSCC Ocelot PCB123 Device Tree Created: Fri Jul 16 14:47:57 2021 Type: Flat Device Tree Compression: uncompressed Data Size: 4659 Bytes = 4.55 KiB = 0.00 MiB Architecture: MIPS Hash algo: sha1 Hash value: 5bcb6e4f21e8e5372544aa130b3bd097355a9050 Image 4 (fdt-ocelot_pcb120) Description: MSCC Ocelot PCB120 Device Tree Created: Fri Jul 16 14:47:57 2021 Type: Flat Device Tree Compression: uncompressed Data Size: 5418 Bytes = 5.29 KiB = 0.01 MiB Architecture: MIPS Hash algo: sha1 Hash value: 93d882f2009a217e0fa9dab94788535ed2be8476 Image 5 (fdt-xilfpga) Description: MIPSfpga (xilfpga) Device Tree Created: Fri Jul 16 14:47:57 2021 Type: Flat Device Tree Compression: uncompressed Data Size: 2708 Bytes = 2.64 KiB = 0.00 MiB Architecture: MIPS Hash algo: sha1 Hash value: 63d058b780f65e22da30f0a183433765f1807f1d Default Configuration: 'conf-default' Configuration 0 (conf-default) Description: Generic Linux kernel Kernel: kernel Configuration 1 (conf-boston) Description: Boston Linux kernel Kernel: kernel FDT: fdt-boston Configuration 2 (conf-ni169445) Description: NI 169445 Linux Kernel Kernel: kernel FDT: fdt-ni169445 Configuration 3 (conf-ocelot_pcb123) Description: Ocelot Linux kernel Kernel: kernel FDT: fdt-ocelot_pcb123 Configuration 4 (conf-ocelot_pcb120) Description: Ocelot Linux kernel Kernel: kernel FDT: fdt-ocelot_pcb120 Configuration 5 (conf-xilfpga) Description: MIPSfpga Linux kernel Kernel: kernel FDT: fdt-xilfpga Completed OK # rm -rf /kisskb/build/linus_mips-defconfig_mipsel # Build took: 0:03:43.028678