1. 30 10月, 2020 3 次提交
    • L
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma · b9c0f4bd
      Linus Torvalds 提交于
      Pull rdma fixes from Jason Gunthorpe:
       "The good news is people are testing rc1 in the RDMA world - the bad
        news is testing of the for-next area is not as good as I had hoped, as
        we really should have caught at least the rdma_connect_locked() issue
        before now.
      
        Notable merge window regressions that didn't get caught/fixed in time
        for rc1:
      
         - Fix in kernel users of rxe, they were broken by the rapid fix to
           undo the uABI breakage in rxe from another patch
      
         - EFA userspace needs to read the GID table but was broken with the
           new GID table logic
      
         - Fix user triggerable deadlock in mlx5 using devlink reload
      
         - Fix deadlock in several ULPs using rdma_connect from the CM handler
           callbacks
      
         - Memory leak in qedr"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
        RDMA/qedr: Fix memory leak in iWARP CM
        RDMA: Add rdma_connect_locked()
        RDMA/uverbs: Fix false error in query gid IOCTL
        RDMA/mlx5: Fix devlink deadlock on net namespace deletion
        RDMA/rxe: Fix small problem in network_type patch
      b9c0f4bd
    • L
      Merge tag 'afs-fixes-20201029' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs · 598a5976
      Linus Torvalds 提交于
      Pull AFS fixes from David Howells:
      
       - Fix copy_file_range() to an afs file now returning EINVAL if the
         splice_write file op isn't supplied.
      
       - Fix a deref-before-check in afs_unuse_cell().
      
       - Fix a use-after-free in afs_xattr_get_acl().
      
       - Fix afs to not try to clear PG_writeback when laundering a page.
      
       - Fix afs to take a ref on a page that it sets PG_private on and to
         drop that ref when clearing PG_private. This is done through recently
         added helpers.
      
       - Fix a page leak if write_begin() fails.
      
       - Fix afs_write_begin() to not alter the dirty region info stored in
         page->private, but rather do this in afs_write_end() instead when we
         know what we actually changed.
      
       - Fix afs_invalidatepage() to alter the dirty region info on a page
         when partial page invalidation occurs so that we don't inadvertantly
         include a span of zeros that will get written back if a page gets
         laundered due to a remote 3rd-party induced invalidation.
      
         We mustn't, however, reduce the dirty region if the page has been
         seen to be mapped (ie. we got called through the page_mkwrite vector)
         as the page might still be mapped and we might lose data if the file
         is extended again.
      
       - Fix the dirty region info to have a lower resolution if the size of
         the page is too large for this to be encoded (e.g. powerpc32 with 64K
         pages).
      
         Note that this might not be the ideal way to handle this, since it
         may allow some leakage of undirtied zero bytes to the server's copy
         in the case of a 3rd-party conflict.
      
      To aid the last two fixes, two additional changes:
      
       - Wrap the manipulations of the dirty region info stored in
         page->private into helper functions.
      
       - Alter the encoding of the dirty region so that the region bounds can
         be stored with one fewer bit, making a bit available for the
         indication of mappedness.
      
      * tag 'afs-fixes-20201029' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
        afs: Fix dirty-region encoding on ppc32 with 64K pages
        afs: Fix afs_invalidatepage to adjust the dirty region
        afs: Alter dirty range encoding in page->private
        afs: Wrap page->private manipulations in inline functions
        afs: Fix where page->private is set during write
        afs: Fix page leak on afs_write_begin() failure
        afs: Fix to take ref on page when PG_private is set
        afs: Fix afs_launder_page to not clear PG_writeback
        afs: Fix a use after free in afs_xattr_get_acl()
        afs: Fix tracing deref-before-check
        afs: Fix copy_file_range()
      598a5976
    • L
      Merge tag 'ext4_for_linus_fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · 58130a6c
      Linus Torvalds 提交于
      Pull ext4 fixes from Ted Ts'o:
       "Bug fixes for the new ext4 fast commit feature, plus a fix for the
        'data=journal' bug fix.
      
        Also use the generic casefolding support which has now landed in
        fs/libfs.c for 5.10"
      
      * tag 'ext4_for_linus_fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        ext4: indicate that fast_commit is available via /sys/fs/ext4/feature/...
        ext4: use generic casefolding support
        ext4: do not use extent after put_bh
        ext4: use IS_ERR() for error checking of path
        ext4: fix mmap write protection for data=journal mode
        jbd2: fix a kernel-doc markup
        ext4: use s_mount_flags instead of s_mount_state for fast commit state
        ext4: make num of fast commit blocks configurable
        ext4: properly check for dirty state in ext4_inode_datasync_dirty()
        ext4: fix double locking in ext4_fc_commit_dentry_updates()
      58130a6c
  2. 29 10月, 2020 18 次提交
  3. 28 10月, 2020 13 次提交
  4. 27 10月, 2020 6 次提交
    • S
      tracing, synthetic events: Replace buggy strcat() with seq_buf operations · 761a8c58
      Steven Rostedt (VMware) 提交于
      There was a memory corruption bug happening while running the synthetic
      event selftests:
      
       kmemleak: Cannot insert 0xffff8c196fa2afe5 into the object search tree (overlaps existing)
       CPU: 5 PID: 6866 Comm: ftracetest Tainted: G        W         5.9.0-rc5-test+ #577
       Hardware name: Hewlett-Packard HP Compaq Pro 6300 SFF/339A, BIOS K01 v03.03 07/14/2016
       Call Trace:
        dump_stack+0x8d/0xc0
        create_object.cold+0x3b/0x60
        slab_post_alloc_hook+0x57/0x510
        ? tracing_map_init+0x178/0x340
        __kmalloc+0x1b1/0x390
        tracing_map_init+0x178/0x340
        event_hist_trigger_func+0x523/0xa40
        trigger_process_regex+0xc5/0x110
        event_trigger_write+0x71/0xd0
        vfs_write+0xca/0x210
        ksys_write+0x70/0xf0
        do_syscall_64+0x33/0x40
        entry_SYSCALL_64_after_hwframe+0x44/0xa9
       RIP: 0033:0x7fef0a63a487
       Code: 64 89 02 48 c7 c0 ff ff ff ff eb bb 0f 1f 80 00 00 00 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 48 89 54 24 18 48 89 74 24
       RSP: 002b:00007fff76f18398 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
       RAX: ffffffffffffffda RBX: 0000000000000039 RCX: 00007fef0a63a487
       RDX: 0000000000000039 RSI: 000055eb3b26d690 RDI: 0000000000000001
       RBP: 000055eb3b26d690 R08: 000000000000000a R09: 0000000000000038
       R10: 000055eb3b2cdb80 R11: 0000000000000246 R12: 0000000000000039
       R13: 00007fef0a70b500 R14: 0000000000000039 R15: 00007fef0a70b700
       kmemleak: Kernel memory leak detector disabled
       kmemleak: Object 0xffff8c196fa2afe0 (size 8):
       kmemleak:   comm "ftracetest", pid 6866, jiffies 4295082531
       kmemleak:   min_count = 1
       kmemleak:   count = 0
       kmemleak:   flags = 0x1
       kmemleak:   checksum = 0
       kmemleak:   backtrace:
            __kmalloc+0x1b1/0x390
            tracing_map_init+0x1be/0x340
            event_hist_trigger_func+0x523/0xa40
            trigger_process_regex+0xc5/0x110
            event_trigger_write+0x71/0xd0
            vfs_write+0xca/0x210
            ksys_write+0x70/0xf0
            do_syscall_64+0x33/0x40
            entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      The cause came down to a use of strcat() that was adding an string that was
      shorten, but the strcat() did not take that into account.
      
      strcat() is extremely dangerous as it does not care how big the buffer is.
      Replace it with seq_buf operations that prevent the buffer from being
      overwritten if what is being written is bigger than the buffer.
      
      Fixes: 10819e25 ("tracing: Handle synthetic event array field type checking correctly")
      Reviewed-by: NTom Zanussi <zanussi@kernel.org>
      Tested-by: NTom Zanussi <zanussi@kernel.org>
      Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      761a8c58
    • L
      scsi: qla2xxx: remove incorrect sparse #ifdef · 4525c878
      Linus Torvalds 提交于
      The code to try to shut up sparse warnings about questionable locking
      didn't shut up sparse: it made the result not parse as valid C at all,
      since the end result now has a label with no statement.
      
      The proper fix is to just always lock the hardware, the same way Bart
      did in commit 8ae17876 ("scsi: qla2xxx: Simplify the functions for
      dumping firmware").  That avoids the whole problem with having locking
      that is not statically obvious.
      
      But in the meantime, just remove the incorrect attempt at trying to
      avoid a sparse warning that just made things worse.
      
      This was exposed by commit 3e6efab8 ("scsi: qla2xxx: Fix reset of
      MPI firmware"), very similarly to how commit cbb01c2f ("scsi:
      qla2xxx: Fix MPI failure AEN (8200) handling") exposed the same problem
      in another place, and caused that commit 8ae17876.
      
      Please don't add code to just shut up sparse without actually fixing
      what sparse complains about.
      Reported-by: NLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
      Cc: Bart Van Assche <bvanassche@acm.org>
      Cc: Arun Easi <aeasi@marvell.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4525c878
    • L
      arch/um: partially revert the conversion to __section() macro · bf9a76a4
      Linus Torvalds 提交于
      A couple of um files ended up not including the header file that defines
      the __section() macro, and the simplest fix is to just revert the change
      for those files.
      
      Fixes: 33def849 treewide: Convert macro and uses of __section(foo) to __section("foo")
      Reported-and-tested-by: NGuenter Roeck <linux@roeck-us.net>
      Cc: Joe Perches <joe@perches.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bf9a76a4
    • G
      RDMA/uverbs: Fix false error in query gid IOCTL · 7d66a714
      Gal Pressman 提交于
      Some drivers (such as EFA) have a GID table, but aren't IB/RoCE devices.
      Remove the unnecessary rdma_ib_or_roce() check.
      
      This fixes rdma-core failures for EFA when it uses the new ioctl interface
      for querying the GID table.
      
      Fixes: 9f85cbe5 ("RDMA/uverbs: Expose the new GID query API to user space")
      Link: https://lore.kernel.org/r/20201026082621.32463-1-galpress@amazon.comSigned-off-by: NGal Pressman <galpress@amazon.com>
      Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
      7d66a714
    • P
      RDMA/mlx5: Fix devlink deadlock on net namespace deletion · fbdd0049
      Parav Pandit 提交于
      When a mlx5 core devlink instance is reloaded in different net namespace,
      its associated IB device is deleted and recreated.
      
      Example sequence is:
      $ ip netns add foo
      $ devlink dev reload pci/0000:00:08.0 netns foo
      $ ip netns del foo
      
      mlx5 IB device needs to attach and detach the netdevice to it through the
      netdev notifier chain during load and unload sequence.  A below call graph
      of the unload flow.
      
      cleanup_net()
         down_read(&pernet_ops_rwsem); <- first sem acquired
           ops_pre_exit_list()
             pre_exit()
               devlink_pernet_pre_exit()
                 devlink_reload()
                   mlx5_devlink_reload_down()
                     mlx5_unload_one()
                     [...]
                       mlx5_ib_remove()
                         mlx5_ib_unbind_slave_port()
                           mlx5_remove_netdev_notifier()
                             unregister_netdevice_notifier()
                               down_write(&pernet_ops_rwsem);<- recurrsive lock
      
      Hence, when net namespace is deleted, mlx5 reload results in deadlock.
      
      When deadlock occurs, devlink mutex is also held. This not only deadlocks
      the mlx5 device under reload, but all the processes which attempt to
      access unrelated devlink devices are deadlocked.
      
      Hence, fix this by mlx5 ib driver to register for per net netdev notifier
      instead of global one, which operats on the net namespace without holding
      the pernet_ops_rwsem.
      
      Fixes: 4383cfcc ("net/mlx5: Add devlink reload")
      Link: https://lore.kernel.org/r/20201026134359.23150-1-parav@nvidia.comSigned-off-by: NParav Pandit <parav@nvidia.com>
      Signed-off-by: NLeon Romanovsky <leonro@nvidia.com>
      Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
      fbdd0049
    • B
      RDMA/rxe: Fix small problem in network_type patch · edebc840
      Bob Pearson 提交于
      The patch referenced below has a typo that results in using the wrong L2
      header size for outbound traffic. (V4 <-> V6).
      
      It also breaks kernel-side RC traffic because they use AVs that use
      RDMA_NETWORK_XXX enums instead of RXE_NETWORK_TYPE_XXX enums. Fix this by
      transcoding between these enum types.
      
      Fixes: e0d696d2 ("RDMA/rxe: Move the definitions for rxe_av.network_type to uAPI")
      Link: https://lore.kernel.org/r/20201016211343.22906-1-rpearson@hpe.comSigned-off-by: NBob Pearson <rpearson@hpe.com>
      Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
      edebc840