1. 25 May, 2023 19 commits
    • Linus Torvalds's avatar
      Merge tag 'net-6.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 50fb587e
      Linus Torvalds authored
      Pull networking fixes from Paolo Abeni:
       "Including fixes from bluetooth and bpf.
      
        Current release - regressions:
      
         - net: fix skb leak in __skb_tstamp_tx()
      
         - eth: mtk_eth_soc: fix QoS on DSA MAC on non MTK_NETSYS_V2 SoCs
      
        Current release - new code bugs:
      
         - handshake:
            - fix sock->file allocation
            - fix handshake_dup() ref counting
      
         - bluetooth:
            - fix potential double free caused by hci_conn_unlink
            - fix UAF in hci_conn_hash_flush
      
        Previous releases - regressions:
      
         - core: fix stack overflow when LRO is disabled for virtual
           interfaces
      
         - tls: fix strparser rx issues
      
         - bpf:
            - fix many sockmap/TCP related issues
            - fix a memory leak in the LRU and LRU_PERCPU hash maps
            - init the offload table earlier
      
         - eth: mlx5e:
            - do as little as possible in napi poll when budget is 0
            - fix using eswitch mapping in nic mode
            - fix deadlock in tc route query code
      
        Previous releases - always broken:
      
         - udplite: fix NULL pointer dereference in __sk_mem_raise_allocated()
      
         - raw: fix output xfrm lookup wrt protocol
      
         - smc: reset connection when trying to use SMCRv2 fails
      
         - phy: mscc: enable VSC8501/2 RGMII RX clock
      
         - eth: octeontx2-pf: fix TSOv6 offload
      
         - eth: cdc_ncm: deal with too low values of dwNtbOutMaxSize"
      
      * tag 'net-6.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (79 commits)
        udplite: Fix NULL pointer dereference in __sk_mem_raise_allocated().
        net: phy: mscc: enable VSC8501/2 RGMII RX clock
        net: phy: mscc: remove unnecessary phydev locking
        net: phy: mscc: add support for VSC8501
        net: phy: mscc: add VSC8502 to MODULE_DEVICE_TABLE
        net/handshake: Enable the SNI extension to work properly
        net/handshake: Unpin sock->file if a handshake is cancelled
        net/handshake: handshake_genl_notify() shouldn't ignore @flags
        net/handshake: Fix uninitialized local variable
        net/handshake: Fix handshake_dup() ref counting
        net/handshake: Remove unneeded check from handshake_dup()
        ipv6: Fix out-of-bounds access in ipv6_find_tlv()
        net: ethernet: mtk_eth_soc: fix QoS on DSA MAC on non MTK_NETSYS_V2 SoCs
        docs: netdev: document the existence of the mail bot
        net: fix skb leak in __skb_tstamp_tx()
        r8169: Use a raw_spinlock_t for the register locks.
        page_pool: fix inconsistency for page_pool_ring_[un]lock()
        bpf, sockmap: Test progs verifier error with latest clang
        bpf, sockmap: Test FIONREAD returns correct bytes in rx buffer with drops
        bpf, sockmap: Test FIONREAD returns correct bytes in rx buffer
        ...
      50fb587e
    • Linus Torvalds's avatar
      Merge tag 'for-v6.4-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply · eb03e318
      Linus Torvalds authored
      Pull power supply fixes from Sebastian Reichel:
      
       - Fix power_supply_get_battery_info for devices without parent devices
         resulting in NULL pointer dereference
      
       - Fix desktop systems reporting to run on battery once a power-supply
         device with device scope appears (e.g. a HID keyboard with a battery)
      
       - Ratelimit debug print about driver not providing data
      
       - Fix race condition related to external_power_changed in multiple
         drivers (ab8500, axp288, bq25890, sc27xx, bq27xxx)
      
       - Fix LED trigger switching from blinking to solid-on when charging
         finishes
      
       - Fix multiple races in bq27xxx battery driver
      
       - mt6360: handle potential ENOMEM from devm_work_autocancel
      
       - sbs-charger: Fix SBS_CHARGER_STATUS_CHARGE_INHIBITED bit
      
       - rt9467: avoid passing 0 to dev_err_probe
      
      * tag 'for-v6.4-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (21 commits)
        power: supply: Fix logic checking if system is running from battery
        power: supply: mt6360: add a check of devm_work_autocancel in mt6360_charger_probe
        power: supply: sbs-charger: Fix INHIBITED bit for Status reg
        power: supply: rt9467: Fix passing zero to 'dev_err_probe'
        power: supply: Ratelimit no data debug output
        power: supply: Fix power_supply_get_battery_info() if parent is NULL
        power: supply: bq24190: Call power_supply_changed() after updating input current
        power: supply: bq25890: Call power_supply_changed() after updating input current or voltage
        power: supply: bq27xxx: Use mod_delayed_work() instead of cancel() + schedule()
        power: supply: bq27xxx: After charger plug in/out wait 0.5s for things to stabilize
        power: supply: bq27xxx: Ensure power_supply_changed() is called on current sign changes
        power: supply: bq27xxx: Move bq27xxx_battery_update() down
        power: supply: bq27xxx: Add cache parameter to bq27xxx_battery_current_and_status()
        power: supply: bq27xxx: Fix poll_interval handling and races on remove
        power: supply: bq27xxx: Fix I2C IRQ race on remove
        power: supply: bq27xxx: Fix bq27xxx_battery_update() race condition
        power: supply: leds: Fix blink to LED on transition
        power: supply: sc27xx: Fix external_power_changed race
        power: supply: bq25890: Fix external_power_changed race
        power: supply: axp288_fuel_gauge: Fix external_power_changed race
        ...
      eb03e318
    • Linus Torvalds's avatar
      Merge tag 'sound-6.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 029c77f8
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "A collection of small fixes:
      
         - HD-audio runtime PM bug fix
      
         - A couple of HD-audio quirks
      
         - Fix series of ASoC Intel AVS drivers
      
         - ASoC DPCM fix for a bug found on new Intel systems
      
         - A few other ASoC device-specific small fixes"
      
      * tag 'sound-6.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: hda/realtek: Enable headset onLenovo M70/M90
        ASoC: dwc: move DMA init to snd_soc_dai_driver probe()
        ASoC: cs35l41: Fix default regmap values for some registers
        ALSA: hda: Fix unhandled register update during auto-suspend period
        ASoC: dt-bindings: tlv320aic32x4: Fix supply names
        ASoC: Intel: avs: Add missing checks on FE startup
        ASoC: Intel: avs: Fix avs_path_module::instance_id size
        ASoC: Intel: avs: Account for UID of ACPI device
        ASoC: Intel: avs: Fix declaration of enum avs_channel_config
        ASoC: Intel: Skylake: Fix declaration of enum skl_ch_cfg
        ASoC: Intel: avs: Access path components under lock
        ASoC: Intel: avs: Fix module lookup
        ALSA: hda/ca0132: add quirk for EVGA X299 DARK
        ASoC: soc-pcm: test if a BE can be prepared
        ASoC: rt5682: Disable jack detection interrupt during suspend
        ASoC: lpass: Fix for KASAN use_after_free out of bounds
      029c77f8
    • Linus Torvalds's avatar
      Merge tag 'platform-drivers-x86-v6.4-3' of... · ecea3ba2
      Linus Torvalds authored
      Merge tag 'platform-drivers-x86-v6.4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
      
      Pull x86 platform driver fixes from Hans de Goede:
       "Nothing special to report just a few small fixes"
      
      * tag 'platform-drivers-x86-v6.4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
        platform/x86/intel/ifs: Annotate work queue on stack so object debug does not complain
        platform/x86: ISST: Remove 8 socket limit
        platform/mellanox: mlxbf-pmc: fix sscanf() error checking
        platform/x86/amd/pmf: Fix CnQF and auto-mode after resume
        platform/x86: asus-wmi: Ignore WMI events with codes 0x7B, 0xC0
      ecea3ba2
    • Linus Torvalds's avatar
      Merge tag 'm68k-for-v6.4-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k · 5566051f
      Linus Torvalds authored
      Pull m68k fix from Geert Uytterhoeven:
      
       - Fix signal frame issue causing user-space crashes on 68020/68030
      
      * tag 'm68k-for-v6.4-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k:
        m68k: Move signal frame following exception on 68020/030
      5566051f
    • Kuniyuki Iwashima's avatar
      udplite: Fix NULL pointer dereference in __sk_mem_raise_allocated(). · ad42a35b
      Kuniyuki Iwashima authored
      syzbot reported [0] a null-ptr-deref in sk_get_rmem0() while using
      IPPROTO_UDPLITE (0x88):
      
        14:25:52 executing program 1:
        r0 = socket$inet6(0xa, 0x80002, 0x88)
      
      We had a similar report [1] for probably sk_memory_allocated_add()
      in __sk_mem_raise_allocated(), and commit c915fe13 ("udplite: fix
      NULL pointer dereference") fixed it by setting .memory_allocated for
      udplite_prot and udplitev6_prot.
      
      To fix the variant, we need to set either .sysctl_wmem_offset or
      .sysctl_rmem.
      
      Now UDP and UDPLITE share the same value for .memory_allocated, so we
      use the same .sysctl_wmem_offset for UDP and UDPLITE.
      
      [0]:
      general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
      KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
      CPU: 0 PID: 6829 Comm: syz-executor.1 Not tainted 6.4.0-rc2-syzkaller #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023
      RIP: 0010:sk_get_rmem0 include/net/sock.h:2907 [inline]
      RIP: 0010:__sk_mem_raise_allocated+0x806/0x17a0 net/core/sock.c:3006
      Code: c1 ea 03 80 3c 02 00 0f 85 23 0f 00 00 48 8b 44 24 08 48 8b 98 38 01 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 da 48 c1 ea 03 <0f> b6 14 02 48 89 d8 83 e0 07 83 c0 03 38 d0 0f 8d 6f 0a 00 00 8b
      RSP: 0018:ffffc90005d7f450 EFLAGS: 00010246
      RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffc90004d92000
      RDX: 0000000000000000 RSI: ffffffff88066482 RDI: ffffffff8e2ccbb8
      RBP: ffff8880173f7000 R08: 0000000000000005 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000030000
      R13: 0000000000000001 R14: 0000000000000340 R15: 0000000000000001
      FS:  0000000000000000(0000) GS:ffff8880b9800000(0063) knlGS:00000000f7f1cb40
      CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
      CR2: 000000002e82f000 CR3: 0000000034ff0000 CR4: 00000000003506f0
      Call Trace:
       <TASK>
       __sk_mem_schedule+0x6c/0xe0 net/core/sock.c:3077
       udp_rmem_schedule net/ipv4/udp.c:1539 [inline]
       __udp_enqueue_schedule_skb+0x776/0xb30 net/ipv4/udp.c:1581
       __udpv6_queue_rcv_skb net/ipv6/udp.c:666 [inline]
       udpv6_queue_rcv_one_skb+0xc39/0x16c0 net/ipv6/udp.c:775
       udpv6_queue_rcv_skb+0x194/0xa10 net/ipv6/udp.c:793
       __udp6_lib_mcast_deliver net/ipv6/udp.c:906 [inline]
       __udp6_lib_rcv+0x1bda/0x2bd0 net/ipv6/udp.c:1013
       ip6_protocol_deliver_rcu+0x2e7/0x1250 net/ipv6/ip6_input.c:437
       ip6_input_finish+0x150/0x2f0 net/ipv6/ip6_input.c:482
       NF_HOOK include/linux/netfilter.h:303 [inline]
       NF_HOOK include/linux/netfilter.h:297 [inline]
       ip6_input+0xa0/0xd0 net/ipv6/ip6_input.c:491
       ip6_mc_input+0x40b/0xf50 net/ipv6/ip6_input.c:585
       dst_input include/net/dst.h:468 [inline]
       ip6_rcv_finish net/ipv6/ip6_input.c:79 [inline]
       NF_HOOK include/linux/netfilter.h:303 [inline]
       NF_HOOK include/linux/netfilter.h:297 [inline]
       ipv6_rcv+0x250/0x380 net/ipv6/ip6_input.c:309
       __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5491
       __netif_receive_skb+0x1f/0x1c0 net/core/dev.c:5605
       netif_receive_skb_internal net/core/dev.c:5691 [inline]
       netif_receive_skb+0x133/0x7a0 net/core/dev.c:5750
       tun_rx_batched+0x4b3/0x7a0 drivers/net/tun.c:1553
       tun_get_user+0x2452/0x39c0 drivers/net/tun.c:1989
       tun_chr_write_iter+0xdf/0x200 drivers/net/tun.c:2035
       call_write_iter include/linux/fs.h:1868 [inline]
       new_sync_write fs/read_write.c:491 [inline]
       vfs_write+0x945/0xd50 fs/read_write.c:584
       ksys_write+0x12b/0x250 fs/read_write.c:637
       do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline]
       __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178
       do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203
       entry_SYSENTER_compat_after_hwframe+0x70/0x82
      RIP: 0023:0xf7f21579
      Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00
      RSP: 002b:00000000f7f1c590 EFLAGS: 00000282 ORIG_RAX: 0000000000000004
      RAX: ffffffffffffffda RBX: 00000000000000c8 RCX: 0000000020000040
      RDX: 0000000000000083 RSI: 00000000f734e000 RDI: 0000000000000000
      RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000296 R12: 0000000000000000
      R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
       </TASK>
      Modules linked in:
      
      Link: https://lore.kernel.org/netdev/CANaxB-yCk8hhP68L4Q2nFOJht8sqgXGGQO2AftpHs0u1xyGG5A@mail.gmail.com/ [1]
      Fixes: 850cbadd ("udp: use it's own memory accounting schema")
      Reported-by: syzbot+444ca0907e96f7c5e48b@syzkaller.appspotmail.com
      Closes: https://syzkaller.appspot.com/bug?extid=444ca0907e96f7c5e48bSigned-off-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
      Link: https://lore.kernel.org/r/20230523163305.66466-1-kuniyu@amazon.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      ad42a35b
    • Jakub Kicinski's avatar
      Merge branch 'net-phy-mscc-support-vsc8501' · aa015a20
      Jakub Kicinski authored
      David Epping says:
      
      ====================
      net: phy: mscc: support VSC8501
      
      this updated series of patches adds support for the VSC8501 Ethernet
      PHY and fixes support for the VSC8502 PHY in cases where no other
      software (like U-Boot) has initialized the PHY after power up.
      
      The first patch simply adds the VSC8502 to the MODULE_DEVICE_TABLE,
      where I guess it was unintentionally missing. I have no hardware to
      test my change.
      
      The second patch adds the VSC8501 PHY with exactly the same driver
      implementation as the existing VSC8502.
      
      The (new) third patch removes phydev locking from
      vsc85xx_rgmii_set_skews(), as discussed for v2 of the patch set.
      
      The (now) fourth patch fixes the initialization for VSC8501 and VSC8502.
      I have tested this patch with VSC8501 on hardware in RGMII mode only.
      https://ww1.microchip.com/downloads/aemDocuments/documents/UNG/ProductDocuments/DataSheets/VSC8501-03_Datasheet_60001741A.PDF
      https://ww1.microchip.com/downloads/aemDocuments/documents/UNG/ProductDocuments/DataSheets/VSC8502-03_Datasheet_60001742B.pdf
      Table 4-42 "RGMII CONTROL, ADDRESS 20E2 (0X14)" Bit 11 for each of
      them.
      By default the RX_CLK is disabled for these PHYs. In cases where no
      other software, like U-Boot, enabled the clock, this results in no
      received packets being handed to the MAC.
      The patch enables this clock output.
      According to Microchip support (case number 01268776) this applies
      to all modes (RGMII, GMII, and MII).
      
      Other PHYs sharing the same register map and code, like
      VSC8530/31/40/41 have the clock enabled and the relevant bit 11 is
      reserved and read-only for them. As per previous discussion the
      patch still clears the bit on these PHYs, too, possibly more easily
      supporting other future PHYs implementing this functionality.
      
      For the VSC8572 family of PHYs, having a different register map,
      no such changes are applied.
      ====================
      
      Link: https://lore.kernel.org/r/20230523153108.18548-1-david.epping@missinglinkelectronics.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      aa015a20
    • David Epping's avatar
      net: phy: mscc: enable VSC8501/2 RGMII RX clock · 71460c9e
      David Epping authored
      By default the VSC8501 and VSC8502 RGMII/GMII/MII RX_CLK output is
      disabled. To allow packet forwarding towards the MAC it needs to be
      enabled.
      
      For other PHYs supported by this driver the clock output is enabled
      by default.
      
      Fixes: d3169863 ("net: phy: mscc: add support for VSC8502")
      Signed-off-by: default avatarDavid Epping <david.epping@missinglinkelectronics.com>
      Reviewed-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Reviewed-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      71460c9e
    • David Epping's avatar
      net: phy: mscc: remove unnecessary phydev locking · 7df0b33d
      David Epping authored
      Holding the struct phy_device (phydev) lock is unnecessary when
      accessing phydev->interface in the PHY driver .config_init method,
      which is the only place that vsc85xx_rgmii_set_skews() is called from.
      
      The phy_modify_paged() function implements required MDIO bus level
      locking, which can not be achieved by a phydev lock.
      Signed-off-by: default avatarDavid Epping <david.epping@missinglinkelectronics.com>
      Reviewed-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      7df0b33d
    • David Epping's avatar
      net: phy: mscc: add support for VSC8501 · fb055ce4
      David Epping authored
      The VSC8501 PHY can use the same driver implementation as the VSC8502.
      Adding the PHY ID and copying the handler functions of VSC8502 is
      sufficient to operate it.
      Signed-off-by: default avatarDavid Epping <david.epping@missinglinkelectronics.com>
      Reviewed-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      fb055ce4
    • David Epping's avatar
      net: phy: mscc: add VSC8502 to MODULE_DEVICE_TABLE · 57fb54ab
      David Epping authored
      The mscc driver implements support for VSC8502, so its ID should be in
      the MODULE_DEVICE_TABLE for automatic loading.
      Signed-off-by: default avatarDavid Epping <david.epping@missinglinkelectronics.com>
      Fixes: d3169863 ("net: phy: mscc: add support for VSC8502")
      Reviewed-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      57fb54ab
    • Jakub Kicinski's avatar
      Merge branch 'bug-fixes-for-net-handshake' · 1de5900c
      Jakub Kicinski authored
      Chuck Lever says:
      
      ====================
      Bug fixes for net/handshake
      
      Paolo observed that there is a possible leak of sock->file. I
      haven't looked into that yet, but it seems to be separate from
      the fixes in this series, so no need to hold these up.
      ====================
      
      The submissions mentions net-next but it means netdev (perhaps
      merge window left over when trees are converged). In any case,
      it should have gone into net, but was instead applied to net-next
      as commit deb2e484 ("Merge branch 'net-handshake-fixes'").
      These are fixes tho, and Chuck needs them to make progress with
      the client so double-merging them into net... it is what it is :(
      
      Link: https://lore.kernel.org/r/168381978252.84244.1933636428135211300.stgit@91.116.238.104.host.secureserver.netSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      1de5900c
    • Chuck Lever's avatar
      net/handshake: Enable the SNI extension to work properly · 26fb5480
      Chuck Lever authored
      Enable the upper layer protocol to specify the SNI peername. This
      avoids the need for tlshd to use a DNS lookup, which can return a
      hostname that doesn't match the incoming certificate's SubjectName.
      
      Fixes: 2fd55320 ("net/handshake: Add a kernel API for requesting a TLSv1.3 handshake")
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      26fb5480
    • Chuck Lever's avatar
      net/handshake: Unpin sock->file if a handshake is cancelled · 1ce77c99
      Chuck Lever authored
      If user space never calls DONE, sock->file's reference count remains
      elevated. Enable sock->file to be freed eventually in this case.
      Reported-by: default avatarJakub Kacinski <kuba@kernel.org>
      Fixes: 3b3009ea ("net/handshake: Create a NETLINK service for handling handshake requests")
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      1ce77c99
    • Chuck Lever's avatar
      net/handshake: handshake_genl_notify() shouldn't ignore @flags · fc490880
      Chuck Lever authored
      Reported-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
      Fixes: 3b3009ea ("net/handshake: Create a NETLINK service for handling handshake requests")
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      fc490880
    • Chuck Lever's avatar
      net/handshake: Fix uninitialized local variable · 7afc6d0a
      Chuck Lever authored
      trace_handshake_cmd_done_err() simply records the pointer in @req,
      so initializing it to NULL is sufficient and safe.
      Reported-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
      Fixes: 3b3009ea ("net/handshake: Create a NETLINK service for handling handshake requests")
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      7afc6d0a
    • Chuck Lever's avatar
      net/handshake: Fix handshake_dup() ref counting · 7ea9c1ec
      Chuck Lever authored
      If get_unused_fd_flags() fails, we ended up calling fput(sock->file)
      twice.
      Reported-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
      Suggested-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Fixes: 3b3009ea ("net/handshake: Create a NETLINK service for handling handshake requests")
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      7ea9c1ec
    • Chuck Lever's avatar
      net/handshake: Remove unneeded check from handshake_dup() · a095326e
      Chuck Lever authored
      handshake_req_submit() now verifies that the socket has a file.
      
      Fixes: 3b3009ea ("net/handshake: Create a NETLINK service for handling handshake requests")
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a095326e
    • Jakub Kicinski's avatar
      Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · 0c615f1c
      Jakub Kicinski authored
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf 2023-05-24
      
      We've added 19 non-merge commits during the last 10 day(s) which contain
      a total of 20 files changed, 738 insertions(+), 448 deletions(-).
      
      The main changes are:
      
      1) Batch of BPF sockmap fixes found when running against NGINX TCP tests,
         from John Fastabend.
      
      2) Fix a memleak in the LRU{,_PERCPU} hash map when bucket locking fails,
         from Anton Protopopov.
      
      3) Init the BPF offload table earlier than just late_initcall,
         from Jakub Kicinski.
      
      4) Fix ctx access mask generation for 32-bit narrow loads of 64-bit fields,
         from Will Deacon.
      
      5) Remove a now unsupported __fallthrough in BPF samples,
         from Andrii Nakryiko.
      
      6) Fix a typo in pkg-config call for building sign-file,
         from Jeremy Sowden.
      
      * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf:
        bpf, sockmap: Test progs verifier error with latest clang
        bpf, sockmap: Test FIONREAD returns correct bytes in rx buffer with drops
        bpf, sockmap: Test FIONREAD returns correct bytes in rx buffer
        bpf, sockmap: Test shutdown() correctly exits epoll and recv()=0
        bpf, sockmap: Build helper to create connected socket pair
        bpf, sockmap: Pull socket helpers out of listen test for general use
        bpf, sockmap: Incorrectly handling copied_seq
        bpf, sockmap: Wake up polling after data copy
        bpf, sockmap: TCP data stall on recv before accept
        bpf, sockmap: Handle fin correctly
        bpf, sockmap: Improved check for empty queue
        bpf, sockmap: Reschedule is now done through backlog
        bpf, sockmap: Convert schedule_work into delayed_work
        bpf, sockmap: Pass skb ownership through read_skb
        bpf: fix a memory leak in the LRU and LRU_PERCPU hash maps
        bpf: Fix mask generation for 32-bit narrow loads of 64-bit fields
        samples/bpf: Drop unnecessary fallthrough
        bpf: netdev: init the offload table earlier
        selftests/bpf: Fix pkg-config call building sign-file
      ====================
      
      Link: https://lore.kernel.org/r/20230524170839.13905-1-daniel@iogearbox.netSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      0c615f1c
  2. 24 May, 2023 13 commits
  3. 23 May, 2023 8 commits
    • Peter Ujfalusi's avatar
      tpm: tpm_tis: Disable interrupts for AEON UPX-i11 · 95a9359e
      Peter Ujfalusi authored
      Interrupts got recently enabled for tpm_tis.
      
      The interrupts initially works on the device but they will stop arriving
      after circa ~200 interrupts. On system reboot/shutdown this will cause a
      long wait (120000 jiffies).
      
      [jarkko@kernel.org: fix a merge conflict and adjust the commit message]
      Fixes: e644b2f4 ("tpm, tpm_tis: Enable interrupt test")
      Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
      Reviewed-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
      Signed-off-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
      95a9359e
    • Linus Torvalds's avatar
      Merge tag 'xtensa-20230523' of https://github.com/jcmvbkbc/linux-xtensa · 27e462c8
      Linus Torvalds authored
      Pull Xtensa fixes from Max Filippov:
      
       - fix signal delivery to FDPIC process
      
       - add __bswap{si,di}2 helpers
      
      * tag 'xtensa-20230523' of https://github.com/jcmvbkbc/linux-xtensa:
        xtensa: add __bswap{si,di}2 helpers
        xtensa: fix signal delivery to FDPIC process
      27e462c8
    • Maxim Kochetkov's avatar
      ASoC: dwc: move DMA init to snd_soc_dai_driver probe() · 011a8719
      Maxim Kochetkov authored
      When using DMA mode we are facing with Oops:
      [  396.458157] Unable to handle kernel access to user memory without uaccess routines at virtual address 000000000000000c
      [  396.469374] Oops [#1]
      [  396.471839] Modules linked in:
      [  396.475144] CPU: 0 PID: 114 Comm: arecord Not tainted 6.0.0-00164-g9a8eccdaf2be-dirty #68
      [  396.483619] Hardware name: YMP ELCT FPGA (DT)
      [  396.488156] epc : dmaengine_pcm_open+0x1d2/0x342
      [  396.493227]  ra : dmaengine_pcm_open+0x1d2/0x342
      [  396.498140] epc : ffffffff807fe346 ra : ffffffff807fe346 sp : ffffffc804e138f0
      [  396.505602]  gp : ffffffff817bf730 tp : ffffffd8042c8ac0 t0 : 6500000000000000
      [  396.513045]  t1 : 0000000000000064 t2 : 656e69676e65616d s0 : ffffffc804e13990
      [  396.520477]  s1 : ffffffd801b86a18 a0 : 0000000000000026 a1 : ffffffff816920f8
      [  396.527897]  a2 : 0000000000000010 a3 : fffffffffffffffe a4 : 0000000000000000
      [  396.535319]  a5 : 0000000000000000 a6 : ffffffd801b87040 a7 : 0000000000000038
      [  396.542740]  s2 : ffffffd801b94a00 s3 : 0000000000000000 s4 : ffffffd80427f5e8
      [  396.550153]  s5 : ffffffd80427f5e8 s6 : ffffffd801b44410 s7 : fffffffffffffff5
      [  396.557569]  s8 : 0000000000000800 s9 : 0000000000000001 s10: ffffffff8066d254
      [  396.564978]  s11: ffffffd8059cf768 t3 : ffffffff817d5577 t4 : ffffffff817d5577
      [  396.572391]  t5 : ffffffff817d5578 t6 : ffffffc804e136e8
      [  396.577876] status: 0000000200000120 badaddr: 000000000000000c cause: 000000000000000d
      [  396.586007] [<ffffffff806839f4>] snd_soc_component_open+0x1a/0x68
      [  396.592439] [<ffffffff807fdd62>] __soc_pcm_open+0xf0/0x502
      [  396.598217] [<ffffffff80685d86>] soc_pcm_open+0x2e/0x4e
      [  396.603741] [<ffffffff8066cea4>] snd_pcm_open_substream+0x442/0x68e
      [  396.610313] [<ffffffff8066d1ea>] snd_pcm_open+0xfa/0x212
      [  396.615868] [<ffffffff8066d39c>] snd_pcm_capture_open+0x3a/0x60
      [  396.622048] [<ffffffff8065b35a>] snd_open+0xa8/0x17a
      [  396.627421] [<ffffffff801ae036>] chrdev_open+0xa0/0x218
      [  396.632893] [<ffffffff801a5a28>] do_dentry_open+0x17c/0x2a6
      [  396.638713] [<ffffffff801a6d9a>] vfs_open+0x1e/0x26
      [  396.643850] [<ffffffff801b8544>] path_openat+0x96e/0xc96
      [  396.649518] [<ffffffff801b9390>] do_filp_open+0x7c/0xf6
      [  396.655034] [<ffffffff801a6ff2>] do_sys_openat2+0x8a/0x11e
      [  396.660765] [<ffffffff801a735a>] sys_openat+0x50/0x7c
      [  396.666068] [<ffffffff80003aca>] ret_from_syscall+0x0/0x2
      [  396.674964] ---[ end trace 0000000000000000 ]---
      
      It happens because of play_dma_data/capture_dma_data pointers are NULL.
      Current implementation assigns these pointers at snd_soc_dai_driver
      startup() callback and reset them back to NULL at shutdown(). But
      soc_pcm_open() sequence uses DMA pointers in dmaengine_pcm_open()
      before snd_soc_dai_driver startup().
      Most generic DMA capable I2S drivers use snd_soc_dai_driver probe()
      callback to init DMA pointers only once at probe. So move DMA init
      to dw_i2s_dai_probe and drop shutdown() and startup() callbacks.
      Signed-off-by: default avatarMaxim Kochetkov <fido_max@inbox.ru>
      Link: https://lore.kernel.org/r/20230512110343.66664-1-fido_max@inbox.ruSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      011a8719
    • Stefan Binding's avatar
    • Linus Torvalds's avatar
      Merge tag 'erofs-for-6.4-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs · 5fe326b4
      Linus Torvalds authored
      Pull erofs fixes from Gao Xiang:
       "One patch addresses a null-ptr-deref issue reported by syzbot weeks
        ago, which is caused by the new long xattr name prefix feature and
        needs to be fixed.
      
        The remaining two patches are minor cleanups to avoid unnecessary
        compilation and adjust per-cpu kworker configuration.
      
        Summary:
      
         - Fix null-ptr-deref related to long xattr name prefixes
      
         - Avoid pcpubuf compilation if CONFIG_EROFS_FS_ZIP is off
      
         - Use high priority kthreads by default if per-cpu kthread workers
           are enabled"
      
      * tag 'erofs-for-6.4-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs:
        erofs: use HIPRI by default if per-cpu kthreads are enabled
        erofs: avoid pcpubuf.c inclusion if CONFIG_EROFS_FS_ZIP is off
        erofs: fix null-ptr-deref caused by erofs_xattr_prefixes_init
      5fe326b4
    • John Fastabend's avatar
      bpf, sockmap: Test progs verifier error with latest clang · f726e035
      John Fastabend authored
      With a relatively recent clang (7090c10273119) and with this commit
      to fix warnings in selftests (c8ed6685) that uses __sink(err)
      to resolve unused variables. We get the following verifier error.
      
      root@6e731a24b33a:/host/tools/testing/selftests/bpf# ./test_sockmap
      libbpf: prog 'bpf_sockmap': BPF program load failed: Permission denied
      libbpf: prog 'bpf_sockmap': -- BEGIN PROG LOAD LOG --
      0: R1=ctx(off=0,imm=0) R10=fp0
      ; op = (int) skops->op;
      0: (61) r2 = *(u32 *)(r1 +0)          ; R1=ctx(off=0,imm=0) R2_w=scalar(umax=4294967295,var_off=(0x0; 0xffffffff))
      ; switch (op) {
      1: (16) if w2 == 0x4 goto pc+5        ; R2_w=scalar(umax=4294967295,var_off=(0x0; 0xffffffff))
      2: (56) if w2 != 0x5 goto pc+15       ; R2_w=5
      ; lport = skops->local_port;
      3: (61) r2 = *(u32 *)(r1 +68)         ; R1=ctx(off=0,imm=0) R2_w=scalar(umax=4294967295,var_off=(0x0; 0xffffffff))
      ; if (lport == 10000) {
      4: (56) if w2 != 0x2710 goto pc+13 18: R1=ctx(off=0,imm=0) R2=scalar(umax=4294967295,var_off=(0x0; 0xffffffff)) R10=fp0
      ; __sink(err);
      18: (bc) w1 = w0
      R0 !read_ok
      processed 18 insns (limit 1000000) max_states_per_insn 0 total_states 2 peak_states 2 mark_read 1
      -- END PROG LOAD LOG --
      libbpf: prog 'bpf_sockmap': failed to load: -13
      libbpf: failed to load object 'test_sockmap_kern.bpf.o'
      load_bpf_file: (-1) No such file or directory
      ERROR: (-1) load bpf failed
      libbpf: prog 'bpf_sockmap': BPF program load failed: Permission denied
      libbpf: prog 'bpf_sockmap': -- BEGIN PROG LOAD LOG --
      0: R1=ctx(off=0,imm=0) R10=fp0
      ; op = (int) skops->op;
      0: (61) r2 = *(u32 *)(r1 +0)          ; R1=ctx(off=0,imm=0) R2_w=scalar(umax=4294967295,var_off=(0x0; 0xffffffff))
      ; switch (op) {
      1: (16) if w2 == 0x4 goto pc+5        ; R2_w=scalar(umax=4294967295,var_off=(0x0; 0xffffffff))
      2: (56) if w2 != 0x5 goto pc+15       ; R2_w=5
      ; lport = skops->local_port;
      3: (61) r2 = *(u32 *)(r1 +68)         ; R1=ctx(off=0,imm=0) R2_w=scalar(umax=4294967295,var_off=(0x0; 0xffffffff))
      ; if (lport == 10000) {
      4: (56) if w2 != 0x2710 goto pc+13 18: R1=ctx(off=0,imm=0) R2=scalar(umax=4294967295,var_off=(0x0; 0xffffffff)) R10=fp0
      ; __sink(err);
      18: (bc) w1 = w0
      R0 !read_ok
      processed 18 insns (limit 1000000) max_states_per_insn 0 total_states 2 peak_states 2 mark_read 1
      -- END PROG LOAD LOG --
      libbpf: prog 'bpf_sockmap': failed to load: -13
      libbpf: failed to load object 'test_sockhash_kern.bpf.o'
      load_bpf_file: (-1) No such file or directory
      ERROR: (-1) load bpf failed
      libbpf: prog 'bpf_sockmap': BPF program load failed: Permission denied
      libbpf: prog 'bpf_sockmap': -- BEGIN PROG LOAD LOG --
      0: R1=ctx(off=0,imm=0) R10=fp0
      ; op = (int) skops->op;
      0: (61) r2 = *(u32 *)(r1 +0)          ; R1=ctx(off=0,imm=0) R2_w=scalar(umax=4294967295,var_off=(0x0; 0xffffffff))
      ; switch (op) {
      1: (16) if w2 == 0x4 goto pc+5        ; R2_w=scalar(umax=4294967295,var_off=(0x0; 0xffffffff))
      2: (56) if w2 != 0x5 goto pc+15       ; R2_w=5
      ; lport = skops->local_port;
      3: (61) r2 = *(u32 *)(r1 +68)         ; R1=ctx(off=0,imm=0) R2_w=scalar(umax=4294967295,var_off=(0x0; 0xffffffff))
      ; if (lport == 10000) {
      4: (56) if w2 != 0x2710 goto pc+13 18: R1=ctx(off=0,imm=0) R2=scalar(umax=4294967295,var_off=(0x0; 0xffffffff)) R10=fp0
      ; __sink(err);
      18: (bc) w1 = w0
      R0 !read_ok
      processed 18 insns (limit 1000000) max_states_per_insn 0 total_states 2 peak_states 2 mark_read 1
      -- END PROG LOAD LOG --
      
      To fix simply remove the err value because its not actually used anywhere
      in the testing. We can investigate the root cause later. Future patch should
      probably actually test the err value as well. Although if the map updates
      fail they will get caught eventually by userspace.
      
      Fixes: c8ed6685 ("selftests/bpf: fix lots of silly mistakes pointed out by compiler")
      Signed-off-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Reviewed-by: default avatarJakub Sitnicki <jakub@cloudflare.com>
      Link: https://lore.kernel.org/bpf/20230523025618.113937-15-john.fastabend@gmail.com
      f726e035
    • John Fastabend's avatar
      bpf, sockmap: Test FIONREAD returns correct bytes in rx buffer with drops · 80e24d22
      John Fastabend authored
      When BPF program drops pkts the sockmap logic 'eats' the packet and
      updates copied_seq. In the PASS case where the sk_buff is accepted
      we update copied_seq from recvmsg path so we need a new test to
      handle the drop case.
      
      Original patch series broke this resulting in
      
      test_sockmap_skb_verdict_fionread:PASS:ioctl(FIONREAD) error 0 nsec
      test_sockmap_skb_verdict_fionread:FAIL:ioctl(FIONREAD) unexpected ioctl(FIONREAD): actual 1503041772 != expected 256
      
      After updated patch with fix.
      Signed-off-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Reviewed-by: default avatarJakub Sitnicki <jakub@cloudflare.com>
      Link: https://lore.kernel.org/bpf/20230523025618.113937-14-john.fastabend@gmail.com
      80e24d22
    • John Fastabend's avatar
      bpf, sockmap: Test FIONREAD returns correct bytes in rx buffer · bb516f98
      John Fastabend authored
      A bug was reported where ioctl(FIONREAD) returned zero even though the
      socket with a SK_SKB verdict program attached had bytes in the msg
      queue. The result is programs may hang or more likely try to recover,
      but use suboptimal buffer sizes.
      
      Add a test to check that ioctl(FIONREAD) returns the correct number of
      bytes.
      Signed-off-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Reviewed-by: default avatarJakub Sitnicki <jakub@cloudflare.com>
      Link: https://lore.kernel.org/bpf/20230523025618.113937-13-john.fastabend@gmail.com
      bb516f98