1. 05 6月, 2021 1 次提交
  2. 04 6月, 2021 4 次提交
  3. 03 6月, 2021 1 次提交
    • N
      vmlinux.lds.h: Avoid orphan section with !SMP · d4c63999
      Nathan Chancellor 提交于
      With x86_64_defconfig and the following configs, there is an orphan
      section warning:
      
      CONFIG_SMP=n
      CONFIG_AMD_MEM_ENCRYPT=y
      CONFIG_HYPERVISOR_GUEST=y
      CONFIG_KVM=y
      CONFIG_PARAVIRT=y
      
      ld: warning: orphan section `.data..decrypted' from `arch/x86/kernel/cpu/vmware.o' being placed in section `.data..decrypted'
      ld: warning: orphan section `.data..decrypted' from `arch/x86/kernel/kvm.o' being placed in section `.data..decrypted'
      
      These sections are created with DEFINE_PER_CPU_DECRYPTED, which
      ultimately turns into __PCPU_ATTRS, which in turn has a section
      attribute with a value of PER_CPU_BASE_SECTION + the section name. When
      CONFIG_SMP is not set, the base section is .data and that is not
      currently handled in any linker script.
      
      Add .data..decrypted to PERCPU_DECRYPTED_SECTION, which is included in
      PERCPU_INPUT -> PERCPU_SECTION, which is include in the x86 linker
      script when either CONFIG_X86_64 or CONFIG_SMP is unset, taking care of
      the warning.
      
      Fixes: ac26963a ("percpu: Introduce DEFINE_PER_CPU_DECRYPTED")
      Link: https://github.com/ClangBuiltLinux/linux/issues/1360Reported-by: Nkernel test robot <lkp@intel.com>
      Signed-off-by: NNathan Chancellor <nathan@kernel.org>
      Tested-by: Nick Desaulniers <ndesaulniers@google.com> # build
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Link: https://lore.kernel.org/r/20210506001410.1026691-1-nathan@kernel.org
      d4c63999
  4. 02 6月, 2021 3 次提交
    • Y
      net/mlx5: DR, Create multi-destination flow table with level less than 64 · 216214c6
      Yevgeny Kliteynik 提交于
      Flow table that contains flow pointing to multiple flow tables or multiple
      TIRs must have a level lower than 64. In our case it applies to muli-
      destination flow table.
      Fix the level of the created table to comply with HW Spec definitions, and
      still make sure that its level lower than SW-owned tables, so that it
      would be possible to point from the multi-destination FW table to SW
      tables.
      
      Fixes: 34583bee ("net/mlx5: DR, Create multi-destination table for SW-steering use")
      Signed-off-by: NYevgeny Kliteynik <kliteyn@nvidia.com>
      Reviewed-by: NAlex Vesker <valex@nvidia.com>
      Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
      216214c6
    • M
      net/tls: Fix use-after-free after the TLS device goes down and up · c55dcdd4
      Maxim Mikityanskiy 提交于
      When a netdev with active TLS offload goes down, tls_device_down is
      called to stop the offload and tear down the TLS context. However, the
      socket stays alive, and it still points to the TLS context, which is now
      deallocated. If a netdev goes up, while the connection is still active,
      and the data flow resumes after a number of TCP retransmissions, it will
      lead to a use-after-free of the TLS context.
      
      This commit addresses this bug by keeping the context alive until its
      normal destruction, and implements the necessary fallbacks, so that the
      connection can resume in software (non-offloaded) kTLS mode.
      
      On the TX side tls_sw_fallback is used to encrypt all packets. The RX
      side already has all the necessary fallbacks, because receiving
      non-decrypted packets is supported. The thing needed on the RX side is
      to block resync requests, which are normally produced after receiving
      non-decrypted packets.
      
      The necessary synchronization is implemented for a graceful teardown:
      first the fallbacks are deployed, then the driver resources are released
      (it used to be possible to have a tls_dev_resync after tls_dev_del).
      
      A new flag called TLS_RX_DEV_DEGRADED is added to indicate the fallback
      mode. It's used to skip the RX resync logic completely, as it becomes
      useless, and some objects may be released (for example, resync_async,
      which is allocated and freed by the driver).
      
      Fixes: e8f69799 ("net/tls: Add generic NIC offload infrastructure")
      Signed-off-by: NMaxim Mikityanskiy <maximmi@nvidia.com>
      Reviewed-by: NTariq Toukan <tariqt@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c55dcdd4
    • M
      net/tls: Replace TLS_RX_SYNC_RUNNING with RCU · 05fc8b6c
      Maxim Mikityanskiy 提交于
      RCU synchronization is guaranteed to finish in finite time, unlike a
      busy loop that polls a flag. This patch is a preparation for the bugfix
      in the next patch, where the same synchronize_net() call will also be
      used to sync with the TX datapath.
      Signed-off-by: NMaxim Mikityanskiy <maximmi@nvidia.com>
      Reviewed-by: NTariq Toukan <tariqt@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      05fc8b6c
  5. 01 6月, 2021 1 次提交
  6. 27 5月, 2021 4 次提交
  7. 26 5月, 2021 3 次提交
    • T
      SUNRPC: More fixes for backlog congestion · e86be3a0
      Trond Myklebust 提交于
      Ensure that we fix the XPRT_CONGESTED starvation issue for RDMA as well
      as socket based transports.
      Ensure we always initialise the request after waking up from the backlog
      list.
      
      Fixes: e877a88d ("SUNRPC in case of backlog, hand free slots directly to waiting task")
      Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
      e86be3a0
    • J
      PCI/MSI: Fix MSIs for generic hosts that use device-tree's "msi-map" · 85aabbd7
      Jean-Philippe Brucker 提交于
      Since commit 9ec37efb ("PCI/MSI: Make pci_host_common_probe() declare
      its reliance on MSI domains"), platforms that rely on the "msi-map"
      device-tree property don't get MSIs anymore.
      
      On the Arm Fast Model for example [1], the host bridge doesn't have a
      "msi-parent" property since it doesn't itself generate MSIs, and so doesn't
      get a MSI domain. It has an "msi-map" property instead to describe MSI
      controllers of child devices. As a result, due to the new msi_domain check
      in pci_register_host_bridge(), the whole bus gets PCI_BUS_FLAGS_NO_MSI.
      
      Check whether the root complex has an "msi-map" property before giving
      up on MSIs.
      
      [1] arch/arm64/boot/dts/arm/fvp-base-revc.dts
      
      Fixes: 9ec37efb ("PCI/MSI: Make pci_host_common_probe() declare its reliance on MSI domains")
      Link: https://lore.kernel.org/r/20210510173129.750496-1-jean-philippe@linaro.orgSigned-off-by: NJean-Philippe Brucker <jean-philippe@linaro.org>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Acked-by: NMarc Zyngier <maz@kernel.org>
      85aabbd7
    • V
      net: zero-initialize tc skb extension on allocation · 9453d45e
      Vlad Buslov 提交于
      Function skb_ext_add() doesn't initialize created skb extension with any
      value and leaves it up to the user. However, since extension of type
      TC_SKB_EXT originally contained only single value tc_skb_ext->chain its
      users used to just assign the chain value without setting whole extension
      memory to zero first. This assumption changed when TC_SKB_EXT extension was
      extended with additional fields but not all users were updated to
      initialize the new fields which leads to use of uninitialized memory
      afterwards. UBSAN log:
      
      [  778.299821] UBSAN: invalid-load in net/openvswitch/flow.c:899:28
      [  778.301495] load of value 107 is not a valid value for type '_Bool'
      [  778.303215] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.12.0-rc7+ #2
      [  778.304933] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
      [  778.307901] Call Trace:
      [  778.308680]  <IRQ>
      [  778.309358]  dump_stack+0xbb/0x107
      [  778.310307]  ubsan_epilogue+0x5/0x40
      [  778.311167]  __ubsan_handle_load_invalid_value.cold+0x43/0x48
      [  778.312454]  ? memset+0x20/0x40
      [  778.313230]  ovs_flow_key_extract.cold+0xf/0x14 [openvswitch]
      [  778.314532]  ovs_vport_receive+0x19e/0x2e0 [openvswitch]
      [  778.315749]  ? ovs_vport_find_upcall_portid+0x330/0x330 [openvswitch]
      [  778.317188]  ? create_prof_cpu_mask+0x20/0x20
      [  778.318220]  ? arch_stack_walk+0x82/0xf0
      [  778.319153]  ? secondary_startup_64_no_verify+0xb0/0xbb
      [  778.320399]  ? stack_trace_save+0x91/0xc0
      [  778.321362]  ? stack_trace_consume_entry+0x160/0x160
      [  778.322517]  ? lock_release+0x52e/0x760
      [  778.323444]  netdev_frame_hook+0x323/0x610 [openvswitch]
      [  778.324668]  ? ovs_netdev_get_vport+0xe0/0xe0 [openvswitch]
      [  778.325950]  __netif_receive_skb_core+0x771/0x2db0
      [  778.327067]  ? lock_downgrade+0x6e0/0x6f0
      [  778.328021]  ? lock_acquire+0x565/0x720
      [  778.328940]  ? generic_xdp_tx+0x4f0/0x4f0
      [  778.329902]  ? inet_gro_receive+0x2a7/0x10a0
      [  778.330914]  ? lock_downgrade+0x6f0/0x6f0
      [  778.331867]  ? udp4_gro_receive+0x4c4/0x13e0
      [  778.332876]  ? lock_release+0x52e/0x760
      [  778.333808]  ? dev_gro_receive+0xcc8/0x2380
      [  778.334810]  ? lock_downgrade+0x6f0/0x6f0
      [  778.335769]  __netif_receive_skb_list_core+0x295/0x820
      [  778.336955]  ? process_backlog+0x780/0x780
      [  778.337941]  ? mlx5e_rep_tc_netdevice_event_unregister+0x20/0x20 [mlx5_core]
      [  778.339613]  ? seqcount_lockdep_reader_access.constprop.0+0xa7/0xc0
      [  778.341033]  ? kvm_clock_get_cycles+0x14/0x20
      [  778.342072]  netif_receive_skb_list_internal+0x5f5/0xcb0
      [  778.343288]  ? __kasan_kmalloc+0x7a/0x90
      [  778.344234]  ? mlx5e_handle_rx_cqe_mpwrq+0x9e0/0x9e0 [mlx5_core]
      [  778.345676]  ? mlx5e_xmit_xdp_frame_mpwqe+0x14d0/0x14d0 [mlx5_core]
      [  778.347140]  ? __netif_receive_skb_list_core+0x820/0x820
      [  778.348351]  ? mlx5e_post_rx_mpwqes+0xa6/0x25d0 [mlx5_core]
      [  778.349688]  ? napi_gro_flush+0x26c/0x3c0
      [  778.350641]  napi_complete_done+0x188/0x6b0
      [  778.351627]  mlx5e_napi_poll+0x373/0x1b80 [mlx5_core]
      [  778.352853]  __napi_poll+0x9f/0x510
      [  778.353704]  ? mlx5_flow_namespace_set_mode+0x260/0x260 [mlx5_core]
      [  778.355158]  net_rx_action+0x34c/0xa40
      [  778.356060]  ? napi_threaded_poll+0x3d0/0x3d0
      [  778.357083]  ? sched_clock_cpu+0x18/0x190
      [  778.358041]  ? __common_interrupt+0x8e/0x1a0
      [  778.359045]  __do_softirq+0x1ce/0x984
      [  778.359938]  __irq_exit_rcu+0x137/0x1d0
      [  778.360865]  irq_exit_rcu+0xa/0x20
      [  778.361708]  common_interrupt+0x80/0xa0
      [  778.362640]  </IRQ>
      [  778.363212]  asm_common_interrupt+0x1e/0x40
      [  778.364204] RIP: 0010:native_safe_halt+0xe/0x10
      [  778.365273] Code: 4f ff ff ff 4c 89 e7 e8 50 3f 40 fe e9 dc fe ff ff 48 89 df e8 43 3f 40 fe eb 90 cc e9 07 00 00 00 0f 00 2d 74 05 62 00 fb f4 <c3> 90 e9 07 00 00 00 0f 00 2d 64 05 62 00 f4 c3 cc cc 0f 1f 44 00
      [  778.369355] RSP: 0018:ffffffff84407e48 EFLAGS: 00000246
      [  778.370570] RAX: ffff88842de46a80 RBX: ffffffff84425840 RCX: ffffffff83418468
      [  778.372143] RDX: 000000000026f1da RSI: 0000000000000004 RDI: ffffffff8343af5e
      [  778.373722] RBP: fffffbfff0884b08 R08: 0000000000000000 R09: ffff88842de46bcb
      [  778.375292] R10: ffffed1085bc8d79 R11: 0000000000000001 R12: 0000000000000000
      [  778.376860] R13: ffffffff851124a0 R14: 0000000000000000 R15: dffffc0000000000
      [  778.378491]  ? rcu_eqs_enter.constprop.0+0xb8/0xe0
      [  778.379606]  ? default_idle_call+0x5e/0xe0
      [  778.380578]  default_idle+0xa/0x10
      [  778.381406]  default_idle_call+0x96/0xe0
      [  778.382350]  do_idle+0x3d4/0x550
      [  778.383153]  ? arch_cpu_idle_exit+0x40/0x40
      [  778.384143]  cpu_startup_entry+0x19/0x20
      [  778.385078]  start_kernel+0x3c7/0x3e5
      [  778.385978]  secondary_startup_64_no_verify+0xb0/0xbb
      
      Fix the issue by providing new function tc_skb_ext_alloc() that allocates
      tc skb extension and initializes its memory to 0 before returning it to the
      caller. Change all existing users to use new API instead of calling
      skb_ext_add() directly.
      
      Fixes: 038ebb1a ("net/sched: act_ct: fix miss set mru for ovs after defrag in act_ct")
      Fixes: d29334c1 ("net/sched: act_api: fix miss set post_ct for ovs after do conntrack in act_ct")
      Signed-off-by: NVlad Buslov <vladbu@nvidia.com>
      Acked-by: NCong Wang <cong.wang@bytedance.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9453d45e
  8. 25 5月, 2021 3 次提交
  9. 24 5月, 2021 3 次提交
    • P
      netfilter: nf_tables: fix table flag updates · 179d9ba5
      Pablo Neira Ayuso 提交于
      The dormant flag need to be updated from the preparation phase,
      otherwise, two consecutive requests to dorm a table in the same batch
      might try to remove the same hooks twice, resulting in the following
      warning:
      
       hook not found, pf 3 num 0
       WARNING: CPU: 0 PID: 334 at net/netfilter/core.c:480 __nf_unregister_net_hook+0x1eb/0x610 net/netfilter/core.c:480
       Modules linked in:
       CPU: 0 PID: 334 Comm: kworker/u4:5 Not tainted 5.12.0-syzkaller #0
       Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
       Workqueue: netns cleanup_net
       RIP: 0010:__nf_unregister_net_hook+0x1eb/0x610 net/netfilter/core.c:480
      
      This patch is a partial revert of 0ce7cf41 ("netfilter: nftables:
      update table flags from the commit phase") to restore the previous
      behaviour.
      
      However, there is still another problem: A batch containing a series of
      dorm-wakeup-dorm table and vice-versa also trigger the warning above
      since hook unregistration happens from the preparation phase, while hook
      registration occurs from the commit phase.
      
      To fix this problem, this patch adds two internal flags to annotate the
      original dormant flag status which are __NFT_TABLE_F_WAS_DORMANT and
      __NFT_TABLE_F_WAS_AWAKEN, to restore it from the abort path.
      
      The __NFT_TABLE_F_UPDATE bitmask allows to handle the dormant flag update
      with one single transaction.
      
      Reported-by: syzbot+7ad5cd1615f2d89c6e7e@syzkaller.appspotmail.com
      Fixes: 0ce7cf41 ("netfilter: nftables: update table flags from the commit phase")
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      179d9ba5
    • A
      regulator: bd71828: Fix .n_voltages settings · 4c668630
      Axel Lin 提交于
      Current .n_voltages settings do not cover the latest 2 valid selectors,
      so it fails to set voltage for the hightest voltage support.
      The latest linear range has step_uV = 0, so it does not matter if we
      count the .n_voltages to maximum selector + 1 or the first selector of
      latest linear range + 1.
      To simplify calculating the n_voltages, let's just set the
      .n_voltages to maximum selector + 1.
      
      Fixes: 522498f8 ("regulator: bd71828: Basic support for ROHM bd71828 PMIC regulators")
      Signed-off-by: NAxel Lin <axel.lin@ingics.com>
      Reviewed-by: NMatti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
      Link: https://lore.kernel.org/r/20210523071045.2168904-2-axel.lin@ingics.comSigned-off-by: NMark Brown <broonie@kernel.org>
      4c668630
    • A
      regulator: bd70528: Fix off-by-one for buck123 .n_voltages setting · 0514582a
      Axel Lin 提交于
      The valid selectors for bd70528 bucks are 0 ~ 0xf, so the .n_voltages
      should be 16 (0x10). Use 0x10 to make it consistent with BD70528_LDO_VOLTS.
      Also remove redundant defines for BD70528_BUCK_VOLTS.
      Signed-off-by: NAxel Lin <axel.lin@ingics.com>
      Acked-by: NMatti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
      Link: https://lore.kernel.org/r/20210523071045.2168904-1-axel.lin@ingics.comSigned-off-by: NMark Brown <broonie@kernel.org>
      0514582a
  10. 23 5月, 2021 1 次提交
  11. 22 5月, 2021 1 次提交
  12. 20 5月, 2021 1 次提交
  13. 19 5月, 2021 8 次提交
  14. 18 5月, 2021 2 次提交
    • T
      bus: ti-sysc: Fix am335x resume hang for usb otg module · 4d7b324e
      Tony Lindgren 提交于
      On am335x, suspend and resume only works once, and the system hangs if
      suspend is attempted again. However, turns out suspend and resume works
      fine multiple times if the USB OTG driver for musb controller is loaded.
      
      The issue is caused my the interconnect target module losing context
      during suspend, and it needs a restore on resume to be reconfigure again
      as debugged earlier by Dave Gerlach <d-gerlach@ti.com>.
      
      There are also other modules that need a restore on resume, like gpmc as
      noted by Dave. So let's add a common way to restore an interconnect
      target module based on a quirk flag. For now, let's enable the quirk for
      am335x otg only to fix the suspend and resume issue.
      
      As gpmc is not causing hangs based on tests with BeagleBone, let's patch
      gpmc separately. For gpmc, we also need a hardware reset done before
      restore according to Dave.
      
      To reinit the modules, we decouple system suspend from PM runtime. We
      replace calls to pm_runtime_force_suspend() and pm_runtime_force_resume()
      with direct calls to internal functions and rely on the driver internal
      state. There no point trying to handle complex system suspend and resume
      quirks via PM runtime.
      
      This is issue should have already been noticed with commit 1819ef2e
      ("bus: ti-sysc: Use swsup quirks also for am335x musb") when quirk
      handling was added for am335x otg for swsup. But the issue went unnoticed
      as having musb driver loaded hides the issue, and suspend and resume works
      once without the driver loaded.
      
      Fixes: 1819ef2e ("bus: ti-sysc: Use swsup quirks also for am335x musb")
      Suggested-by: NDave Gerlach <d-gerlach@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      4d7b324e
    • D
      NFC: nci: fix memory leak in nci_allocate_device · e0652f8b
      Dongliang Mu 提交于
      nfcmrvl_disconnect fails to free the hci_dev field in struct nci_dev.
      Fix this by freeing hci_dev in nci_free_device.
      
      BUG: memory leak
      unreferenced object 0xffff888111ea6800 (size 1024):
        comm "kworker/1:0", pid 19, jiffies 4294942308 (age 13.580s)
        hex dump (first 32 bytes):
          00 00 00 00 00 00 00 00 00 60 fd 0c 81 88 ff ff  .........`......
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        backtrace:
          [<000000004bc25d43>] kmalloc include/linux/slab.h:552 [inline]
          [<000000004bc25d43>] kzalloc include/linux/slab.h:682 [inline]
          [<000000004bc25d43>] nci_hci_allocate+0x21/0xd0 net/nfc/nci/hci.c:784
          [<00000000c59cff92>] nci_allocate_device net/nfc/nci/core.c:1170 [inline]
          [<00000000c59cff92>] nci_allocate_device+0x10b/0x160 net/nfc/nci/core.c:1132
          [<00000000006e0a8e>] nfcmrvl_nci_register_dev+0x10a/0x1c0 drivers/nfc/nfcmrvl/main.c:153
          [<000000004da1b57e>] nfcmrvl_probe+0x223/0x290 drivers/nfc/nfcmrvl/usb.c:345
          [<00000000d506aed9>] usb_probe_interface+0x177/0x370 drivers/usb/core/driver.c:396
          [<00000000bc632c92>] really_probe+0x159/0x4a0 drivers/base/dd.c:554
          [<00000000f5009125>] driver_probe_device+0x84/0x100 drivers/base/dd.c:740
          [<000000000ce658ca>] __device_attach_driver+0xee/0x110 drivers/base/dd.c:846
          [<000000007067d05f>] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:431
          [<00000000f8e13372>] __device_attach+0x122/0x250 drivers/base/dd.c:914
          [<000000009cf68860>] bus_probe_device+0xc6/0xe0 drivers/base/bus.c:491
          [<00000000359c965a>] device_add+0x5be/0xc30 drivers/base/core.c:3109
          [<00000000086e4bd3>] usb_set_configuration+0x9d9/0xb90 drivers/usb/core/message.c:2164
          [<00000000ca036872>] usb_generic_driver_probe+0x8c/0xc0 drivers/usb/core/generic.c:238
          [<00000000d40d36f6>] usb_probe_device+0x5c/0x140 drivers/usb/core/driver.c:293
          [<00000000bc632c92>] really_probe+0x159/0x4a0 drivers/base/dd.c:554
      
      Reported-by: syzbot+19bcfc64a8df1318d1c3@syzkaller.appspotmail.com
      Fixes: 11f54f22 ("NFC: nci: Add HCI over NCI protocol support")
      Signed-off-by: NDongliang Mu <mudongliangabcd@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e0652f8b
  15. 17 5月, 2021 1 次提交
    • T
      gpu: host1x: Split up client initalization and registration · 0cfe5a6e
      Thierry Reding 提交于
      In some cases we may need to initialize the host1x client first before
      registering it. This commit adds a new helper that will do nothing but
      the initialization of the data structure.
      
      At the same time, the initialization is removed from the registration
      function. Note, however, that for simplicity we explicitly initialize
      the client when the host1x_client_register() function is called, as
      opposed to the low-level __host1x_client_register() function. This
      allows existing callers to remain unchanged.
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      0cfe5a6e
  16. 15 5月, 2021 3 次提交