1. 14 8月, 2019 1 次提交
  2. 12 8月, 2019 3 次提交
    • D
      RDMA/core: Fix error code in stat_get_doit_qp() · 932727c5
      Dan Carpenter 提交于
      We need to set the error codes on these paths.  Currently the only
      possible error code is -EMSGSIZE so that's what the patch uses.
      
      Fixes: 83c2c1fc ("RDMA/nldev: Allow get counter mode through RDMA netlink")
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: NLeon Romanovsky <leonro@mellanox.com>
      Link: https://lore.kernel.org/r/20190809101311.GA17867@mwandaSigned-off-by: NDoug Ledford <dledford@redhat.com>
      932727c5
    • D
      RDMA/siw: Fix a memory leak in siw_init_cpulist() · 17c19287
      Dan Carpenter 提交于
      The error handling code doesn't free siw_cpu_info.tx_valid_cpus[0].  The
      first iteration through the loop is a no-op so this is sort of an off
      by one bug.  Also Bernard pointed out that we can remove the NULL
      assignment and simplify the code a bit.
      
      Fixes: bdcf26bf ("rdma/siw: network and RDMA core interface")
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: NBernard Metzler <bmt@zurich.ibm.com>
      Reviewed-by: NBernard Metzler <bmt@zurich.ibm.com>
      Link: https://lore.kernel.org/r/20190809140904.GB3552@mwandaSigned-off-by: NDoug Ledford <dledford@redhat.com>
      17c19287
    • Y
      IB/mlx5: Fix use-after-free error while accessing ev_file pointer · e9eec6a5
      Yishai Hadas 提交于
      Call to uverbs_close_fd() releases file pointer to 'ev_file' and
      mlx5_ib_dev is going to be inaccessible. Cache pointer prior cleaning
      resources to solve the KASAN warning below.
      
      BUG: KASAN: use-after-free in devx_async_event_close+0x391/0x480 [mlx5_ib]
      Read of size 8 at addr ffff888301e3cec0 by task devx_direct_tes/4631
      CPU: 1 PID: 4631 Comm: devx_direct_tes Tainted: G OE 5.3.0-rc1-for-upstream-dbg-2019-07-26_01-19-56-93 #1
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu2 04/01/2014
      Call Trace:
      dump_stack+0x9a/0xeb
      print_address_description+0x1e2/0x400
      ? devx_async_event_close+0x391/0x480 [mlx5_ib]
      __kasan_report+0x15c/0x1df
      ? devx_async_event_close+0x391/0x480 [mlx5_ib]
      kasan_report+0xe/0x20
      devx_async_event_close+0x391/0x480 [mlx5_ib]
      __fput+0x26a/0x7b0
      task_work_run+0x10d/0x180
      exit_to_usermode_loop+0x137/0x160
      do_syscall_64+0x3c7/0x490
      entry_SYSCALL_64_after_hwframe+0x49/0xbe
      RIP: 0033:0x7f5df907d664
      Code: 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f
      80 00 00 00 00 8b 05 6a cd 20 00 48 63 ff 85 c0 75 13 b8
      03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 44 f3 c3 66 90
      48 83 ec 18 48 89 7c 24 08 e8
      RSP: 002b:00007ffd353cb958 EFLAGS: 00000246 ORIG_RAX: 0000000000000003
      RAX: 0000000000000000 RBX: 000056017a88c348 RCX: 00007f5df907d664
      RDX: 00007f5df969d400 RSI: 00007f5de8f1ec90 RDI: 0000000000000006
      RBP: 00007f5df9681dc0 R08: 00007f5de8736410 R09: 000056017a9d2dd0
      R10: 000000000000000b R11: 0000000000000246 R12: 00007f5de899d7d0
      R13: 00007f5df96c4248 R14: 00007f5de8f1ecb0 R15: 000056017ae41308
      
      Allocated by task 4631:
      save_stack+0x19/0x80
      kasan_kmalloc.constprop.3+0xa0/0xd0
      alloc_uobj+0x71/0x230 [ib_uverbs]
      alloc_begin_fd_uobject+0x2e/0xc0 [ib_uverbs]
      rdma_alloc_begin_uobject+0x96/0x140 [ib_uverbs]
      ib_uverbs_run_method+0xdf0/0x1940 [ib_uverbs]
      ib_uverbs_cmd_verbs+0x57e/0xdb0 [ib_uverbs]
      ib_uverbs_ioctl+0x177/0x260 [ib_uverbs]
      do_vfs_ioctl+0x18f/0x1010
      ksys_ioctl+0x70/0x80
      __x64_sys_ioctl+0x6f/0xb0
      do_syscall_64+0x95/0x490
      entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      Freed by task 4631:
      save_stack+0x19/0x80
      __kasan_slab_free+0x11d/0x160
      slab_free_freelist_hook+0x67/0x1a0
      kfree+0xb9/0x2a0
      uverbs_close_fd+0x118/0x1c0 [ib_uverbs]
      devx_async_event_close+0x28a/0x480 [mlx5_ib]
      __fput+0x26a/0x7b0
      task_work_run+0x10d/0x180
      exit_to_usermode_loop+0x137/0x160
      do_syscall_64+0x3c7/0x490
      entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      The buggy address belongs to the object at ffff888301e3cda8
      which belongs to the cache kmalloc-512 of size 512
      The buggy address is located 280 bytes inside of 512-byte region
      [ffff888301e3cda8, ffff888301e3cfa8)
      The buggy address belongs to the page:
      page:ffffea000c078e00 refcount:1 mapcount:0
      mapping:ffff888352811300 index:0x0 compound_mapcount: 0
      flags: 0x2fffff80010200(slab|head)
      raw: 002fffff80010200 ffffea000d152608 ffffea000c077808 ffff888352811300
      raw: 0000000000000000 0000000000250025 00000001ffffffff 0000000000000000
      page dumped because: kasan: bad access detected
      Memory state around the buggy address:
      ffff888301e3cd80: fc fc fc fc fc fb fb fb fb fb fb fb fb fb fb fb
      ffff888301e3ce00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      ffff888301e3ce80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      ffff888301e3cf00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      ffff888301e3cf80: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc
      Disabling lock debugging due to kernel taint
      
      Cc: <stable@vger.kernel.org> # 5.2
      Fixes: 75973853 ("IB/mlx5: Enable subscription for device events over DEVX")
      Signed-off-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Reviewed-by: NJason Gunthorpe <jgg@mellanox.com>
      Link: https://lore.kernel.org/r/20190808081538.28772-1-leon@kernel.orgSigned-off-by: NDoug Ledford <dledford@redhat.com>
      e9eec6a5
  3. 08 8月, 2019 3 次提交
  4. 05 8月, 2019 9 次提交
  5. 04 8月, 2019 8 次提交
    • M
      kconfig: Clear "written" flag to avoid data loss · 0c5b6c28
      M. Vefa Bicakci 提交于
      Prior to this commit, starting nconfig, xconfig or gconfig, and saving
      the .config file more than once caused data loss, where a .config file
      that contained only comments would be written to disk starting from the
      second save operation.
      
      This bug manifests itself because the SYMBOL_WRITTEN flag is never
      cleared after the first call to conf_write, and subsequent calls to
      conf_write then skip all of the configuration symbols due to the
      SYMBOL_WRITTEN flag being set.
      
      This commit resolves this issue by clearing the SYMBOL_WRITTEN flag
      from all symbols before conf_write returns.
      
      Fixes: 8e2442a5 ("kconfig: fix missing choice values in auto.conf")
      Cc: linux-stable <stable@vger.kernel.org> # 4.19+
      Signed-off-by: NM. Vefa Bicakci <m.v.b@runbox.com>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      0c5b6c28
    • L
      Merge tag 'xtensa-20190803' of git://github.com/jcmvbkbc/linux-xtensa · d8778f13
      Linus Torvalds 提交于
      Pull Xtensa fix from Max Filippov:
       "Fix build for xtensa cores with coprocessors that was broken by
        entry/return abstraction patch"
      
      * tag 'xtensa-20190803' of git://github.com/jcmvbkbc/linux-xtensa:
        xtensa: fix build for cores with coprocessors
      d8778f13
    • L
      Merge branch 'i2c/for-current-fixed' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · cf6c8aef
      Linus Torvalds 提交于
      Pull i2c fixes from Wolfram Sang:
       "A set of driver fixes for the I2C subsystem"
      
      * 'i2c/for-current-fixed' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: s3c2410: Mark expected switch fall-through
        i2c: at91: fix clk_offset for sama5d2
        i2c: at91: disable TXRDY interrupt after sending data
        i2c: iproc: Fix i2c master read more than 63 bytes
        eeprom: at24: make spd world-readable again
      cf6c8aef
    • L
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 8b7fd679
      Linus Torvalds 提交于
      Pull perf tooling fixes from Thomas Gleixner:
       "A set of updates for perf tools and documentation:
      
        perf header:
          - Prevent a division by zero
          - Deal with an uninitialized warning proper
      
        libbpf:
          - Fix the missiong __WORDSIZE definition for musl & al
      
        UAPI headers:
          - Synchronize kernel headers
      
        Documentation:
          - Fix the memory units for perf.data size"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        libbpf: fix missing __WORDSIZE definition
        perf tools: Fix perf.data documentation units for memory size
        perf header: Fix use of unitialized value warning
        perf header: Fix divide by zero error if f_header.attr_size==0
        tools headers UAPI: Sync if_link.h with the kernel
        tools headers UAPI: Sync sched.h with the kernel
        tools headers UAPI: Sync usbdevice_fs.h with the kernels to get new ioctl
        tools perf beauty: Fix usbdevfs_ioctl table generator to handle _IOC()
        tools headers UAPI: Update tools's copy of drm.h headers
        tools headers UAPI: Update tools's copy of mman.h headers
        tools headers UAPI: Update tools's copy of kvm.h headers
        tools include UAPI: Sync x86's syscalls_64.tbl and generic unistd.h to pick up clone3 and pidfd_open
      8b7fd679
    • L
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 0432a0a0
      Linus Torvalds 提交于
      Pull vdso timer fixes from Thomas Gleixner:
       "A series of commits to deal with the regression caused by the generic
        VDSO implementation.
      
        The usage of clock_gettime64() for 32bit compat fallback syscalls
        caused seccomp filters to kill innocent processes because they only
        allow clock_gettime().
      
        Handle the compat syscalls with clock_gettime() as before, which is
        not a functional problem for the VDSO as the legacy compat application
        interface is not y2038 safe anyway. It's just extra fallback code
        which needs to be implemented on every architecture.
      
        It's opt in for now so that it does not break the compile of already
        converted architectures in linux-next. Once these are fixed, the
        #ifdeffery goes away.
      
        So much for trying to be smart and reuse code..."
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        arm64: compat: vdso: Use legacy syscalls as fallback
        x86/vdso/32: Use 32bit syscall fallback
        lib/vdso/32: Provide legacy syscall fallbacks
        lib/vdso: Move fallback invocation to the callers
        lib/vdso/32: Remove inconsistent NULL pointer checks
      0432a0a0
    • L
      Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · af42e745
      Linus Torvalds 提交于
      Pull irq fixes from Thomas Gleixner:
       "A small bunch of fixes from the irqchip department:
      
         - Fix a couple of UAF on error paths (RZA1, GICv3 ITS)
      
         - Fix iMX GPCv2 trigger setting
      
         - Add missing of_node_put() on error path in MBIGEN
      
         - Add another bunch of /* fall-through */ to silence warnings"
      
      * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        irqchip/renesas-rza1: Fix an use-after-free in rza1_irqc_probe()
        irqchip/irq-imx-gpcv2: Forward irq type to parent
        irqchip/irq-mbigen: Add of_node_put() before return
        irqchip/gic-v3-its: Free unused vpt_page when alloc vpe table fail
        irqchip/gic-v3: Mark expected switch fall-through
      af42e745
    • L
      Merge tag 'xfs-5.3-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · e12b243d
      Linus Torvalds 提交于
      Pull xfs fixes from Darrick Wong:
      
       - Avoid leaking kernel stack contents to userspace
      
       - Fix a potential null pointer dereference in the dabtree scrub code
      
      * tag 'xfs-5.3-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: Fix possible null-pointer dereferences in xchk_da_btree_block_check_sibling()
        xfs: fix stack contents leakage in the v1 inumber ioctls
      e12b243d
    • L
      Merge branch 'akpm' (patches from Andrew) · b7aea68a
      Linus Torvalds 提交于
      Merge misc fixes from Andrew Morton:
       "17 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        drivers/acpi/scan.c: document why we don't need the device_hotplug_lock
        memremap: move from kernel/ to mm/
        lib/test_meminit.c: use GFP_ATOMIC in RCU critical section
        asm-generic: fix -Wtype-limits compiler warnings
        cgroup: kselftest: relax fs_spec checks
        mm/memory_hotplug.c: remove unneeded return for void function
        mm/migrate.c: initialize pud_entry in migrate_vma()
        coredump: split pipe command whitespace before expanding template
        page flags: prioritize kasan bits over last-cpuid
        ubsan: build ubsan.c more conservatively
        kasan: remove clang version check for KASAN_STACK
        mm: compaction: avoid 100% CPU usage during compaction when a task is killed
        mm: migrate: fix reference check race between __find_get_block() and migration
        mm: vmscan: check if mem cgroup is disabled or not before calling memcg slab shrinker
        ocfs2: remove set but not used variable 'last_hash'
        Revert "kmemleak: allow to coexist with fault injection"
        kernel/signal.c: fix a kernel-doc markup
      b7aea68a
  6. 03 8月, 2019 16 次提交