1. 26 Jul, 2024 4 commits
    • 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 7 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
    • Linus Torvalds's avatar
      hostfs: fix folio conversion · e44be002
      Linus Torvalds authored
      Commit e3ec0fe9 ("hostfs: Convert hostfs_read_folio() to use a
      folio") simplified hostfs_read_folio(), but in the process of converting
      to using folios natively also mis-used the folio_zero_tail() function
      due to the very confusing API of that function.
      
      Very arguably it's folio_zero_tail() API itself that is buggy, since it
      would make more sense (and the documentation kind of implies) that the
      third argument would be the pointer to the beginning of the folio
      buffer.
      
      But no, the third argument to folio_zero_tail() is where we should start
      zeroing the tail (even if we already also pass in the offset separately
      as the second argument).
      
      So fix the hostfs caller, and we can leave any folio_zero_tail() sanity
      cleanup for later.
      Reported-and-tested-by: default avatarMaciej Żenczykowski <maze@google.com>
      Fixes: e3ec0fe9 ("hostfs: Convert hostfs_read_folio() to use a folio")
      Link: https://lore.kernel.org/all/CANP3RGceNzwdb7w=vPf5=7BCid5HVQDmz1K5kC9JG42+HVAh_g@mail.gmail.com/
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Christian Brauner <brauner@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e44be002