1. 21 Jun, 2020 3 commits
  2. 20 Jun, 2020 7 commits
    • Linus Torvalds's avatar
      Merge tag 'trace-v5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 8b6ddd10
      Linus Torvalds authored
      Pull tracing fixes from Steven Rostedt:
      
       - Have recordmcount work with > 64K sections (to support LTO)
      
       - kprobe RCU fixes
      
       - Correct a kprobe critical section with missing mutex
      
       - Remove redundant arch_disarm_kprobe() call
      
       - Fix lockup when kretprobe triggers within kprobe_flush_task()
      
       - Fix memory leak in fetch_op_data operations
      
       - Fix sleep in atomic in ftrace trace array sample code
      
       - Free up memory on failure in sample trace array code
      
       - Fix incorrect reporting of function_graph fields in format file
      
       - Fix quote within quote parsing in bootconfig
      
       - Fix return value of bootconfig tool
      
       - Add testcases for bootconfig tool
      
       - Fix maybe uninitialized warning in ftrace pid file code
      
       - Remove unused variable in tracing_iter_reset()
      
       - Fix some typos
      
      * tag 'trace-v5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        ftrace: Fix maybe-uninitialized compiler warning
        tools/bootconfig: Add testcase for show-command and quotes test
        tools/bootconfig: Fix to return 0 if succeeded to show the bootconfig
        tools/bootconfig: Fix to use correct quotes for value
        proc/bootconfig: Fix to use correct quotes for value
        tracing: Remove unused event variable in tracing_iter_reset
        tracing/probe: Fix memleak in fetch_op_data operations
        trace: Fix typo in allocate_ftrace_ops()'s comment
        tracing: Make ftrace packed events have align of 1
        sample-trace-array: Remove trace_array 'sample-instance'
        sample-trace-array: Fix sleeping function called from invalid context
        kretprobe: Prevent triggering kretprobe from within kprobe_flush_task
        kprobes: Remove redundant arch_disarm_kprobe() call
        kprobes: Fix to protect kick_kprobe_optimizer() by kprobe_mutex
        kprobes: Use non RCU traversal APIs on kprobe_tables if possible
        kprobes: Suppress the suspicious RCU warning on kprobes
        recordmcount: support >64k sections
      8b6ddd10
    • Linus Torvalds's avatar
      Merge tag 'libnvdimm-for-5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm · eede2b9b
      Linus Torvalds authored
      Pull libnvdimm updates from Dan Williams:
       "A feature (papr_scm health retrieval) and a fix (sysfs attribute
        visibility) for v5.8.
      
        Vaibhav explains in the merge commit below why missing v5.8 would be
        painful and I agreed to try a -rc2 pull because only cosmetics kept
        this out of -rc1 and his initial versions were posted in more than
        enough time for v5.8 consideration:
      
         'These patches are tied to specific features that were committed to
          customers in upcoming distros releases (RHEL and SLES) whose
          time-lines are tied to 5.8 kernel release.
      
          Being able to track the health of an nvdimm is critical for our
          customers that are running workloads leveraging papr-scm nvdimms.
          Missing the 5.8 kernel would mean missing the distro timelines and
          shifting forward the availability of this feature in distro kernels
          by at least 6 months'
      
        Summary:
      
         - Fix the visibility of the region 'align' attribute.
      
           The new unit tests for region alignment handling caught a corner
           case where the alignment cannot be specified if the region is
           converted from static to dynamic provisioning at runtime.
      
         - Add support for device health retrieval for the persistent memory
           supported by the papr_scm driver.
      
           This includes both the standard sysfs "health flags" that the nfit
           persistent memory driver publishes and a mechanism for the ndctl
           tool to retrieve a health-command payload"
      
      * tag 'libnvdimm-for-5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
        nvdimm/region: always show the 'align' attribute
        powerpc/papr_scm: Implement support for PAPR_PDSM_HEALTH
        ndctl/papr_scm,uapi: Add support for PAPR nvdimm specific methods
        powerpc/papr_scm: Improve error logging and handling papr_scm_ndctl()
        powerpc/papr_scm: Fetch nvdimm health information from PHYP
        seq_buf: Export seq_buf_printf
        powerpc: Document details on H_SCM_HEALTH hcall
      eede2b9b
    • Linus Torvalds's avatar
      Merge tag 's390-5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · 1566feea
      Linus Torvalds authored
      Pull s390 fixes from Vasily Gorbik:
      
       - a few ptrace fixes mostly for strace and seccomp_bpf kernel tests
         findings
      
       - cleanup unused pm callbacks in virtio ccw
      
       - replace kmalloc + memset with kzalloc in crypto
      
       - use $(LD) for vDSO linkage to make clang happy
      
       - fix vDSO clock_getres() to preserve the same behaviour as
         posix_get_hrtimer_res()
      
       - fix workqueue cpumask warning when NUMA=n and nr_node_ids=2
      
       - reduce SLSB writes during input processing, improve warnings and
         cleanup qdio_data usage in qdio
      
       - a few fixes to use scnprintf() instead of snprintf()
      
      * tag 's390-5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390: fix syscall_get_error for compat processes
        s390/qdio: warn about unexpected SLSB states
        s390/qdio: clean up usage of qdio_data
        s390/numa: let NODES_SHIFT depend on NEED_MULTIPLE_NODES
        s390/vdso: fix vDSO clock_getres()
        s390/vdso: Use $(LD) instead of $(CC) to link vDSO
        s390/protvirt: use scnprintf() instead of snprintf()
        s390: use scnprintf() in sys_##_prefix##_##_name##_show
        s390/crypto: use scnprintf() instead of snprintf()
        s390/zcrypt: use kzalloc
        s390/virtio: remove unused pm callbacks
        s390/qdio: reduce SLSB writes during Input Queue processing
        selftests/seccomp: s390 shares the syscall and return value register
        s390/ptrace: fix setting syscall number
        s390/ptrace: pass invalid syscall numbers to tracing
        s390/ptrace: return -ENOSYS when invalid syscall is supplied
        s390/seccomp: pass syscall arguments via seccomp_data
        s390/qdio: fine-tune SLSB update
      1566feea
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · 7fdfbe08
      Linus Torvalds authored
      Pull RISC-V fixes from Palmer Dabbelt:
      
       - a workaround for a compiler surprise related to the "r" inline
         assembly that allows LLVM to boot.
      
       - a fix to avoid WX-only mappings, which the ISA does not allow. While
         this probably manifests in many ways, the bug was found in stress-ng.
      
       - a missing lock in set_direct_map_*(), which due to a recent lockdep
         change started asserting.
      
      * tag 'riscv-for-linus-5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        RISC-V: Acquire mmap lock before invoking walk_page_range
        RISC-V: Don't allow write+exec only page mapping request in mmap
        riscv/atomic: Fix sign extension for RV64I
      7fdfbe08
    • Linus Torvalds's avatar
      Merge tag 'linux-kselftest-5.8-rc2' of... · 27c27605
      Linus Torvalds authored
      Merge tag 'linux-kselftest-5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
      
      Pull kselftest cleanups from Shuah Khan:
      
       - ftrace "requires:" list for simplifying and unifying requirement
         checks for each test case, adding "requires:" line instead of
         checking required ftrace interfaces in each test case.
      
       - a minor spelling correction patch
      
      * tag 'linux-kselftest-5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
        selftests/ftrace: Support ":README" suffix for requires
        selftests/ftrace: Support ":tracer" suffix for requires
        selftests/ftrace: Convert check_filter_file() with requires list
        selftests/ftrace: Convert required interface checks into requires list
        selftests/ftrace: Add "requires:" list support
        selftests/ftrace: Return unsupported for the unconfigured features
        selftests/ftrace: Allow ":" in description
        tools: testing: ftrace: trigger: fix spelling mistake
      27c27605
    • David Howells's avatar
      afs: Fix hang on rmmod due to outstanding timer · 5481fc6e
      David Howells authored
      The fileserver probe timer, net->fs_probe_timer, isn't cancelled when
      the kafs module is being removed and so the count it holds on
      net->servers_outstanding doesn't get dropped..
      
      This causes rmmod to wait forever.  The hung process shows a stack like:
      
      	afs_purge_servers+0x1b5/0x23c [kafs]
      	afs_net_exit+0x44/0x6e [kafs]
      	ops_exit_list+0x72/0x93
      	unregister_pernet_operations+0x14c/0x1ba
      	unregister_pernet_subsys+0x1d/0x2a
      	afs_exit+0x29/0x6f [kafs]
      	__do_sys_delete_module.isra.0+0x1a2/0x24b
      	do_syscall_64+0x51/0x95
      	entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      Fix this by:
      
       (1) Attempting to cancel the probe timer and, if successful, drop the
           count that the timer was holding.
      
       (2) Make the timer function just drop the count and not schedule the
           prober if the afs portion of net namespace is being destroyed.
      
      Also, whilst we're at it, make the following changes:
      
       (3) Initialise net->servers_outstanding to 1 and decrement it before
           waiting on it so that it doesn't generate wake up events by being
           decremented to 0 until we're cleaning up.
      
       (4) Switch the atomic_dec() on ->servers_outstanding for ->fs_timer in
           afs_purge_servers() to use the helper function for that.
      
      Fixes: f6cbb368 ("afs: Actively poll fileservers to maintain NAT or firewall openings")
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5481fc6e
    • David Howells's avatar
      afs: Fix afs_do_lookup() to call correct fetch-status op variant · f8ea5c7b
      David Howells authored
      Fix afs_do_lookup()'s fallback case for when FS.InlineBulkStatus isn't
      supported by the server.
      
      In the fallback, it calls FS.FetchStatus for the specific vnode it's
      meant to be looking up.  Commit b6489a49 broke this by renaming one
      of the two identically-named afs_fetch_status_operation descriptors to
      something else so that one of them could be made non-static.  The site
      that used the renamed one, however, wasn't renamed and didn't produce
      any warning because the other was declared in a header.
      
      Fix this by making afs_do_lookup() use the renamed variant.
      
      Note that there are two variants of the success method because one is
      called from ->lookup() where we may or may not have an inode, but can't
      call iget until after we've talked to the server - whereas the other is
      called from within iget where we have an inode, but it may or may not be
      initialised.
      
      The latter variant expects there to be an inode, but because it's being
      called from there former case, there might not be - resulting in an oops
      like the following:
      
        BUG: kernel NULL pointer dereference, address: 00000000000000b0
        ...
        RIP: 0010:afs_fetch_status_success+0x27/0x7e
        ...
        Call Trace:
          afs_wait_for_operation+0xda/0x234
          afs_do_lookup+0x2fe/0x3c1
          afs_lookup+0x3c5/0x4bd
          __lookup_slow+0xcd/0x10f
          walk_component+0xa2/0x10c
          path_lookupat.isra.0+0x80/0x110
          filename_lookup+0x81/0x104
          vfs_statx+0x76/0x109
          __do_sys_newlstat+0x39/0x6b
          do_syscall_64+0x4c/0x78
          entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      Fixes: b6489a49 ("afs: Fix silly rename")
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f8ea5c7b
  3. 19 Jun, 2020 21 commits
  4. 18 Jun, 2020 9 commits
    • Dave Airlie's avatar
      Merge tag 'drm-intel-fixes-2020-06-18' of... · 7ac98ff0
      Dave Airlie authored
      Merge tag 'drm-intel-fixes-2020-06-18' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
      
      - Fix for timeslicing and virtual engines/unpremptable requests
        (+ 1 dependency patch)
      - Fixes into TypeC register programming and interrupt storm detecting
      - Disable DIP on MST ports with the transcoder clock still on
      - Avoid missing GT workarounds at reset for HSW and older gens
      - Fix for unwinding multiple requests missing force restore
      - Fix encoder type check for DDI vswing sequence
      - Build warning fixes
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200618124659.GA12342@jlahtine-desk.ger.corp.intel.com
      7ac98ff0
    • Linus Torvalds's avatar
      Merge branch 'hch' (maccess patches from Christoph Hellwig) · 5e857ce6
      Linus Torvalds authored
      Merge non-faulting memory access cleanups from Christoph Hellwig:
       "Andrew and I decided to drop the patches implementing your suggested
        rename of the probe_kernel_* and probe_user_* helpers from -mm as
        there were way to many conflicts.
      
        After -rc1 might be a good time for this as all the conflicts are
        resolved now"
      
      This also adds a type safety checking patch on top of the renaming
      series to make the subtle behavioral difference between 'get_user()' and
      'get_kernel_nofault()' less potentially dangerous and surprising.
      
      * emailed patches from Christoph Hellwig <hch@lst.de>:
        maccess: make get_kernel_nofault() check for minimal type compatibility
        maccess: rename probe_kernel_address to get_kernel_nofault
        maccess: rename probe_user_{read,write} to copy_{from,to}_user_nofault
        maccess: rename probe_kernel_{read,write} to copy_{from,to}_kernel_nofault
      5e857ce6
    • Linus Torvalds's avatar
      maccess: make get_kernel_nofault() check for minimal type compatibility · 0c389d89
      Linus Torvalds authored
      Now that we've renamed probe_kernel_address() to get_kernel_nofault()
      and made it look and behave more in line with get_user(), some of the
      subtle type behavior differences end up being more obvious and possibly
      dangerous.
      
      When you do
      
              get_user(val, user_ptr);
      
      the type of the access comes from the "user_ptr" part, and the above
      basically acts as
      
              val = *user_ptr;
      
      by design (except, of course, for the fact that the actual dereference
      is done with a user access).
      
      Note how in the above case, the type of the end result comes from the
      pointer argument, and then the value is cast to the type of 'val' as
      part of the assignment.
      
      So the type of the pointer is ultimately the more important type both
      for the access itself.
      
      But 'get_kernel_nofault()' may now _look_ similar, but it behaves very
      differently.  When you do
      
              get_kernel_nofault(val, kernel_ptr);
      
      it behaves like
      
              val = *(typeof(val) *)kernel_ptr;
      
      except, of course, for the fact that the actual dereference is done with
      exception handling so that a faulting access is suppressed and returned
      as the error code.
      
      But note how different the casting behavior of the two superficially
      similar accesses are: one does the actual access in the size of the type
      the pointer points to, while the other does the access in the size of
      the target, and ignores the pointer type entirely.
      
      Actually changing get_kernel_nofault() to act like get_user() is almost
      certainly the right thing to do eventually, but in the meantime this
      patch adds logit to at least verify that the pointer type is compatible
      with the type of the result.
      
      In many cases, this involves just casting the pointer to 'void *' to
      make it obvious that the type of the pointer is not the important part.
      It's not how 'get_user()' acts, but at least the behavioral difference
      is now obvious and explicit.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0c389d89
    • Christoph Hellwig's avatar
      maccess: rename probe_kernel_address to get_kernel_nofault · 25f12ae4
      Christoph Hellwig authored
      Better describe what this helper does, and match the naming of
      copy_from_kernel_nofault.
      
      Also switch the argument order around, so that it acts and looks
      like get_user().
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      25f12ae4
    • Luc Van Oostenryck's avatar
      sparse: use identifiers to define address spaces · 670d0a4b
      Luc Van Oostenryck authored
      Currently, address spaces in warnings are displayed as '<asn:X>' with
      'X' being the address space's arbitrary number.
      
      But since sparse v0.6.0-rc1 (late December 2018), sparse allows you to
      define the address spaces using an identifier instead of a number.  This
      identifier is then directly used in the warnings.
      
      So, use the identifiers '__user', '__iomem', '__percpu' & '__rcu' for
      the corresponding address spaces.  The default address space, __kernel,
      being not displayed in warnings, stays defined as '0'.
      
      With this change, warnings that used to be displayed as:
      
      	cast removes address space '<asn:1>' of expression
      	... void [noderef] <asn:2> *
      
      will now be displayed as:
      
      	cast removes address space '__user' of expression
      	... void [noderef] __iomem *
      
      This also moves the __kernel annotation to be the first one, since it is
      quite different from the others because it's the default one, and so:
      
       - it's never displayed
      
       - it's normally not needed, nor in type annotations, nor in cast
         between address spaces. The only time it's needed is when it's
         combined with a typeof to express "the same type as this one but
         without the address space"
      
       - it can't be defined with a name, '0' must be used.
      
      So, it seemed strange to me to have it in the middle of the other
      ones.
      Signed-off-by: default avatarLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
      Acked-by: default avatarMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      670d0a4b
    • Zheng Bin's avatar
      block: make function 'kill_bdev' static · 3373a346
      Zheng Bin authored
      kill_bdev does not have any external user, so make it static.
      Signed-off-by: default avatarZheng Bin <zhengbin13@huawei.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarBart Van Assche <bvanassche@acm.org>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      3373a346
    • Zheng Bin's avatar
      loop: replace kill_bdev with invalidate_bdev · f4bd34b1
      Zheng Bin authored
      When a filesystem is mounted on a loop device and on a loop ioctl
      LOOP_SET_STATUS64, because of kill_bdev, buffer_head mappings are getting
      destroyed.
      kill_bdev
        truncate_inode_pages
          truncate_inode_pages_range
            do_invalidatepage
              block_invalidatepage
                discard_buffer  -->clear BH_Mapped flag
      
      sb_bread
        __bread_gfp
        bh = __getblk_gfp
        -->discard_buffer clear BH_Mapped flag
        __bread_slow
          submit_bh
            submit_bh_wbc
              BUG_ON(!buffer_mapped(bh))  --> hit this BUG_ON
      
      Fixes: 5db470e2 ("loop: drop caches if offset or block_size are changed")
      Signed-off-by: default avatarZheng Bin <zhengbin13@huawei.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarBart Van Assche <bvanassche@acm.org>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      f4bd34b1
    • Kai-Heng Feng's avatar
      libata: Use per port sync for detach · b5292111
      Kai-Heng Feng authored
      Commit 130f4caf ("libata: Ensure ata_port probe has completed before
      detach") may cause system freeze during suspend.
      
      Using async_synchronize_full() in PM callbacks is wrong, since async
      callbacks that are already scheduled may wait for not-yet-scheduled
      callbacks, causes a circular dependency.
      
      Instead of using big hammer like async_synchronize_full(), use async
      cookie to make sure port probe are synced, without affecting other
      scheduled PM callbacks.
      
      Fixes: 130f4caf ("libata: Ensure ata_port probe has completed before detach")
      Suggested-by: default avatarJohn Garry <john.garry@huawei.com>
      Signed-off-by: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
      Tested-by: default avatarJohn Garry <john.garry@huawei.com>
      BugLink: https://bugs.launchpad.net/bugs/1867983Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      b5292111
    • Andy Shevchenko's avatar
      partitions/ldm: Replace uuid_copy() with import_uuid() where it makes sense · bc163c20
      Andy Shevchenko authored
      There is a specific API to treat raw data as UUID, i.e. import_uuid().
      Use it instead of uuid_copy() with explicit casting.
      Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      bc163c20