1. 26 Jul, 2024 5 commits
    • Chris Lu's avatar
      Bluetooth: btmtk: Fix kernel crash when entering btmtk_usb_suspend · d09009bc
      Chris Lu authored
      If MediaTek's Bluetooth setup is unsuccessful, a NULL pointer issue
      occur when the system is suspended and the anchored kill function
      is called. To avoid this, add protection to prevent executing the
      anchored kill function if the setup is unsuccessful.
      
      [    6.922106] Hardware name: Acer Tomato (rev2) board (DT)
      [    6.922114] Workqueue: pm pm_runtime_work
      [    6.922132] pstate: 804000c9
      (Nzcv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
      [    6.922147] pc : usb_kill_anchored_urbs+0x6c/0x1e0
      [    6.922164] lr : usb_kill_anchored_urbs+0x48/0x1e0
      [    6.922181] sp : ffff800080903b60
      [    6.922187] x29: ffff800080903b60
      x28: ffff2c7b85c32b80 x27: ffff2c7bbb370930
      [    6.922211] x26: 00000000000f4240
      x25: 00000000ffffffff x24: ffffd49ece2dcb48
      [    6.922255] x20: ffffffffffffffd8
      x19: 0000000000000000 x18: 0000000000000006
      [    6.922276] x17: 6531656337386238
      x16: 3632373862333863 x15: ffff800080903480
      [    6.922297] x14: 0000000000000000
      x13: 303278302f303178 x12: ffffd49ecf090e30
      [    6.922318] x11: 0000000000000001
      x10: 0000000000000001 x9 : ffffd49ecd2c5bb4
      [    6.922339] x8 : c0000000ffffdfff
      x7 : ffffd49ecefe0db8 x6 : 00000000000affa8
      [    6.922360] x5 : ffff2c7bbb35dd48
      x4 : 0000000000000000 x3 : 0000000000000000
      [    6.922379] x2 : 0000000000000000
      x1 : 0000000000000003 x0 : ffffffffffffffd8
      [    6.922400] Call trace:
      [    6.922405]  usb_kill_anchored_urbs+0x6c/0x1e0
      [    6.922422]  btmtk_usb_suspend+0x20/0x38
      [btmtk 5f200a97badbdfda4266773fee49acfc8e0224d5]
      [    6.922444]  btusb_suspend+0xd0/0x210
      [btusb 0bfbf19a87ff406c83b87268b87ce1e80e9a829b]
      [    6.922469]  usb_suspend_both+0x90/0x288
      [    6.922487]  usb_runtime_suspend+0x3c/0xa8
      [    6.922507]  __rpm_callback+0x50/0x1f0
      [    6.922523]  rpm_callback+0x70/0x88
      [    6.922538]  rpm_suspend+0xe4/0x5a0
      [    6.922553]  pm_runtime_work+0xd4/0xe0
      [    6.922569]  process_one_work+0x18c/0x440
      [    6.922588]  worker_thread+0x314/0x428
      [    6.922606]  kthread+0x128/0x138
      [    6.922621]  ret_from_fork+0x10/0x20
      [    6.922644] Code: f100a274 54000520 d503201f d100a260 (b8370000)
      [    6.922654] ---[ end trace 0000000000000000 ]---
      
      Fixes: ceac1cb0 ("Bluetooth: btusb: mediatek: add ISO data transmission functions")
      Signed-off-by: default avatarChris Lu <chris.lu@mediatek.com>
      Reported-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> #KernelCI
      Tested-by: default avatarNícolas F. R. A. Prado <nfraprado@collabora.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      d09009bc
    • Kiran K's avatar
      Bluetooth: btintel: Fail setup on error · e22a3a9d
      Kiran K authored
      Do not attempt to send any hci command to controller if *setup* function
      fails.
      
      Fixes: af395330 ("Bluetooth: btintel: Add Intel devcoredump support")
      Signed-off-by: default avatarKiran K <kiran.k@intel.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      e22a3a9d
    • Mark Mentovai's avatar
      net: phy: realtek: add support for RTL8366S Gigabit PHY · 225990c4
      Mark Mentovai authored
      The PHY built in to the Realtek RTL8366S switch controller was
      previously supported by genphy_driver. This PHY does not implement MMD
      operations. Since commit 9b01c885 ("net: phy: c22: migrate to
      genphy_c45_write_eee_adv()"), MMD register reads have been made during
      phy_probe to determine EEE support. For genphy_driver, these reads are
      transformed into 802.3 annex 22D clause 45-over-clause 22
      mmd_phy_indirect operations that perform MII register writes to
      MII_MMD_CTRL and MII_MMD_DATA. This overwrites those two MII registers,
      which on this PHY are reserved and have another function, rendering the
      PHY unusable while so configured.
      
      Proper support for this PHY is restored by providing a phy_driver that
      declares MMD operations as unsupported by using the helper functions
      provided for that purpose, while remaining otherwise identical to
      genphy_driver.
      
      Fixes: 9b01c885 ("net: phy: c22: migrate to genphy_c45_write_eee_adv()")
      Reported-by: default avatarRussell Senior <russell@personaltelco.net>
      Closes: https://github.com/openwrt/openwrt/issues/15981
      Link: https://github.com/openwrt/openwrt/issues/15739Signed-off-by: default avatarMark Mentovai <mark@mentovai.com>
      Reviewed-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      225990c4
    • Eric Dumazet's avatar
      sched: act_ct: take care of padding in struct zones_ht_key · 2191a54f
      Eric Dumazet authored
      Blamed commit increased lookup key size from 2 bytes to 16 bytes,
      because zones_ht_key got a struct net pointer.
      
      Make sure rhashtable_lookup() is not using the padding bytes
      which are not initialized.
      
       BUG: KMSAN: uninit-value in rht_ptr_rcu include/linux/rhashtable.h:376 [inline]
       BUG: KMSAN: uninit-value in __rhashtable_lookup include/linux/rhashtable.h:607 [inline]
       BUG: KMSAN: uninit-value in rhashtable_lookup include/linux/rhashtable.h:646 [inline]
       BUG: KMSAN: uninit-value in rhashtable_lookup_fast include/linux/rhashtable.h:672 [inline]
       BUG: KMSAN: uninit-value in tcf_ct_flow_table_get+0x611/0x2260 net/sched/act_ct.c:329
        rht_ptr_rcu include/linux/rhashtable.h:376 [inline]
        __rhashtable_lookup include/linux/rhashtable.h:607 [inline]
        rhashtable_lookup include/linux/rhashtable.h:646 [inline]
        rhashtable_lookup_fast include/linux/rhashtable.h:672 [inline]
        tcf_ct_flow_table_get+0x611/0x2260 net/sched/act_ct.c:329
        tcf_ct_init+0xa67/0x2890 net/sched/act_ct.c:1408
        tcf_action_init_1+0x6cc/0xb30 net/sched/act_api.c:1425
        tcf_action_init+0x458/0xf00 net/sched/act_api.c:1488
        tcf_action_add net/sched/act_api.c:2061 [inline]
        tc_ctl_action+0x4be/0x19d0 net/sched/act_api.c:2118
        rtnetlink_rcv_msg+0x12fc/0x1410 net/core/rtnetlink.c:6647
        netlink_rcv_skb+0x375/0x650 net/netlink/af_netlink.c:2550
        rtnetlink_rcv+0x34/0x40 net/core/rtnetlink.c:6665
        netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline]
        netlink_unicast+0xf52/0x1260 net/netlink/af_netlink.c:1357
        netlink_sendmsg+0x10da/0x11e0 net/netlink/af_netlink.c:1901
        sock_sendmsg_nosec net/socket.c:730 [inline]
        __sock_sendmsg+0x30f/0x380 net/socket.c:745
        ____sys_sendmsg+0x877/0xb60 net/socket.c:2597
        ___sys_sendmsg+0x28d/0x3c0 net/socket.c:2651
        __sys_sendmsg net/socket.c:2680 [inline]
        __do_sys_sendmsg net/socket.c:2689 [inline]
        __se_sys_sendmsg net/socket.c:2687 [inline]
        __x64_sys_sendmsg+0x307/0x4a0 net/socket.c:2687
        x64_sys_call+0x2dd6/0x3c10 arch/x86/include/generated/asm/syscalls_64.h:47
        do_syscall_x64 arch/x86/entry/common.c:52 [inline]
        do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f
      
      Local variable key created at:
        tcf_ct_flow_table_get+0x4a/0x2260 net/sched/act_ct.c:324
        tcf_ct_init+0xa67/0x2890 net/sched/act_ct.c:1408
      
      Fixes: 88c67aeb ("sched: act_ct: add netns into the key of tcf_ct_flow_table")
      Reported-by: syzbot+1b5e4e187cc586d05ea0@syzkaller.appspotmail.com
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Xin Long <lucien.xin@gmail.com>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Reviewed-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2191a54f
    • Ma Ke's avatar
      net: usb: sr9700: fix uninitialized variable use in sr_mdio_read · 08f3a5c3
      Ma Ke authored
      It could lead to error happen because the variable res is not updated if
      the call to sr_share_read_word returns an error. In this particular case
      error code was returned and res stayed uninitialized. Same issue also
      applies to sr_read_reg.
      
      This can be avoided by checking the return value of sr_share_read_word
      and sr_read_reg, and propagating the error if the read operation failed.
      
      Found by code review.
      
      Cc: stable@vger.kernel.org
      Fixes: c9b37458 ("USB2NET : SR9700 : One chip USB 1.1 USB2NET SR9700Device Driver Support")
      Signed-off-by: default avatarMa Ke <make24@iscas.ac.cn>
      Reviewed-by: default avatarShigeru Yoshida <syoshida@redhat.com>
      Reviewed-by: default avatarHariprasad Kelam <hkelam@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      08f3a5c3
  2. 25 Jul, 2024 29 commits
  3. 24 Jul, 2024 6 commits
    • Linus Torvalds's avatar
      Merge tag 'phy-for-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy · c33ffdb7
      Linus Torvalds authored
      Pull phy updates from Vinod Koul:
       "New Support
         - Samsung Exynos gs101 drd combo phy
         - Qualcomm SC8180x USB uniphy, IPQ9574 QMP PCIe phy
         - Airoha EN7581 PCIe phy
         - Freescale i.MX8Q HSIO SerDes phy
         - Starfive jh7110 dphy tx
      
        Updates:
         - Resume support for j721e-wiz driver
         - Updates to Exynos usbdrd driver
         - Support for optional power domains in g12a usb2-phy driver
         - Debugfs support and updates to zynqmp driver"
      
      * tag 'phy-for-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: (56 commits)
        phy: airoha: Add dtime and Rx AEQ IO registers
        dt-bindings: phy: airoha: Add dtime and Rx AEQ IO registers
        dt-bindings: phy: rockchip-emmc-phy: Convert to dtschema
        dt-bindings: phy: qcom,qmp-usb: fix spelling error
        phy: exynos5-usbdrd: support Exynos USBDRD 3.1 combo phy (HS & SS)
        phy: exynos5-usbdrd: convert Vbus supplies to regulator_bulk
        phy: exynos5-usbdrd: convert (phy) register access clock to clk_bulk
        phy: exynos5-usbdrd: convert core clocks to clk_bulk
        phy: exynos5-usbdrd: support isolating HS and SS ports independently
        dt-bindings: phy: samsung,usb3-drd-phy: add gs101 compatible
        phy: core: Fix documentation of of_phy_get
        phy: starfive: Correct the dphy configure process
        phy: zynqmp: Add debugfs support
        phy: zynqmp: Take the phy mutex in xlate
        phy: zynqmp: Only wait for PLL lock "primary" instances
        phy: zynqmp: Store instance instead of type
        phy: zynqmp: Enable reference clock correctly
        phy: cadence-torrent: Check return value on register read
        phy: Fix the cacography in phy-exynos5250-usb2.c
        phy: phy-rockchip-samsung-hdptx: Select CONFIG_MFD_SYSCON
        ...
      c33ffdb7
    • Linus Torvalds's avatar
      Merge tag 'soundwire-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire · ad7b0b7b
      Linus Torvalds authored
      Pull soundwire updates from Vinod Koul:
      
       - Simplification across subsystem using cleanup.h
      
       - Support for debugfs to read/write commands
      
       - Few Intel and Qualcomm driver updates
      
      * tag 'soundwire-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire:
        soundwire: debugfs: simplify with cleanup.h
        soundwire: cadence: simplify with cleanup.h
        soundwire: intel_ace2x: simplify with cleanup.h
        soundwire: intel_ace2x: simplify return path in hw_params
        soundwire: intel: simplify with cleanup.h
        soundwire: intel: simplify return path in hw_params
        soundwire: amd_init: simplify with cleanup.h
        soundwire: amd: simplify with cleanup.h
        soundwire: amd: simplify return path in hw_params
        soundwire: intel_auxdevice: start the bus at default frequency
        soundwire: intel_auxdevice: add cs42l43 codec to wake_capable_list
        drivers:soundwire: qcom: cleanup port maask calculations
        soundwire: bus: simplify by using local slave->prop
        soundwire: generic_bandwidth_allocation: change port_bo parameter to pointer
        soundwire: Intel: clarify Copyright information
        soundwire: intel_ace2.x: add AC timing extensions for PantherLake
        soundwire: bus: add stream refcount
        soundwire: debugfs: add interface to read/write commands
      ad7b0b7b
    • Linus Torvalds's avatar
      Merge tag 'dmaengine-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine · 7a46b17d
      Linus Torvalds authored
      Pull dmaengine updates from Vinod Koul:
       "New support:
      
         - New dmaengine_prep_peripheral_dma_vec() to support transfers using
           dma vectors and documentation and user in AXI dma
      
         - STMicro STM32 DMA3 support and new capabilities of cyclic dma
      
        Updates:
      
         - Yaml conversion for Freescale imx dma and qdma bindings,
           sprd sc9860 dma binding
      
         - Altera msgdma updates for descriptor management"
      
      * tag 'dmaengine-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: (35 commits)
        dt-bindings: fsl-qdma: fix interrupts 'if' check logic
        dt-bindings: dma: sprd,sc9860-dma: convert to YAML
        dmaengine: fsl-dpaa2-qdma: add missing MODULE_DESCRIPTION() macro
        dmaengine: ti: add missing MODULE_DESCRIPTION() macros
        dmaengine: ti: cppi41: add missing MODULE_DESCRIPTION() macro
        dmaengine: virt-dma: add missing MODULE_DESCRIPTION() macro
        dmaengine: ti: k3-udma: Fix BCHAN count with UHC and HC channels
        dmaengine: sh: rz-dmac: Fix lockdep assert warning
        dmaengine: qcom: gpi: clean up the IRQ disable/enable in gpi_reset_chan()
        dmaengine: fsl-edma: change the memory access from local into remote mode in i.MX 8QM
        dmaengine: qcom: gpi: remove unused struct 'reg_info'
        dmaengine: moxart-dma: remove unused struct 'moxart_filter_data'
        dt-bindings: fsl-qdma: Convert to yaml format
        dmaengine: fsl-edma: remove redundant "idle" field from fsl_chan
        dmaengine: fsl-edma: request per-channel IRQ only when channel is allocated
        dmaengine: stm32-dma3: defer channel registration to specify channel name
        dmaengine: add channel device name to channel registration
        dmaengine: stm32-dma3: improve residue granularity
        dmaengine: stm32-dma3: add device_pause and device_resume ops
        dmaengine: stm32-dma3: add DMA_MEMCPY capability
        ...
      7a46b17d
    • Joel Granados's avatar
      sysctl: treewide: constify the ctl_table argument of proc_handlers · 78eb4ea2
      Joel Granados authored
      const qualify the struct ctl_table argument in the proc_handler function
      signatures. This is a prerequisite to moving the static ctl_table
      structs into .rodata data which will ensure that proc_handler function
      pointers cannot be modified.
      
      This patch has been generated by the following coccinelle script:
      
      ```
        virtual patch
      
        @r1@
        identifier ctl, write, buffer, lenp, ppos;
        identifier func !~ "appldata_(timer|interval)_handler|sched_(rt|rr)_handler|rds_tcp_skbuf_handler|proc_sctp_do_(hmac_alg|rto_min|rto_max|udp_port|alpha_beta|auth|probe_interval)";
        @@
      
        int func(
        - struct ctl_table *ctl
        + const struct ctl_table *ctl
          ,int write, void *buffer, size_t *lenp, loff_t *ppos);
      
        @r2@
        identifier func, ctl, write, buffer, lenp, ppos;
        @@
      
        int func(
        - struct ctl_table *ctl
        + const struct ctl_table *ctl
          ,int write, void *buffer, size_t *lenp, loff_t *ppos)
        { ... }
      
        @r3@
        identifier func;
        @@
      
        int func(
        - struct ctl_table *
        + const struct ctl_table *
          ,int , void *, size_t *, loff_t *);
      
        @r4@
        identifier func, ctl;
        @@
      
        int func(
        - struct ctl_table *ctl
        + const struct ctl_table *ctl
          ,int , void *, size_t *, loff_t *);
      
        @r5@
        identifier func, write, buffer, lenp, ppos;
        @@
      
        int func(
        - struct ctl_table *
        + const struct ctl_table *
          ,int write, void *buffer, size_t *lenp, loff_t *ppos);
      
      ```
      
      * Code formatting was adjusted in xfs_sysctl.c to comply with code
        conventions. The xfs_stats_clear_proc_handler,
        xfs_panic_mask_proc_handler and xfs_deprecated_dointvec_minmax where
        adjusted.
      
      * The ctl_table argument in proc_watchdog_common was const qualified.
        This is called from a proc_handler itself and is calling back into
        another proc_handler, making it necessary to change it as part of the
        proc_handler migration.
      Co-developed-by: default avatarThomas Weißschuh <linux@weissschuh.net>
      Signed-off-by: default avatarThomas Weißschuh <linux@weissschuh.net>
      Co-developed-by: default avatarJoel Granados <j.granados@samsung.com>
      Signed-off-by: default avatarJoel Granados <j.granados@samsung.com>
      78eb4ea2
    • Linus Torvalds's avatar
      Merge tag 'random-6.11-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random · 7a3fad30
      Linus Torvalds authored
      Pull random number generator updates from Jason Donenfeld:
       "This adds getrandom() support to the vDSO.
      
        First, it adds a new kind of mapping to mmap(2), MAP_DROPPABLE, which
        lets the kernel zero out pages anytime under memory pressure, which
        enables allocating memory that never gets swapped to disk but also
        doesn't count as being mlocked.
      
        Then, the vDSO implementation of getrandom() is introduced in a
        generic manner and hooked into random.c.
      
        Next, this is implemented on x86. (Also, though it's not ready for
        this pull, somebody has begun an arm64 implementation already)
      
        Finally, two vDSO selftests are added.
      
        There are also two housekeeping cleanup commits"
      
      * tag 'random-6.11-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random:
        MAINTAINERS: add random.h headers to RNG subsection
        random: note that RNDGETPOOL was removed in 2.6.9-rc2
        selftests/vDSO: add tests for vgetrandom
        x86: vdso: Wire up getrandom() vDSO implementation
        random: introduce generic vDSO getrandom() implementation
        mm: add MAP_DROPPABLE for designating always lazily freeable mappings
      7a3fad30
    • Linus Torvalds's avatar
      Merge tag 'vfs-6.11-rc1.fixes.2' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs · d1e9a63d
      Linus Torvalds authored
      Pull vfs fixes from Christian Brauner:
       "VFS:
      
         - The new 64bit mount ids start after the old mount id, i.e., at the
           first non-32 bit value. However, we started counting one id too
           late and thus lost 4294967296 as the first valid id. Fix that.
      
         - Update a few comments on some vfs_*() creation helpers.
      
         - Move copying of the xattr name out from the locks required to start
           a filesystem write.
      
         - Extend the filelock lock UAF fix to the compat code as well.
      
         - Now that we added the ability to look up an inode under RCU it's
           possible that lockless hash lookup can find and lock an inode after
           it gets I_FREEING set. It then waits until inode teardown in
           evict() is finished.
      
           The flag however is still set after evict() has woken up all
           waiters. If the inode lock is taken late enough on the waiting side
           after hash removal and wakeup happened the waiting thread will
           never be woken.
      
           Before RCU based lookup this was synchronized via the
           inode_hash_lock. But since unhashing requires the inode lock as
           well we can check whether the inode is unhashed while holding inode
           lock even without holding inode_hash_lock.
      
        pidfd:
      
         - The nsproxy structure contains nearly all of the namespaces
           associated with a task. When a namespace type isn't supported
           nsproxy might contain a NULL pointer or always point to the initial
           namespace type. The logic isn't consistent. So when deriving
           namespace fds we need to ensure that the namespace type is
           supported.
      
           First, so that we don't risk dereferncing NULL pointers. The
           correct bigger fix would be to change all namespaces to always set
           a valid namespace pointer in struct nsproxy independent of whether
           or not it is compiled in. But that requires quite a few changes.
      
           Second, so that we don't allow deriving namespace fds when the
           namespace type doesn't exist and thus when they couldn't also be
           derived via /proc/self/ns/.
      
         - Add missing selftests for the new pidfd ioctls to derive namespace
           fds. This simply extends the already existing testsuite.
      
        netfs:
      
         - Fix debug logging and fix kconfig variable name so it actually
           works.
      
         - Fix writeback that goes both to the server and cache. The streams
           are only activated once a subreq is added. When a server write
           happens the subreq doesn't need to have finished by the time the
           cache write is started. If the server write has already finished by
           the time the cache write is about to start the cache write will
           operate on a folio that might already have been reused. Fix this by
           preactivating the cache write.
      
         - Limit cachefiles subreq size for cache writes to MAX_RW_COUNT"
      
      * tag 'vfs-6.11-rc1.fixes.2' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
        inode: clarify what's locked
        vfs: Fix potential circular locking through setxattr() and removexattr()
        filelock: Fix fcntl/close race recovery compat path
        fs: use all available ids
        cachefiles: Set the max subreq size for cache writes to MAX_RW_COUNT
        netfs: Fix writeback that needs to go to both server and cache
        pidfs: add selftests for new namespace ioctls
        pidfs: handle kernels without namespaces cleanly
        pidfs: when time ns disabled add check for ioctl
        vfs: correct the comments of vfs_*() helpers
        vfs: handle __wait_on_freeing_inode() and evict() race
        netfs: Rename CONFIG_FSCACHE_DEBUG to CONFIG_NETFS_DEBUG
        netfs: Revert "netfs: Switch debug logging to pr_debug()"
      d1e9a63d