# 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/korg/gcc-8.1.0-nolibc/s390-linux/bin/s390-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/s390-linux/bin/s390-linux-ld --version # < git log --format=%s --max-count=1 a180bd1d7e16173d965b263c5a536aa40afa2a2a # < make -s -j 32 ARCH=s390 O=/kisskb/build/linus_s390-allyesconfig_s390x-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/s390-linux/bin/s390-linux- allyesconfig # Added to kconfig CONFIG_BUILD_DOCSRC=n # Added to kconfig CONFIG_MODULE_SIG=n # < make -s -j 32 ARCH=s390 O=/kisskb/build/linus_s390-allyesconfig_s390x-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/s390-linux/bin/s390-linux- help # make -s -j 32 ARCH=s390 O=/kisskb/build/linus_s390-allyesconfig_s390x-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/s390-linux/bin/s390-linux- olddefconfig # make -s -j 32 ARCH=s390 O=/kisskb/build/linus_s390-allyesconfig_s390x-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/s390-linux/bin/s390-linux- /kisskb/src/arch/s390/kernel/traps.c: In function '__do_pgm_check': /kisskb/src/arch/s390/kernel/traps.c:359:1: warning: '__do_pgm_check' uses dynamic stack allocation } ^ /kisskb/src/arch/s390/kernel/syscall.c: In function '__do_syscall': /kisskb/src/arch/s390/kernel/syscall.c:166:1: warning: '__do_syscall' uses dynamic stack allocation } ^ /kisskb/src/kernel/trace/trace_osnoise.c: In function 'start_kthread': /kisskb/src/kernel/trace/trace_osnoise.c:1461:8: warning: 'main' is usually a function [-Wmain] void *main = osnoise_main; ^~~~ /kisskb/src/lib/test_scanf.c: In function 'numbers_list_field_width_val_width': /kisskb/src/lib/test_scanf.c:530:1: warning: the frame size of 2488 bytes is larger than 2048 bytes [-Wframe-larger-than=] } ^ /kisskb/src/lib/test_scanf.c: In function 'numbers_list_field_width_typemax': /kisskb/src/lib/test_scanf.c:488:1: warning: the frame size of 2976 bytes is larger than 2048 bytes [-Wframe-larger-than=] } ^ /kisskb/src/lib/test_scanf.c: In function 'numbers_list': /kisskb/src/lib/test_scanf.c:437:1: warning: the frame size of 2488 bytes is larger than 2048 bytes [-Wframe-larger-than=] } ^ /kisskb/src/drivers/gpu/drm/rockchip/cdn-dp-core.c:1126:12: warning: 'cdn_dp_resume' defined but not used [-Wunused-function] static int cdn_dp_resume(struct device *dev) ^~~~~~~~~~~~~ /kisskb/src/drivers/input/joystick/analog.c:160:2: warning: #warning Precise timer not defined for this architecture. [-Wcpp] #warning Precise timer not defined for this architecture. ^~~~~~~ /kisskb/src/drivers/scsi/ufs/ufshcd.c:9769:12: warning: 'ufshcd_rpmb_resume' defined but not used [-Wunused-function] static int ufshcd_rpmb_resume(struct device *dev) ^~~~~~~~~~~~~~~~~~ /kisskb/src/drivers/scsi/ufs/ufshcd.c:9036:12: warning: 'ufshcd_wl_runtime_resume' defined but not used [-Wunused-function] static int ufshcd_wl_runtime_resume(struct device *dev) ^~~~~~~~~~~~~~~~~~~~~~~~ /kisskb/src/drivers/scsi/ufs/ufshcd.c:9016:12: warning: 'ufshcd_wl_runtime_suspend' defined but not used [-Wunused-function] static int ufshcd_wl_runtime_suspend(struct device *dev) ^~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /kisskb/src/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c:42: /kisskb/src/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c: In function 'mvpp2_setup_bm_pool': /kisskb/src/drivers/net/ethernet/marvell/mvpp2/mvpp2.h:844:2: warning: overflow in conversion from 'long unsigned int' to 'int' changes value from '18446744073709551584' to '-32' [-Woverflow] ((total_size) - MVPP2_SKB_HEADROOM - MVPP2_SKB_SHINFO_SIZE) ^ /kisskb/src/drivers/net/ethernet/marvell/mvpp2/mvpp2.h:948:33: note: in expansion of macro 'MVPP2_RX_MAX_PKT_SIZE' #define MVPP2_BM_SHORT_PKT_SIZE MVPP2_RX_MAX_PKT_SIZE(MVPP2_BM_SHORT_FRAME_SIZE) ^~~~~~~~~~~~~~~~~~~~~ /kisskb/src/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c:683:41: note: in expansion of macro 'MVPP2_BM_SHORT_PKT_SIZE' mvpp2_pools[MVPP2_BM_SHORT].pkt_size = MVPP2_BM_SHORT_PKT_SIZE; ^~~~~~~~~~~~~~~~~~~~~~~ /kisskb/src/drivers/iio/test/iio-test-format.c: In function 'iio_test_iio_format_value_fixedpoint': /kisskb/src/drivers/iio/test/iio-test-format.c:98:1: warning: the frame size of 2168 bytes is larger than 2048 bytes [-Wframe-larger-than=] } ^ Completed OK # rm -rf /kisskb/build/linus_s390-allyesconfig_s390x-gcc8 # Build took: 0:25:54.695109