1. 08 12月, 2022 1 次提交
  2. 05 12月, 2022 1 次提交
  3. 03 12月, 2022 2 次提交
    • Z
      Input: raydium_ts_i2c - fix memory leak in raydium_i2c_send() · 8c9a5993
      Zhang Xiaoxu 提交于
      There is a kmemleak when test the raydium_i2c_ts with bpf mock device:
      
        unreferenced object 0xffff88812d3675a0 (size 8):
          comm "python3", pid 349, jiffies 4294741067 (age 95.695s)
          hex dump (first 8 bytes):
            11 0e 10 c0 01 00 04 00                          ........
          backtrace:
            [<0000000068427125>] __kmalloc+0x46/0x1b0
            [<0000000090180f91>] raydium_i2c_send+0xd4/0x2bf [raydium_i2c_ts]
            [<000000006e631aee>] raydium_i2c_initialize.cold+0xbc/0x3e4 [raydium_i2c_ts]
            [<00000000dc6fcf38>] raydium_i2c_probe+0x3cd/0x6bc [raydium_i2c_ts]
            [<00000000a310de16>] i2c_device_probe+0x651/0x680
            [<00000000f5a96bf3>] really_probe+0x17c/0x3f0
            [<00000000096ba499>] __driver_probe_device+0xe3/0x170
            [<00000000c5acb4d9>] driver_probe_device+0x49/0x120
            [<00000000264fe082>] __device_attach_driver+0xf7/0x150
            [<00000000f919423c>] bus_for_each_drv+0x114/0x180
            [<00000000e067feca>] __device_attach+0x1e5/0x2d0
            [<0000000054301fc2>] bus_probe_device+0x126/0x140
            [<00000000aad93b22>] device_add+0x810/0x1130
            [<00000000c086a53f>] i2c_new_client_device+0x352/0x4e0
            [<000000003c2c248c>] of_i2c_register_device+0xf1/0x110
            [<00000000ffec4177>] of_i2c_notify+0x100/0x160
        unreferenced object 0xffff88812d3675c8 (size 8):
          comm "python3", pid 349, jiffies 4294741070 (age 95.692s)
          hex dump (first 8 bytes):
            22 00 36 2d 81 88 ff ff                          ".6-....
          backtrace:
            [<0000000068427125>] __kmalloc+0x46/0x1b0
            [<0000000090180f91>] raydium_i2c_send+0xd4/0x2bf [raydium_i2c_ts]
            [<000000001d5c9620>] raydium_i2c_initialize.cold+0x223/0x3e4 [raydium_i2c_ts]
            [<00000000dc6fcf38>] raydium_i2c_probe+0x3cd/0x6bc [raydium_i2c_ts]
            [<00000000a310de16>] i2c_device_probe+0x651/0x680
            [<00000000f5a96bf3>] really_probe+0x17c/0x3f0
            [<00000000096ba499>] __driver_probe_device+0xe3/0x170
            [<00000000c5acb4d9>] driver_probe_device+0x49/0x120
            [<00000000264fe082>] __device_attach_driver+0xf7/0x150
            [<00000000f919423c>] bus_for_each_drv+0x114/0x180
            [<00000000e067feca>] __device_attach+0x1e5/0x2d0
            [<0000000054301fc2>] bus_probe_device+0x126/0x140
            [<00000000aad93b22>] device_add+0x810/0x1130
            [<00000000c086a53f>] i2c_new_client_device+0x352/0x4e0
            [<000000003c2c248c>] of_i2c_register_device+0xf1/0x110
            [<00000000ffec4177>] of_i2c_notify+0x100/0x160
      
      After BANK_SWITCH command from i2c BUS, no matter success or error
      happened, the tx_buf should be freed.
      
      Fixes: 3b384bd6 ("Input: raydium_ts_i2c - do not split tx transactions")
      Signed-off-by: NZhang Xiaoxu <zhangxiaoxu5@huawei.com>
      Link: https://lore.kernel.org/r/20221202103412.2120169-1-zhangxiaoxu5@huawei.com
      Cc: stable@vger.kernel.org
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      8c9a5993
    • L
      v4l2: don't fall back to follow_pfn() if pin_user_pages_fast() fails · 6647e76a
      Linus Torvalds 提交于
      The V4L2_MEMORY_USERPTR interface is long deprecated and shouldn't be
      used (and is discouraged for any modern v4l drivers).  And Seth Jenkins
      points out that the fallback to VM_PFNMAP/VM_IO is fundamentally racy
      and dangerous.
      
      Note that it's not even a case that should trigger, since any normal
      user pointer logic ends up just using the pin_user_pages_fast() call
      that does the proper page reference counting.  That's not the problem
      case, only if you try to use special device mappings do you have any
      issues.
      
      Normally I'd just remove this during the merge window, but since Seth
      pointed out the problem cases, we really want to know as soon as
      possible if there are actually any users of this odd special case of a
      legacy interface.  Neither Hans nor Mauro seem to think that such
      mis-uses of the old legacy interface should exist.  As Mauro says:
      
       "See, V4L2 has actually 4 streaming APIs:
              - Kernel-allocated mmap (usually referred simply as just mmap);
              - USERPTR mmap;
              - read();
              - dmabuf;
      
        The USERPTR is one of the oldest way to use it, coming from V4L
        version 1 times, and by far the least used one"
      
      And Hans chimed in on the USERPTR interface:
      
       "To be honest, I wouldn't mind if it goes away completely, but that's a
        bit of a pipe dream right now"
      
      but while removing this legacy interface entirely may be a pipe dream we
      can at least try to remove the unlikely (and actively broken) case of
      using special device mappings for USERPTR accesses.
      
      This replaces it with a WARN_ONCE() that we can remove once we've
      hopefully confirmed that no actual users exist.
      
      NOTE! Longer term, this means that a 'struct frame_vector' only ever
      contains proper page pointers, and all the games we have with converting
      them to pages can go away (grep for 'frame_vector_to_pages()' and the
      uses of 'vec->is_pfns').  But this is just the first step, to verify
      that this code really is all dead, and do so as quickly as possible.
      Reported-by: NSeth Jenkins <sethjenkins@google.com>
      Acked-by: NHans Verkuil <hverkuil@xs4all.nl>
      Acked-by: NMauro Carvalho Chehab <mchehab@kernel.org>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: Jan Kara <jack@suse.cz>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6647e76a
  4. 02 12月, 2022 11 次提交
  5. 01 12月, 2022 4 次提交
  6. 30 11月, 2022 5 次提交
    • C
      nvme: fix SRCU protection of nvme_ns_head list · 899d2a05
      Caleb Sander 提交于
      Walking the nvme_ns_head siblings list is protected by the head's srcu
      in nvme_ns_head_submit_bio() but not nvme_mpath_revalidate_paths().
      Removing namespaces from the list also fails to synchronize the srcu.
      Concurrent scan work can therefore cause use-after-frees.
      
      Hold the head's srcu lock in nvme_mpath_revalidate_paths() and
      synchronize with the srcu, not the global RCU, in nvme_ns_remove().
      
      Observed the following panic when making NVMe/RDMA connections
      with native multipath on the Rocky Linux 8.6 kernel
      (it seems the upstream kernel has the same race condition).
      Disassembly shows the faulting instruction is cmp 0x50(%rdx),%rcx;
      computing capacity != get_capacity(ns->disk).
      Address 0x50 is dereferenced because ns->disk is NULL.
      The NULL disk appears to be the result of concurrent scan work
      freeing the namespace (note the log line in the middle of the panic).
      
      [37314.206036] BUG: unable to handle kernel NULL pointer dereference at 0000000000000050
      [37314.206036] nvme0n3: detected capacity change from 0 to 11811160064
      [37314.299753] PGD 0 P4D 0
      [37314.299756] Oops: 0000 [#1] SMP PTI
      [37314.299759] CPU: 29 PID: 322046 Comm: kworker/u98:3 Kdump: loaded Tainted: G        W      X --------- -  - 4.18.0-372.32.1.el8test86.x86_64 #1
      [37314.299762] Hardware name: Dell Inc. PowerEdge R720/0JP31P, BIOS 2.7.0 05/23/2018
      [37314.299763] Workqueue: nvme-wq nvme_scan_work [nvme_core]
      [37314.299783] RIP: 0010:nvme_mpath_revalidate_paths+0x26/0xb0 [nvme_core]
      [37314.299790] Code: 1f 44 00 00 66 66 66 66 90 55 53 48 8b 5f 50 48 8b 83 c8 c9 00 00 48 8b 13 48 8b 48 50 48 39 d3 74 20 48 8d 42 d0 48 8b 50 20 <48> 3b 4a 50 74 05 f0 80 60 70 ef 48 8b 50 30 48 8d 42 d0 48 39 d3
      [37315.058803] RSP: 0018:ffffabe28f913d10 EFLAGS: 00010202
      [37315.121316] RAX: ffff927a077da800 RBX: ffff92991dd70000 RCX: 0000000001600000
      [37315.206704] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff92991b719800
      [37315.292106] RBP: ffff929a6b70c000 R08: 000000010234cd4a R09: c0000000ffff7fff
      [37315.377501] R10: 0000000000000001 R11: ffffabe28f913a30 R12: 0000000000000000
      [37315.462889] R13: ffff92992716600c R14: ffff929964e6e030 R15: ffff92991dd70000
      [37315.548286] FS:  0000000000000000(0000) GS:ffff92b87fb80000(0000) knlGS:0000000000000000
      [37315.645111] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [37315.713871] CR2: 0000000000000050 CR3: 0000002208810006 CR4: 00000000000606e0
      [37315.799267] Call Trace:
      [37315.828515]  nvme_update_ns_info+0x1ac/0x250 [nvme_core]
      [37315.892075]  nvme_validate_or_alloc_ns+0x2ff/0xa00 [nvme_core]
      [37315.961871]  ? __blk_mq_free_request+0x6b/0x90
      [37316.015021]  nvme_scan_work+0x151/0x240 [nvme_core]
      [37316.073371]  process_one_work+0x1a7/0x360
      [37316.121318]  ? create_worker+0x1a0/0x1a0
      [37316.168227]  worker_thread+0x30/0x390
      [37316.212024]  ? create_worker+0x1a0/0x1a0
      [37316.258939]  kthread+0x10a/0x120
      [37316.297557]  ? set_kthread_struct+0x50/0x50
      [37316.347590]  ret_from_fork+0x35/0x40
      [37316.390360] Modules linked in: nvme_rdma nvme_tcp(X) nvme_fabrics nvme_core netconsole iscsi_tcp libiscsi_tcp dm_queue_length dm_service_time nf_conntrack_netlink br_netfilter bridge stp llc overlay nft_chain_nat ipt_MASQUERADE nf_nat xt_addrtype xt_CT nft_counter xt_state xt_conntrack nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 xt_comment xt_multiport nft_compat nf_tables libcrc32c nfnetlink dm_multipath tg3 rpcrdma sunrpc rdma_ucm ib_srpt ib_isert iscsi_target_mod target_core_mod ib_iser libiscsi scsi_transport_iscsi ib_umad rdma_cm ib_ipoib iw_cm ib_cm intel_rapl_msr iTCO_wdt iTCO_vendor_support dcdbas intel_rapl_common sb_edac x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel ipmi_ssif kvm irqbypass crct10dif_pclmul crc32_pclmul mlx5_ib ghash_clmulni_intel ib_uverbs rapl intel_cstate intel_uncore ib_core ipmi_si joydev mei_me pcspkr ipmi_devintf mei lpc_ich wmi ipmi_msghandler acpi_power_meter ext4 mbcache jbd2 sd_mod t10_pi sg mgag200 mlx5_core drm_kms_helper syscopyarea
      [37316.390419]  sysfillrect ahci sysimgblt fb_sys_fops libahci drm crc32c_intel libata mlxfw pci_hyperv_intf tls i2c_algo_bit psample dm_mirror dm_region_hash dm_log dm_mod fuse [last unloaded: nvme_core]
      [37317.645908] CR2: 0000000000000050
      
      Fixes: e7d65803 ("nvme-multipath: revalidate paths during rescan")
      Signed-off-by: NCaleb Sander <csander@purestorage.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      899d2a05
    • L
      nvme-pci: clear the prp2 field when not used · a56ea614
      Lei Rao 提交于
      If the prp2 field is not filled in nvme_setup_prp_simple(), the prp2
      field is garbage data. According to nvme spec, the prp2 is reserved if
      the data transfer does not cross a memory page boundary, so clear it to
      zero if it is not used.
      Signed-off-by: NLei Rao <lei.rao@intel.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      a56ea614
    • Y
      net: ethernet: renesas: ravb: Fix promiscuous mode after system resumed · d66233a3
      Yoshihiro Shimoda 提交于
      After system resumed on some environment board, the promiscuous mode
      is disabled because the SoC turned off. So, call ravb_set_rx_mode() in
      the ravb_resume() to fix the issue.
      Reported-by: NTho Vu <tho.vu.wh@renesas.com>
      Fixes: 0184165b ("ravb: add sleep PM suspend/resume support")
      Signed-off-by: NYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Reviewed-by: NPavan Chebbi <pavan.chebbi@broadcom.com>
      Reviewed-by: NSergey Shtylyov <s.shtylyov@omp.ru>
      Link: https://lore.kernel.org/r/20221128065604.1864391-1-yoshihiro.shimoda.uh@renesas.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      d66233a3
    • C
      net/mlx5: Lag, Fix for loop when checking lag · 0e682f04
      Chris Mi 提交于
      The cited commit adds a for loop to check if each port supports lag
      or not. But dev is not initialized correctly. Fix it by initializing
      dev for each iteration.
      
      Fixes: e87c6a83 ("net/mlx5: E-switch, Fix duplicate lag creation")
      Signed-off-by: NChris Mi <cmi@nvidia.com>
      Reported-by: NJacob Keller <jacob.e.keller@intel.com>
      Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
      Link: https://lore.kernel.org/r/20221129093006.378840-2-saeed@kernel.orgSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      0e682f04
    • S
      Revert "net/mlx5e: MACsec, remove replay window size limitation in offload path" · dda3bbbb
      Saeed Mahameed 提交于
      This reverts commit c0071be0.
      
      The cited commit removed the validity checks which initialized the
      window_sz and never removed the use of the now uninitialized variable,
      so now we are left with wrong value in the window size and the following
      clang warning: [-Wuninitialized]
      drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c:232:45:
             warning: variable 'window_sz' is uninitialized when used here
             MLX5_SET(macsec_aso, aso_ctx, window_size, window_sz);
      
      Revet at this time to address the clang issue due to lack of time to
      test the proper solution.
      
      Fixes: c0071be0 ("net/mlx5e: MACsec, remove replay window size limitation in offload path")
      Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
      Reported-by: NJacob Keller <jacob.e.keller@intel.com>
      Link: https://lore.kernel.org/r/20221129093006.378840-1-saeed@kernel.orgSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      dda3bbbb
  7. 29 11月, 2022 11 次提交
  8. 28 11月, 2022 5 次提交