# 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/powerpc64-linux/bin/powerpc64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux-ld --version # < git log --format=%s --max-count=1 467f8165a2b0e6accf3d0dd9c8089b1dbde29f7f # < make -s -j 120 ARCH=powerpc O=/kisskb/build/linus_ppc44x_defconfig_powerpc-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux- ppc44x_defconfig # make -s -j 120 ARCH=powerpc O=/kisskb/build/linus_ppc44x_defconfig_powerpc-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux- /kisskb/src/block/genhd.c: In function 'diskstats_show': /kisskb/src/block/genhd.c:1515:1: warning: the frame size of 1160 bytes is larger than 1024 bytes [-Wframe-larger-than=] } ^ /kisskb/src/lib/zstd/compress.c: In function 'ZSTD_compressBlock_doubleFast': /kisskb/src/lib/zstd/compress.c:1393:1: warning: the frame size of 1584 bytes is larger than 1024 bytes [-Wframe-larger-than=] } ^ INFO: Uncompressed kernel (size 0x607968) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x700000) INFO: Uncompressed kernel (size 0x607968) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x700000) INFO: Uncompressed kernel (size 0x607968) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x700000) INFO: Uncompressed kernel (size 0x607968) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x700000) INFO: Uncompressed kernel (size 0x607968) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x700000) INFO: Uncompressed kernel (size 0x607968) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x700000) INFO: Uncompressed kernel (size 0x607968) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x700000) INFO: Uncompressed kernel (size 0x607968) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x700000) INFO: Uncompressed kernel (size 0x607968) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x700000) INFO: Uncompressed kernel (size 0x607968) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x700000) INFO: Uncompressed kernel (size 0x607968) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x700000) Image Name: Linux-5.10.0-g467f8165a2b0 Created: Sun Dec 20 08:42:09 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3098723 Bytes = 3026.10 KiB = 2.96 MiB Load Address: 00700000 Entry Point: 007014a8 Image Name: Linux-5.10.0-g467f8165a2b0 Created: Sun Dec 20 08:42:09 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3099079 Bytes = 3026.44 KiB = 2.96 MiB Load Address: 00700000 Entry Point: 007014a0 Image Name: Linux-5.10.0-g467f8165a2b0 Created: Sun Dec 20 08:42:09 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3099464 Bytes = 3026.82 KiB = 2.96 MiB Load Address: 00700000 Entry Point: 00701488 Image Name: Linux-5.10.0-g467f8165a2b0 Created: Sun Dec 20 08:42:09 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3099435 Bytes = 3026.79 KiB = 2.96 MiB Load Address: 00700000 Entry Point: 007014a8 Image Name: Linux-5.10.0-g467f8165a2b0 Created: Sun Dec 20 08:42:09 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3098757 Bytes = 3026.13 KiB = 2.96 MiB Load Address: 00700000 Entry Point: 00701498 Image Name: Linux-5.10.0-g467f8165a2b0 Created: Sun Dec 20 08:42:09 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3098793 Bytes = 3026.17 KiB = 2.96 MiB Load Address: 00700000 Entry Point: 007014b8 Image Name: Linux-5.10.0-g467f8165a2b0 Created: Sun Dec 20 08:42:09 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3098666 Bytes = 3026.04 KiB = 2.96 MiB Load Address: 00700000 Entry Point: 007001b8 Image Name: Linux-5.10.0-g467f8165a2b0 Created: Sun Dec 20 08:42:09 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3098806 Bytes = 3026.18 KiB = 2.96 MiB Load Address: 00700000 Entry Point: 007014a8 Image Name: Linux-5.10.0-g467f8165a2b0 Created: Sun Dec 20 08:42:09 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3099355 Bytes = 3026.71 KiB = 2.96 MiB Load Address: 00700000 Entry Point: 007000c4 Completed OK # rm -rf /kisskb/build/linus_ppc44x_defconfig_powerpc-gcc4.9 # Build took: 0:00:37.824984