# git rev-parse -q --verify 467f8165a2b0e6accf3d0dd9c8089b1dbde29f7f^{commit} 467f8165a2b0e6accf3d0dd9c8089b1dbde29f7f already have revision, skipping fetch # git checkout -q -f -B kisskb 467f8165a2b0e6accf3d0dd9c8089b1dbde29f7f # git clean -qxdf # < git log -1 # commit 467f8165a2b0e6accf3d0dd9c8089b1dbde29f7f # Merge: 3872f516aab3 6abc20f8f879 # Author: Linus Torvalds # Date: Sat Dec 19 13:03:12 2020 -0800 # # Merge tag 'close-range-cloexec-unshare-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux # # Pull close_range fix from Christian Brauner: # "syzbot reported a bug when asking close_range() to unshare the file # descriptor table and making all fds close-on-exec. # # If CLOSE_RANGE_UNSHARE the caller will receive a private file # descriptor table in case their file descriptor table is currently # shared before operating on the requested file descriptor range. # # For the case where the caller has requested all file descriptors to be # actually closed via e.g. close_range(3, ~0U, CLOSE_RANGE_UNSHARE) the # kernel knows that the caller does not need any of the file descriptors # anymore and will optimize the close operation by only copying all # files in the range from 0 to 3 and no others. # # However, if the caller requested CLOSE_RANGE_CLOEXEC together with # CLOSE_RANGE_UNSHARE the caller wants to still make use of the file # descriptors so the kernel needs to copy all of them and can't # optimize. # # The original patch didn't account for this and thus could cause oopses # as evidenced by the syzbot report because it assumed that all fds had # been copied. Fix this by handling the CLOSE_RANGE_CLOEXEC case and # copying all fds if the two flags are specified together. # # This should've been caught in the selftests but the original patch # didn't cover this case and I didn't catch it during review. So in # addition to the bugfix I'm also adding selftests. They will reliably # reproduce the bug on a non-fixed kernel and allows us to catch # regressions and verify correct behavior. # # Note, the kernel selftest tree contained a bunch of changes that made # the original selftest fail to compile so there are small fixups in # here make them compile without warnings" # # * tag 'close-range-cloexec-unshare-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux: # selftests/core: add regression test for CLOSE_RANGE_UNSHARE | CLOSE_RANGE_CLOEXEC # selftests/core: add test for CLOSE_RANGE_UNSHARE | CLOSE_RANGE_CLOEXEC # selftests/core: handle missing syscall number for close_range # selftests/core: fix close_range_test build after XFAIL removal # close_range: unshare all fds for CLOSE_RANGE_UNSHARE | CLOSE_RANGE_CLOEXEC # < /opt/cross/kisskb/korg/gcc-4.9.4-nolibc/mips-linux/bin/mips-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-4.9.4-nolibc/mips-linux/bin/mips-linux-ld --version # < git log --format=%s --max-count=1 467f8165a2b0e6accf3d0dd9c8089b1dbde29f7f # < make -s -j 8 ARCH=mips O=/kisskb/build/linus_mips-allmodconfig_mips-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/mips-linux/bin/mips-linux- allmodconfig # Added to kconfig CONFIG_BUILD_DOCSRC=n # Added to kconfig CONFIG_MODULE_SIG=n # Added to kconfig CONFIG_SAMPLES=n # Added to kconfig CONFIG_MIPS_CPS_NS16550_BASE=0x1b0003f8 # Added to kconfig CONFIG_MIPS_CPS_NS16550_SHIFT=0 # < make -s -j 8 ARCH=mips O=/kisskb/build/linus_mips-allmodconfig_mips-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/mips-linux/bin/mips-linux- help # make -s -j 8 ARCH=mips O=/kisskb/build/linus_mips-allmodconfig_mips-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/mips-linux/bin/mips-linux- olddefconfig .config:12861:warning: override: reassigning to symbol MIPS_CPS_NS16550_SHIFT # make -s -j 8 ARCH=mips O=/kisskb/build/linus_mips-allmodconfig_mips-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/mips-linux/bin/mips-linux- /kisskb/src/lib/bitfield_kunit.c: In function 'test_bitfields_constants': /kisskb/src/lib/bitfield_kunit.c:93:1: warning: the frame size of 4224 bytes is larger than 2048 bytes [-Wframe-larger-than=] } ^ /kisskb/src/drivers/soc/qcom/pdr_interface.c: In function 'pdr_restart_pd': /kisskb/src/drivers/soc/qcom/pdr_interface.c:572:9: warning: missing braces around initializer [-Wmissing-braces] struct servreg_restart_pd_req req = { 0 }; ^ /kisskb/src/drivers/soc/qcom/pdr_interface.c:572:9: warning: (near initialization for 'req.service_path') [-Wmissing-braces] /kisskb/src/fs/btrfs/tree-checker.c: In function 'check_root_item': /kisskb/src/fs/btrfs/tree-checker.c:1064:9: warning: missing braces around initializer [-Wmissing-braces] struct btrfs_root_item ri = { 0 }; ^ /kisskb/src/fs/btrfs/tree-checker.c:1064:9: warning: (near initialization for 'ri.inode') [-Wmissing-braces] /kisskb/src/drivers/dma-buf/heaps/cma_heap.c: In function 'cma_heap_do_vmap': /kisskb/src/drivers/dma-buf/heaps/cma_heap.c:195:2: error: implicit declaration of function 'vmap' [-Werror=implicit-function-declaration] vaddr = vmap(buffer->pages, buffer->pagecount, VM_MAP, PAGE_KERNEL); ^ /kisskb/src/drivers/dma-buf/heaps/cma_heap.c:195:49: error: 'VM_MAP' undeclared (first use in this function) vaddr = vmap(buffer->pages, buffer->pagecount, VM_MAP, PAGE_KERNEL); ^ /kisskb/src/drivers/dma-buf/heaps/cma_heap.c:195:49: note: each undeclared identifier is reported only once for each function it appears in /kisskb/src/drivers/dma-buf/heaps/cma_heap.c: In function 'cma_heap_vunmap': /kisskb/src/drivers/dma-buf/heaps/cma_heap.c:235:3: error: implicit declaration of function 'vunmap' [-Werror=implicit-function-declaration] vunmap(buffer->vaddr); ^ cc1: some warnings being treated as errors make[4]: *** [/kisskb/src/scripts/Makefile.build:279: drivers/dma-buf/heaps/cma_heap.o] Error 1 make[3]: *** [/kisskb/src/scripts/Makefile.build:496: drivers/dma-buf/heaps] Error 2 make[2]: *** [/kisskb/src/scripts/Makefile.build:496: drivers/dma-buf] Error 2 make[2]: *** Waiting for unfinished jobs.... /kisskb/src/drivers/misc/habanalabs/common/habanalabs_ioctl.c: In function 'pll_frequency_info': /kisskb/src/drivers/misc/habanalabs/common/habanalabs_ioctl.c:409:9: warning: missing braces around initializer [-Wmissing-braces] struct hl_pll_frequency_info freq_info = {0}; ^ /kisskb/src/drivers/misc/habanalabs/common/habanalabs_ioctl.c:409:9: warning: (near initialization for 'freq_info.output') [-Wmissing-braces] /kisskb/src/drivers/gpu/drm/xlnx/zynqmp_dp.c: In function 'zynqmp_dp_update_vs_emph': /kisskb/src/drivers/gpu/drm/xlnx/zynqmp_dp.c:667:9: warning: missing braces around initializer [-Wmissing-braces] union phy_configure_opts opts = { 0 }; ^ /kisskb/src/drivers/gpu/drm/xlnx/zynqmp_dp.c:667:9: warning: (near initialization for 'opts.mipi_dphy') [-Wmissing-braces] /kisskb/src/drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/navi10_ppt.c: In function 'navi10_get_gpu_metrics': /kisskb/src/drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/navi10_ppt.c:2285:2: warning: missing braces around initializer [-Wmissing-braces] SmuMetrics_NV12_t nv12_metrics = { 0 }; ^ /kisskb/src/drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/navi10_ppt.c:2285:2: warning: (near initialization for 'nv12_metrics.CurrClock') [-Wmissing-braces] /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c: In function 'amdgpu_dm_psr_enable': /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9810:9: warning: missing braces around initializer [-Wmissing-braces] struct dc_static_screen_params params = {0}; ^ /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9810:9: warning: (near initialization for 'params.triggers') [-Wmissing-braces] /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c: In function 'bios_parser_get_i2c_info': /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:297:9: warning: missing braces around initializer [-Wmissing-braces] struct atom_i2c_record dummy_record = {0}; ^ /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:297:9: warning: (near initialization for 'dummy_record.record_header') [-Wmissing-braces] /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_hw_lock_mgr.c: In function 'dmub_hw_lock_mgr_cmd': /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_hw_lock_mgr.c:36:8: warning: missing braces around initializer [-Wmissing-braces] union dmub_rb_cmd cmd = { 0 }; ^ /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_hw_lock_mgr.c:36:8: warning: (near initialization for 'cmd.lock_hw') [-Wmissing-braces] /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c: In function 'commit_planes_for_stream': /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:2465:11: warning: missing braces around initializer [-Wmissing-braces] union dmub_hw_lock_flags hw_locks = { 0 }; ^ /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:2465:11: warning: (near initialization for 'hw_locks.bits') [-Wmissing-braces] /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:2666:11: warning: missing braces around initializer [-Wmissing-braces] union dmub_hw_lock_flags hw_locks = { 0 }; ^ /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:2666:11: warning: (near initialization for 'hw_locks.bits') [-Wmissing-braces] /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c: In function 'dp_test_get_audio_test_data': /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:2820:8: warning: missing braces around initializer [-Wmissing-braces] union audio_test_mode dpcd_test_mode = {0}; ^ /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:2820:8: warning: (near initialization for 'dpcd_test_mode.bits') [-Wmissing-braces] /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:2822:8: warning: missing braces around initializer [-Wmissing-braces] union audio_test_pattern_period dpcd_pattern_period[AUDIO_CHANNELS_COUNT] = {0}; ^ /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:2822:8: warning: (near initialization for 'dpcd_pattern_period[0]') [-Wmissing-braces] /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c: In function 'dc_link_dp_set_test_pattern': /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:4160:11: warning: missing braces around initializer [-Wmissing-braces] union dmub_hw_lock_flags hw_locks = { 0 }; ^ /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:4160:11: warning: (near initialization for 'hw_locks.bits') [-Wmissing-braces] /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:4204:11: warning: missing braces around initializer [-Wmissing-braces] union dmub_hw_lock_flags hw_locks = { 0 }; ^ /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:4204:11: warning: (near initialization for 'hw_locks.bits') [-Wmissing-braces] /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/dmub/src/dmub_dcn20.c: In function 'dmub_dcn20_enable_dmub_boot_options': /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/dmub/src/dmub_dcn20.c:326:8: warning: missing braces around initializer [-Wmissing-braces] union dmub_fw_boot_options boot_options = {0}; ^ /kisskb/src/drivers/gpu/drm/amd/amdgpu/../display/dmub/src/dmub_dcn20.c:326:8: warning: (near initialization for 'boot_options.bits') [-Wmissing-braces] make[1]: *** [/kisskb/src/Makefile:1805: drivers] Error 2 make: *** [Makefile:185: __sub-make] Error 2 Command 'make -s -j 8 ARCH=mips O=/kisskb/build/linus_mips-allmodconfig_mips-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/mips-linux/bin/mips-linux- ' returned non-zero exit status 2 # rm -rf /kisskb/build/linus_mips-allmodconfig_mips-gcc4.9 # Build took: 0:15:15.013936