Skip to content
  1. Dec 21, 2020
    • Linus Torvalds's avatar
      Merge tag '5.11-rc-smb3-part2' of git://git.samba.org/sfrench/cifs-2.6 · 58288813
      Linus Torvalds authored
      Pull cifs fixes from Steve French:
       "Four small CIFS/SMB3 fixes (witness protocol and reconnect related),
        and two that add ability to get and set auditing information in the
        security descriptor (SACL), which can be helpful not just for backup
        scenarios ("smbinfo secdesc" etc.) but also for improving security"
      
      * tag '5.11-rc-smb3-part2' of git://git.samba.org/sfrench/cifs-2.6:
        Add SMB 2 support for getting and setting SACLs
        SMB3: Add support for getting and setting SACLs
        cifs: Avoid error pointer dereference
        cifs: Re-indent cifs_swn_reconnect()
        cifs: Unlock on errors in cifs_swn_reconnect()
        cifs: Delete a stray unlock in cifs_swn_reconnect()
      58288813
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-2020-12-19' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux · 48342fc0
      Linus Torvalds authored
      Pull perf tools updates from Arnaldo Carvalho de Melo:
       "perf record:
         - Fix memory leak when using '--user-regs=?' to list registers
      
        aarch64 support:
         - Add aarch64 registers to 'perf record's' --user-regs command line
           option
      
        aarch64 hw tracing support:
         - Decode memory tagging properties
         - Improve ARM's auxtrace support
         - Add support for ARMv8.3-SPE
      
        perf kvm:
         - Add kvm-stat for arm64
      
        perf stat:
         - Add --quiet option
      
        Cleanups:
         - Fixup function names wrt what is in libperf and what is in
           tools/perf
      
        Build:
         - Allow building without libbpf in older systems
      
        New kernel features:
         - Initial support for data/code page size sample type, more to come
      
        perf annotate:
         - Support MIPS instruction extended support
      
        perf stack unwinding:
         - Fix separate debug info files when using elfutils' libdw's unwinder
      
        perf vendor events:
         - Update Intel's Skylake client events to v50
         - Add JSON metrics for ARM's imx8mm DDR Perf
         - Support printing metric groups for system PMUs
      
        perf build id:
         - Prep work for supporting having the build id provided by the kernel
           in PERF_RECORD_MMAP2 metadata events
      
        perf stat:
         - Support regex pattern in --for-each-cgroup
      
        pipe mode:
         - Allow to use stdio functions for pipe mode
         - Support 'perf report's' --header-only for pipe mode
         - Support pipe mode display in 'perf evlist'
      
        Documentation:
         - Update information about CAP_PERFMON"
      
      * tag 'perf-tools-2020-12-19' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (134 commits)
        perf mem: Factor out a function to generate sort order
        perf sort: Add sort option for data page size
        perf script: Support data page size
        tools headers UAPI: Update asm-generic/unistd.h
        tools headers cpufeatures: Sync with the kernel sources
        tools headers UAPI: Sync linux/prctl.h with the kernel sources
        tools headers UAPI: Sync linux/fscrypt.h with the kernel sources
        tools headers UAPI: Sync linux/const.h with the kernel headers
        tools arch x86: Sync the msr-index.h copy with the kernel sources
        perf trace beauty: Update copy of linux/socket.h with the kernel sources
        tools headers: Update linux/ctype.h with the kernel sources
        tools headers: Add conditional __has_builtin()
        tools headers: Get tools's linux/compiler.h closer to the kernel's
        tools headers UAPI: Sync linux/stat.h with the kernel sources
        tools headers: Syncronize linux/build_bug.h with the kernel sources
        perf tools: Reformat record's control fd man text
        perf config: Fix example command in manpage to conform to syntax specified in the SYNOPSIS section.
        perf test: Make sample-parsing test aware of PERF_SAMPLE_{CODE,DATA}_PAGE_SIZE
        perf tools: Add support to read build id from compressed elf
        perf debug: Add debug_set_file function
        ...
      48342fc0
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 6a447b0e
      Linus Torvalds authored
      Pull KVM updates from Paolo Bonzini:
       "Much x86 work was pushed out to 5.12, but ARM more than made up for it.
      
        ARM:
         - PSCI relay at EL2 when "protected KVM" is enabled
         - New exception injection code
         - Simplification of AArch32 system register handling
         - Fix PMU accesses when no PMU is enabled
         - Expose CSV3 on non-Meltdown hosts
         - Cache hierarchy discovery fixes
         - PV steal-time cleanups
         - Allow function pointers at EL2
         - Various host EL2 entry cleanups
         - Simplification of the EL2 vector allocation
      
        s390:
         - memcg accouting for s390 specific parts of kvm and gmap
         - selftest for diag318
         - new kvm_stat for when async_pf falls back to sync
      
        x86:
         - Tracepoints for the new pagetable code from 5.10
         - Catch VFIO and KVM irqfd events before userspace
         - Reporting dirty pages to userspace with a ring buffer
         - SEV-ES host support
         - Nested VMX support for wait-for-SIPI activity state
         - New feature flag (AVX512 FP16)
         - New system ioctl to report Hyper-V-compatible paravirtualization features
      
        Generic:
         - Selftest improvements"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (171 commits)
        KVM: SVM: fix 32-bit compilation
        KVM: SVM: Add AP_JUMP_TABLE support in prep for AP booting
        KVM: SVM: Provide support to launch and run an SEV-ES guest
        KVM: SVM: Provide an updated VMRUN invocation for SEV-ES guests
        KVM: SVM: Provide support for SEV-ES vCPU loading
        KVM: SVM: Provide support for SEV-ES vCPU creation/loading
        KVM: SVM: Update ASID allocation to support SEV-ES guests
        KVM: SVM: Set the encryption mask for the SVM host save area
        KVM: SVM: Add NMI support for an SEV-ES guest
        KVM: SVM: Guest FPU state save/restore not needed for SEV-ES guest
        KVM: SVM: Do not report support for SMM for an SEV-ES guest
        KVM: x86: Update __get_sregs() / __set_sregs() to support SEV-ES
        KVM: SVM: Add support for CR8 write traps for an SEV-ES guest
        KVM: SVM: Add support for CR4 write traps for an SEV-ES guest
        KVM: SVM: Add support for CR0 write traps for an SEV-ES guest
        KVM: SVM: Add support for EFER write traps for an SEV-ES guest
        KVM: SVM: Support string IO operations for an SEV-ES guest
        KVM: SVM: Support MMIO for an SEV-ES guest
        KVM: SVM: Create trace events for VMGEXIT MSR protocol processing
        KVM: SVM: Create trace events for VMGEXIT processing
        ...
      6a447b0e
    • Linus Torvalds's avatar
      Merge tag 'rtc-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux · f4a2f786
      Linus Torvalds authored
      Pull RTC updates from Alexandre Belloni:
       "Subsystem:
      
         - Remove nvram ABI. There was no complaints about the deprecation for
           the last 3 years.
      
         - Improve RTC device allocation and registration
      
         - Now available for ARCH=um
      
        Drivers:
      
         - at91rm9200: correction and sam9x60 support
      
         - ds1307: improve ACPI support
      
         - mxc: now DT only
      
         - pcf2127: watchdog support now needs the reset-source property
      
         - pcf8523: set range
      
         - rx6110: i2c support"
      
      * tag 'rtc-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (43 commits)
        rtc: pcf2127: only use watchdog when explicitly available
        dt-bindings: rtc: add reset-source property
        rtc: fix RTC removal
        rtc: s3c: Remove dead code related to periodic tick handling
        rtc: s3c: Disable all enable (RTC, tick) bits in the probe
        rtc: ep93xx: Fix NULL pointer dereference in ep93xx_rtc_read_time
        rtc: test: remove debug message
        rtc: mxc{,_v2}: enable COMPILE_TEST
        rtc: enable RTC framework on ARCH=um
        rtc: pcf8523: use BIT
        rtc: pcf8523: set range
        rtc: pcf8523: switch to devm_rtc_allocate_device
        rtc: destroy mutex when releasing the device
        rtc: shrink devm_rtc_allocate_device()
        rtc: rework rtc_register_device() resource management
        rtc: nvmem: emit an error message when nvmem registration fails
        rtc: add devm_ prefix to rtc_nvmem_register()
        rtc: nvmem: remove nvram ABI
        Documentation: list RTC devres helpers in devres.rst
        rtc: omap: use devm_pinctrl_register()
        ...
      f4a2f786
    • Linus Torvalds's avatar
      Merge tag 'gfs2-for-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 · 7703f46f
      Linus Torvalds authored
      Pull gfs2 updates from Andreas Gruenbacher:
      
       - Don't wait for unfreeze of the wrong filesystems
      
       - Remove an obsolete delete_work_func hack and an incorrect
         sb_start_write
      
       - Minor documentation updates and cosmetic care
      
      * tag 'gfs2-for-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
        gfs2: in signal_our_withdraw wait for unfreeze of _this_ fs only
        gfs2: Remove sb_start_write from gfs2_statfs_sync
        gfs2: remove trailing semicolons from macro definitions
        Revert "GFS2: Prevent delete work from occurring on glocks used for create"
        gfs2: Make inode operations static
        MAINTAINERS: Add gfs2 bug tracker link
        Documentation: Update filesystems/gfs2.rst
      7703f46f
    • Heiko Carstens's avatar
      epoll: fix compat syscall wire up of epoll_pwait2 · 450f68e2
      Heiko Carstens authored
      Commit b0a0c261 ("epoll: wire up syscall epoll_pwait2") wired up
      the 64 bit syscall instead of the compat variant in a couple of places.
      
      Fixes: b0a0c261
      
       ("epoll: wire up syscall epoll_pwait2")
      Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Willem de Bruijn <willemb@google.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      450f68e2
  2. Dec 20, 2020
  3. Dec 19, 2020
    • Christian Brauner's avatar
      selftests/core: add regression test for CLOSE_RANGE_UNSHARE | CLOSE_RANGE_CLOEXEC · 6abc20f8
      Christian Brauner authored
      This test is a minimalized version of the reproducer given by syzbot
      (cf. [1]).
      
      After introducing CLOSE_RANGE_CLOEXEC syzbot reported a crash when
      CLOSE_RANGE_CLOEXEC is specified in conjunction with
      CLOSE_RANGE_UNSHARE. When CLOSE_RANGE_UNSHARE is specified the caller
      will receive a private file descriptor table in case their file
      descriptor table is currently shared.
      For the case where the caller has requested all file descriptors to be
      actually closed via e.g. close_range(3, ~0U, 0) 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. Add tests for this regression.
      
      We first create a huge gap in the fd table. When we now call
      CLOSE_RANGE_UNSHARE with a shared fd table and and with ~0U as upper
      bound the kernel will only copy up to fd1 file descriptors into the new
      fd table. If the kernel is buggy and doesn't handle CLOSE_RANGE_CLOEXEC
      correctly it will not have copied all file descriptors and we will oops!
      
      This test passes on a fixed kernel and will trigger an oops on a buggy
      kernel.
      
      [1]: https://syzkaller.appspot.com/text?tag=KernelConfig&x=db720fe37a6a41d8
      
      Cc: Giuseppe Scrivano <gscrivan@redhat.com>
      Cc: linux-fsdevel@vger.kernel.org
      Link: syzbot+96cfd2b22b3213646a93@syzkaller.appspotmail.com
      Link: https://lore.kernel.org/r/20201218145415.801063-4-christian.brauner@ubuntu.com
      
      
      Signed-off-by: default avatarChristian Brauner <christian.brauner@ubuntu.com>
      6abc20f8
    • Christian Brauner's avatar
      selftests/core: add test for CLOSE_RANGE_UNSHARE | CLOSE_RANGE_CLOEXEC · fe325c3f
      Christian Brauner authored
      Add a test to verify that CLOSE_RANGE_UNSHARE works correctly when combined
      with CLOSE_RANGE_CLOEXEC for the single-threaded case.
      
      Cc: Giuseppe Scrivano <gscrivan@redhat.com>
      Cc: linux-fsdevel@vger.kernel.org
      Link: https://lore.kernel.org/r/20201218145415.801063-3-christian.brauner@ubuntu.com
      
      
      Signed-off-by: default avatarChristian Brauner <christian.brauner@ubuntu.com>
      fe325c3f
    • Christian Brauner's avatar
      selftests/core: handle missing syscall number for close_range · ae78ba8d
      Christian Brauner authored
      This improves the syscall number handling in the close_range()
      selftests. This should handle any architecture.
      
      Cc: Giuseppe Scrivano <gscrivan@redhat.com>
      Cc: linux-fsdevel@vger.kernel.org
      Link: https://lore.kernel.org/r/20201218145415.801063-2-christian.brauner@ubuntu.com
      
      
      Signed-off-by: default avatarChristian Brauner <christian.brauner@ubuntu.com>
      ae78ba8d
    • Tobias Klauser's avatar
      selftests/core: fix close_range_test build after XFAIL removal · ca202504
      Tobias Klauser authored
      XFAIL was removed in commit 9847d24a ("selftests/harness: Refactor
      XFAIL into SKIP") and its use in close_range_test was already replaced
      by commit 1d44d0dd ("selftests: core: use SKIP instead of XFAIL in
      close_range_test.c"). However, commit 23afeaef ("selftests: core:
      add tests for CLOSE_RANGE_CLOEXEC") introduced usage of XFAIL in
      TEST(close_range_cloexec). Use SKIP there as well.
      
      Fixes: 23afeaef
      
       ("selftests: core: add tests for CLOSE_RANGE_CLOEXEC")
      Cc: Giuseppe Scrivano <gscrivan@redhat.com>
      Cc: linux-fsdevel@vger.kernel.org
      Signed-off-by: default avatarTobias Klauser <tklauser@distanz.ch>
      Acked-by: default avatarChristian Brauner <christian.brauner@ubuntu.com>
      Link: https://lore.kernel.org/r/20201218112428.13662-1-tklauser@distanz.ch
      Link: https://lore.kernel.org/r/20201218145415.801063-1-christian.brauner@ubuntu.com
      
      
      Signed-off-by: default avatarChristian Brauner <christian.brauner@ubuntu.com>
      ca202504
    • Christian Brauner's avatar
      close_range: unshare all fds for CLOSE_RANGE_UNSHARE | CLOSE_RANGE_CLOEXEC · fec8a6a6
      Christian Brauner authored
      
      
      After introducing CLOSE_RANGE_CLOEXEC syzbot reported a crash when
      CLOSE_RANGE_CLOEXEC is specified in conjunction with CLOSE_RANGE_UNSHARE.
      When CLOSE_RANGE_UNSHARE is specified the caller will receive a private
      file descriptor table in case their file descriptor table is currently
      shared.
      
      For the case where the caller has requested all file descriptors to be
      actually closed via e.g. close_range(3, ~0U, 0) 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.
      
      syzbot reported
      ==================================================================
      BUG: KASAN: null-ptr-deref in instrument_atomic_read include/linux/instrumented.h:71 [inline]
      BUG: KASAN: null-ptr-deref in atomic64_read include/asm-generic/atomic-instrumented.h:837 [inline]
      BUG: KASAN: null-ptr-deref in atomic_long_read include/asm-generic/atomic-long.h:29 [inline]
      BUG: KASAN: null-ptr-deref in filp_close+0x22/0x170 fs/open.c:1274
      Read of size 8 at addr 0000000000000077 by task syz-executor511/8522
      
      CPU: 1 PID: 8522 Comm: syz-executor511 Not tainted 5.10.0-syzkaller #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Call Trace:
       __dump_stack lib/dump_stack.c:79 [inline]
       dump_stack+0x107/0x163 lib/dump_stack.c:120
       __kasan_report mm/kasan/report.c:549 [inline]
       kasan_report.cold+0x5/0x37 mm/kasan/report.c:562
       check_memory_region_inline mm/kasan/generic.c:186 [inline]
       check_memory_region+0x13d/0x180 mm/kasan/generic.c:192
       instrument_atomic_read include/linux/instrumented.h:71 [inline]
       atomic64_read include/asm-generic/atomic-instrumented.h:837 [inline]
       atomic_long_read include/asm-generic/atomic-long.h:29 [inline]
       filp_close+0x22/0x170 fs/open.c:1274
       close_files fs/file.c:402 [inline]
       put_files_struct fs/file.c:417 [inline]
       put_files_struct+0x1cc/0x350 fs/file.c:414
       exit_files+0x12a/0x170 fs/file.c:435
       do_exit+0xb4f/0x2a00 kernel/exit.c:818
       do_group_exit+0x125/0x310 kernel/exit.c:920
       get_signal+0x428/0x2100 kernel/signal.c:2792
       arch_do_signal_or_restart+0x2a8/0x1eb0 arch/x86/kernel/signal.c:811
       handle_signal_work kernel/entry/common.c:147 [inline]
       exit_to_user_mode_loop kernel/entry/common.c:171 [inline]
       exit_to_user_mode_prepare+0x124/0x200 kernel/entry/common.c:201
       __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline]
       syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:302
       entry_SYSCALL_64_after_hwframe+0x44/0xa9
      RIP: 0033:0x447039
      Code: Unable to access opcode bytes at RIP 0x44700f.
      RSP: 002b:00007f1b1225cdb8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
      RAX: 0000000000000001 RBX: 00000000006dbc28 RCX: 0000000000447039
      RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 00000000006dbc2c
      RBP: 00000000006dbc20 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dbc2c
      R13: 00007fff223b6bef R14: 00007f1b1225d9c0 R15: 00000000006dbc2c
      ==================================================================
      
      syzbot has tested the proposed patch and the reproducer did not trigger any issue:
      
      Reported-and-tested-by: default avatar <syzbot+96cfd2b22b3213646a93@syzkaller.appspotmail.com>
      
      Tested on:
      
      commit:         10f7cddd selftests/core: add regression test for CLOSE_RAN..
      git tree:       git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git vfs
      kernel config:  https://syzkaller.appspot.com/x/.config?x=5d42216b510180e3
      dashboard link: https://syzkaller.appspot.com/bug?extid=96cfd2b22b3213646a93
      
      
      compiler:       gcc (GCC) 10.1.0-syz 20200507
      
      Reported-by: default avatar <syzbot+96cfd2b22b3213646a93@syzkaller.appspotmail.com>
      Fixes: 582f1fb6 ("fs, close_range: add flag CLOSE_RANGE_CLOEXEC")
      Cc: Giuseppe Scrivano <gscrivan@redhat.com>
      Cc: linux-fsdevel@vger.kernel.org
      Link: https://lore.kernel.org/r/20201217213303.722643-1-christian.brauner@ubuntu.com
      
      
      Signed-off-by: default avatarChristian Brauner <christian.brauner@ubuntu.com>
      fec8a6a6