]> git.ipfire.org Git - thirdparty/kernel/linux.git/log
thirdparty/kernel/linux.git
12 days agoselftests: mptcp: always check sent/dropped ADD_ADDRs
Matthieu Baerts (NGI0) [Fri, 5 Jun 2026 09:21:52 +0000 (19:21 +1000)] 
selftests: mptcp: always check sent/dropped ADD_ADDRs

Before, they were only checked on demand, but it seems better to check
them each time received ADD_ADDRs are checked.

Errors are only reported when the counter exists, and the value is not
the expected one. This is similar to what is done in chk_join_nr: it
reduces the output, and avoids a lot of 'skip' when validating older
kernels. Also here, some tests need to adapt the default expected
counters, e.g. when ADD_ADDR echo are dropped on the reception side, or
it is not possible to send an ADD_ADDR due to the limited option space.

Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20260605-net-next-mptcp-add-addr6-port-ts-v2-8-758e7ca73f4d@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 days agoselftests: mptcp: validate ADD_ADDRv6 + TS + port
Matthieu Baerts (NGI0) [Fri, 5 Jun 2026 09:21:51 +0000 (19:21 +1000)] 
selftests: mptcp: validate ADD_ADDRv6 + TS + port

This validates the feature added by parent commit, where it is now
possible to send an ADD_ADDR with a v6 IP address and a port number,
while the connection is using TCP Timestamps.

This test is simply a copy of the previous one: "signal address with
port", but using IPv6 addresses. This test is only executed if the
add_addr_v6_port_drop_ts sysctl knob is available. If not, it means the
kernel doesn't support this feature.

Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20260605-net-next-mptcp-add-addr6-port-ts-v2-7-758e7ca73f4d@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 days agomptcp: pm: drop TCP TS with ADD_ADDRv6 + port
Matthieu Baerts (NGI0) [Fri, 5 Jun 2026 09:21:50 +0000 (19:21 +1000)] 
mptcp: pm: drop TCP TS with ADD_ADDRv6 + port

With TCP-timestamps (padded) taking 12 bytes and ADD_ADDR IPv6 + port
taking 30 bytes, the 40-byte limit for the TCP options is reached. In
this case, it is then not possible to send the signal.

To be able to send this ADD_ADDR, the TCP timestamps option can now be
dropped. This is done, when needed by setting the *drop_ts parameter
from mptcp_established_options. This feature is controlled by a new
net.mptcp.add_addr_v6_port_drop_ts sysctl knob, enabled by default.

It is important to keep in mind that dropping the TCP timestamps option
for one packet of the connection could eventually disrupt some
middleboxes: even if it should be unlikely, they could drop the packet
or even block the connection. That's why this new feature can be
controlled by a sysctl knob.

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/448
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20260605-net-next-mptcp-add-addr6-port-ts-v2-6-758e7ca73f4d@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 days agotcp: allow mptcp to drop TS for some packets
Matthieu Baerts (NGI0) [Fri, 5 Jun 2026 09:21:49 +0000 (19:21 +1000)] 
tcp: allow mptcp to drop TS for some packets

With TCP-timestamps (padded) taking 12 bytes and ADD_ADDR IPv6 + port
taking 30 bytes, the 40-byte limit for the TCP options is reached. In
this case, it is then not possible to send the address signal.

The idea is to let MPTCP dropping the TCP-timestamps option for some
specific packets, to be able to send some specific pure ACK carrying >28
bytes of MPTCP options, like with this specific ADD_ADDR. A new
parameter is passed from tcp_established_options to the MPTCP side to
indicate if the TCP TS option is used, and if it should be dropped. The
next commit implements the part on MPTCP side, but split into two
patches to help TCP maintainers to identify the modifications on TCP
side. This feature will be controlled by a new add_addr_v6_port_drop_ts
MPTCP sysctl knob.

It is important to keep in mind that dropping the TCP timestamps option
for one packet of the connection could eventually disrupt some
middleboxes: even if it should be unlikely, they could drop the packet
or even block the connection. That's why this new feature will be
controlled by a sysctl knob.

Note that it would be technically possible to squeeze both options into
the header if the ADD_ADDR is first written, and then the TCP timestamps
without the NOPs preceding it. But this means more modifications on TCP
side, plus some middleboxes could still be disrupted by that.

In this implementation, an unused bit is used in mptcp_out_options
structure to avoid passing an address to a local variable. Reading and
setting it needs CONFIG_MPTCP, so the whole block now has this #if
condition: mptcp_established_options() is then no longer used without
CONFIG_MPTCP.

About alternatives, instead of passing a new boolean (has_ts), another
option would be to pass the whole option structure (opts), but
'struct tcp_out_options' is currently defined in tcp_output.c, and it
would need to be exported. Plus that means the removal of the TCP TS
option would be done on the MPTCP side, and not here on the TCP side.
It feels clearer to remove other TCP options from the TCP side, than
hiding that from the MPTCP side.

Yet an other alternative would be to pass the size already taken by the
other TCP options, and have a way to drop them all when needed. But this
feels better to target only the timestamps option where dropping it
should be safe, even if it is currently the only option that would be
set before MPTCP, when MPTCP is used.

Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260605-net-next-mptcp-add-addr6-port-ts-v2-5-758e7ca73f4d@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 days agomptcp: introduce add_addr_v6_port_drop_ts sysctl knob
Matthieu Baerts (NGI0) [Fri, 5 Jun 2026 09:21:48 +0000 (19:21 +1000)] 
mptcp: introduce add_addr_v6_port_drop_ts sysctl knob

This sysctl is going to be used in the next commits to drop TCP
timestamps option, to be able to send an ADD_ADDR with a v6 IP address
and a port number. It is enabled by default.

This knob is explicitly disabled in the MPTCP Join selftest, with the
"signal addr list progresses after tx drop" subtest, to continue
verifying the previous behaviour where the ADD_ADDR is not sent due to a
lack of space.

While at it, move syn_retrans_before_tcp_fallback down from struct
mptcp_pernet, to avoid creating another 3 bytes hole.

Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20260605-net-next-mptcp-add-addr6-port-ts-v2-4-758e7ca73f4d@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 days agomptcp: pm: avoid computing add_addr size twice
Matthieu Baerts (NGI0) [Fri, 5 Jun 2026 09:21:47 +0000 (19:21 +1000)] 
mptcp: pm: avoid computing add_addr size twice

mptcp_add_addr_len helper was called twice: in mptcp_pm_add_addr_signal,
then just after in mptcp_established_options_add_addr. Both to check
the remaining space.

The second call is not needed: if there is not enough space,
mptcp_pm_add_addr_signal will return false, and the caller,
mptcp_established_options_add_addr, will do the same without re-checking
the size again. Instead, mptcp_pm_add_addr_signal can directly set the
size.

Note that the returned size can be negative when other suboptions are
dropped, e.g. to send an echo ADD_ADDR with a v4 address, and no port.

While at it:

 - move mptcp_add_addr_len to pm.c, as it is now only used from there

 - use 'int' in mptcp_add_addr_len for the size, instead of having a mix

 - use a bool for 'ret' in mptcp_pm_add_addr_signal

Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20260605-net-next-mptcp-add-addr6-port-ts-v2-3-758e7ca73f4d@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 days agomptcp: pm: avoid computing rm_addr size twice
Matthieu Baerts (NGI0) [Fri, 5 Jun 2026 09:21:46 +0000 (19:21 +1000)] 
mptcp: pm: avoid computing rm_addr size twice

mptcp_rm_addr_len helper was called twice: in mptcp_pm_rm_addr_signal,
then just after in mptcp_established_options_rm_addr. Both to check the
remaining space.

The second call is not needed: if there is not enough space,
mptcp_pm_rm_addr_signal will return false, and the caller,
mptcp_established_options_rm_addr, will do the same without re-checking
the size again. Instead, mptcp_pm_rm_addr_signal can directly set the
size.

While at it, move mptcp_rm_addr_len to pm.c, as it is now only used
there, once.

Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20260605-net-next-mptcp-add-addr6-port-ts-v2-2-758e7ca73f4d@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 days agomptcp: options: suboptions sizes can be negative
Matthieu Baerts (NGI0) [Fri, 5 Jun 2026 09:21:45 +0000 (19:21 +1000)] 
mptcp: options: suboptions sizes can be negative

Use a signed int for the returned size, because when other options are
dropped, the size can be negative, e.g. to send an echo ADD_ADDR with a
v4 address, and no port.

The behaviour is not changed, because it was working as expected with an
overflow. But it is clearer like this, and it will help later on.

Even if, for the moment, only the ADD_ADDR size can be negative in some
cases, a signed int is now used for all mptcp_established_options_*()
helpers, not to mismatch the type, and as a question of uniformity.

Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20260605-net-next-mptcp-add-addr6-port-ts-v2-1-758e7ca73f4d@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 days agoMerge branch 'ipq5018-add-and-enable-gephy-rx-and-tx-clocks'
Jakub Kicinski [Thu, 11 Jun 2026 22:31:23 +0000 (15:31 -0700)] 
Merge branch 'ipq5018-add-and-enable-gephy-rx-and-tx-clocks'

George Moussalem says:

====================
IPQ5018: Add and enable GEPHY RX and TX clocks

This patch series addresses a missing hardware description issue for
the Qualcomm IPQ5018 Internal Ethernet PHY, where the data paths fail
to function correctly unless their dedicated RX and TX clocks are
explicitly enabled.

Further testing revealed that leaving these clocks unmanaged by the
kernel, they were inadvertently left enabled by the bootloader / QSDK
platform, which masked the issue. Testing a fresh network configuration
path exposed that the data link fails to work without explicit software
gating.

To correctly introduce the required multi-clock properties, the IPQ5018
binding definition must first be split away from the shared
qca,ar803x.yaml schema. This isolation is required because ar803x
references the generic ethernet-phy.yaml, which enforces a strict
single-clock limit constraint.

- Patch 1: Moves the clocks property and its restriction out of the
   generic ethernet-phy.yaml schema to individual bindings files
   that need it to allow for PHYs that require multiple clocks.
- Patch 2: Add clocks property to qca,ar803x.yaml for the IPQ5018 PHY.
- Patch 3: Updates the Qualcomm AT803x PHY driver framework to acquire,
   enable, and gate these clocks upon link state changes for
   runtime power optimization.
====================

Link: https://patch.msgid.link/20260608-ipq5018-gephy-clocks-v4-0-fb2ccd56894b@outlook.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 days agonet: phy: at803x: add RX and TX clock management for IPQ5018 PHY
George Moussalem [Mon, 8 Jun 2026 05:09:19 +0000 (09:09 +0400)] 
net: phy: at803x: add RX and TX clock management for IPQ5018 PHY

Acquire and enable the RX and TX clocks for the IPQ5018 PHY.
These clocks are required for the PHY's datapath to function correctly.

Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Link: https://patch.msgid.link/20260608-ipq5018-gephy-clocks-v4-4-fb2ccd56894b@outlook.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 days agodt-bindings: net: qca,ar803x: Add clocks for IPQ5018 PHY
George Moussalem [Mon, 8 Jun 2026 05:09:17 +0000 (09:09 +0400)] 
dt-bindings: net: qca,ar803x: Add clocks for IPQ5018 PHY

Further testing revealed that the RX and TX clocks of the IPQ5018 PHY
need to be explicitly enabled. As such, add the required clocks to the
schema.

Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Link: https://patch.msgid.link/20260608-ipq5018-gephy-clocks-v4-2-fb2ccd56894b@outlook.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 days agodt-bindings: net: ethernet-phy: increase max clock count to two
George Moussalem [Mon, 8 Jun 2026 05:09:16 +0000 (09:09 +0400)] 
dt-bindings: net: ethernet-phy: increase max clock count to two

The clocks property has a restriction to maximum one.
Yet, some PHYs may require more than 1 clock such as the IPQ5018 PHY
which requires two clocks for RX and TX. As such, increase maxItems to
two.

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Link: https://patch.msgid.link/20260608-ipq5018-gephy-clocks-v4-1-fb2ccd56894b@outlook.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 days ago6lowpan: fix NHC entry use-after-free on error path
Yizhou Zhao [Tue, 9 Jun 2026 08:00:52 +0000 (16:00 +0800)] 
6lowpan: fix NHC entry use-after-free on error path

lowpan_nhc_do_uncompression() looks up an NHC descriptor while holding
lowpan_nhc_lock.  If the descriptor has no uncompress callback, the error
path drops the lock before printing nhc->name.

lowpan_nhc_del() removes descriptors under the same lock and then relies
on synchronize_net() before the owning module can be unloaded.  That only
waits for net RX RCU readers.  lowpan_header_decompress() is also exported
and can be reached from callers that are not necessarily covered by the net
core RX critical section, for example the Bluetooth 6LoWPAN L2CAP receive
path.

This leaves a race where one task drops lowpan_nhc_lock in the error path,
another task unregisters and frees the matching descriptor after
synchronize_net() returns, and the first task then dereferences nhc->name
for the warning.

With the post-unlock window widened, KASAN reports:

  BUG: KASAN: slab-use-after-free in lowpan_nhc_do_uncompression+0x1f4/0x220
  Read of size 8
  lowpan_nhc_do_uncompression
  lowpan_header_decompress

Fix this by printing the warning before dropping lowpan_nhc_lock, so the
descriptor name is read while unregister is still excluded.  The malformed
packet is still rejected with -ENOTSUPP.

Fixes: 92aa7c65d295 ("6lowpan: add generic nhc layer interface")
Cc: stable@vger.kernel.org
Reported-by: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
Reported-by: Yuxiang Yang <yangyx22@mails.tsinghua.edu.cn>
Reported-by: Ao Wang <wangao@seu.edu.cn>
Reported-by: Xuewei Feng <fengxw06@126.com>
Reported-by: Qi Li <qli01@tsinghua.edu.cn>
Reported-by: Ke Xu <xuke@tsinghua.edu.cn>
Signed-off-by: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
Acked-by: Alexander Aring <aahringo@redhat.com>
Link: https://patch.msgid.link/20260609080054.4541-1-zhaoyz24@mails.tsinghua.edu.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 days agonet: fec: remove reference to nonexistent CONFIG_GILBARCONAP option
Ethan Nelson-Moore [Tue, 9 Jun 2026 04:52:00 +0000 (21:52 -0700)] 
net: fec: remove reference to nonexistent CONFIG_GILBARCONAP option

The CONFIG_GILBARCONAP option has never been defined by the kernel, but
is referred to by drivers/net/ethernet/freescale/fec_main.c. Remove this
reference to eliminate dead code.

Discovered while searching for CONFIG_* symbols referenced in code but
not defined in any Kconfig file.

Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
Reviewed-by: Wei Fang <wei.fang@nxp.com>
Link: https://patch.msgid.link/20260609045200.32606-1-enelsonmoore@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 days agonet: pfcp: allocate per-cpu tstats for PFCP netdevs
Samuel Moelius [Tue, 9 Jun 2026 23:22:45 +0000 (23:22 +0000)] 
net: pfcp: allocate per-cpu tstats for PFCP netdevs

PFCP uses dev_get_tstats64() as its ndo_get_stats64 callback, but
pfcp_link_setup() does not request NETDEV_PCPU_STAT_TSTATS.  The net
core therefore leaves dev->tstats NULL for PFCP devices.

Creating a PFCP rtnetlink device can immediately ask the new netdev for
stats while building the RTM_NEWLINK notification.  That reaches
dev_get_tstats64() and dereferences the NULL dev->tstats pointer.

Set pcpu_stat_type to NETDEV_PCPU_STAT_TSTATS during PFCP link setup so
the net core allocates the storage expected by dev_get_tstats64().

Fixes: 76c8764ef36a ("pfcp: add PFCP module")
Signed-off-by: Samuel Moelius <sam.moelius@trailofbits.com>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Link: https://patch.msgid.link/20260609232244.1602027.c569f6c530f6.pfcp-missing-tstats-link-create-oops@trailofbits.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 days agosctp: validate embedded address parameter length
Xin Long [Tue, 9 Jun 2026 22:14:28 +0000 (18:14 -0400)] 
sctp: validate embedded address parameter length

sctp_verify_asconf() and sctp_verify_param() only validate ADD_IP, DEL_IP,
and SET_PRIMARY parameters against a fixed minimum size of sizeof(struct
sctp_addip_param) + sizeof(struct sctp_paramhdr). This ensures the outer
parameter is large enough to contain an embedded address parameter header,
but does not verify that the embedded address parameter's declared length
fits within the bounds of the outer parameter.

Later, sctp_process_param() and sctp_process_asconf_param() extract the
embedded address parameter and pass it to af->from_addr_param(), which uses
the address parameter length to parse the variable-length address payload.
A malformed peer can therefore advertise an embedded address parameter
length that exceeds the remaining bytes in the enclosing parameter.

Validate that addr_param->p.length does not exceed the space available
after the sctp_addip_param header before processing the embedded address
parameter. Reject malformed parameters when the embedded address length
extends beyond the enclosing parameter bounds.

This prevents out-of-bounds reads when parsing malformed parameters carried
in INIT or ASCONF processing paths.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: sashiko <sashiko-bot@kernel.org>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Link: https://patch.msgid.link/7838b86b69f52add28808fb59034c8f992e97b2d.1781043268.git.lucien.xin@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 days agoipmr: Convert mr_table.cache_resolve_queue_len to u32.
Kuniyuki Iwashima [Tue, 9 Jun 2026 22:20:04 +0000 (22:20 +0000)] 
ipmr: Convert mr_table.cache_resolve_queue_len to u32.

mr_table.cache_resolve_queue_len is always updated under
spin_lock_bh(&mfc_unres_lock).

Let's convert it to u32.

Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20260609222013.1550355-1-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 days agobridge: cfm: reject invalid CCM interval at configuration time
Xiang Mei [Tue, 9 Jun 2026 06:51:16 +0000 (23:51 -0700)] 
bridge: cfm: reject invalid CCM interval at configuration time

ccm_tx_work_expired() re-arms itself via queue_delayed_work() using
the configured exp_interval converted by interval_to_us(). When
exp_interval is BR_CFM_CCM_INTERVAL_NONE or out of range,
interval_to_us() returns 0, causing the worker to fire immediately in
a tight loop that allocates skbs until OOM.

Fix this by validating exp_interval at configuration time:

 - Constrain IFLA_BRIDGE_CFM_CC_CONFIG_EXP_INTERVAL to the valid range
   [BR_CFM_CCM_INTERVAL_3_3_MS, BR_CFM_CCM_INTERVAL_10_MIN] in the
   netlink policy so userspace cannot set an invalid value.

 - Reject starting CCM TX in br_cfm_cc_ccm_tx() when exp_interval has
   not yet been configured (defaults to 0 from kzalloc).

Fixes: 2be665c3940d ("bridge: cfm: Netlink SET configuration Interface.")
Reported-by: Weiming Shi <bestswngs@gmail.com>
Signed-off-by: Xiang Mei <xmei5@asu.edu>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20260609065116.2818837-1-xmei5@asu.edu
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 days agoMerge branch 'net-fib-fix-two-use-after-free-in-drivers-during-rcu-dump'
Jakub Kicinski [Thu, 11 Jun 2026 22:14:04 +0000 (15:14 -0700)] 
Merge branch 'net-fib-fix-two-use-after-free-in-drivers-during-rcu-dump'

Kuniyuki Iwashima says:

====================
net: fib: Fix two use-after-free in drivers during RCU dump.

syzbot reported fib_info UAF in netdevsim, and the same bug
exists in rocker and mlxsw.

Patch 1 fixes it, and Patch 2 fixes the same type of bug of
fib_rule.
====================

Link: https://patch.msgid.link/20260610061744.2030996-1-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 days agonet: fib_rules: Don't dump dying fib_rule in fib_rules_dump().
Kuniyuki Iwashima [Wed, 10 Jun 2026 06:17:19 +0000 (06:17 +0000)] 
net: fib_rules: Don't dump dying fib_rule in fib_rules_dump().

rocker_router_fib_event() calls fib_rule_get() during RCU dump.

If the fib_rule is dying, refcount_inc() will complain about it.

Let's call refcount_inc_not_zero() in fib_rules_dump().

Fixes: 5d7bfd141924 ("ipv4: fib_rules: Dump FIB rules when registering FIB notifier")
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20260610061744.2030996-3-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 days agoipv4: fib: Don't dump dying fib_info in fib_leaf_notify().
Kuniyuki Iwashima [Wed, 10 Jun 2026 06:17:18 +0000 (06:17 +0000)] 
ipv4: fib: Don't dump dying fib_info in fib_leaf_notify().

syzbot reported use-after-free in nsim_fib4_prepare_event(). [0]

The problem is that the following functions call fib_info_hold() /
refcount_inc() while dumping fib_info under RCU, which is unsafe.

  * mlxsw_sp_router_fib4_event()
  * rocker_router_fib_event()
  * nsim_fib4_prepare_event()

refcount_inc_not_zero() must be used, but it would be too late
there.

Let's guarantee the lifetime of fib_info in fib_leaf_notify().

Note that IPv6 does not need the corresponding change since
fib6_table_dump() holds fib6_table.tb6_lock.

[0]:
refcount_t: addition on 0; use-after-free.
WARNING: lib/refcount.c:25 at refcount_warn_saturate+0x9f/0x110 lib/refcount.c:25, CPU#0: kworker/u8:15/3420
Modules linked in:
CPU: 0 UID: 0 PID: 3420 Comm: kworker/u8:15 Not tainted syzkaller #0 PREEMPT_{RT,(full)}
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026
Workqueue: netns cleanup_net
RIP: 0010:refcount_warn_saturate+0x9f/0x110 lib/refcount.c:25
Code: eb 66 85 db 74 3e 83 fb 01 75 4c e8 1b f1 22 fd 48 8d 3d 84 cb f1 0a 67 48 0f b9 3a eb 4a e8 08 f1 22 fd 48 8d 3d 81 cb f1 0a <67> 48 0f b9 3a eb 37 e8 f5 f0 22 fd 48 8d 3d 7e cb f1 0a 67 48 0f
RSP: 0018:ffffc9000f2c7270 EFLAGS: 00010293
RAX: ffffffff84a18858 RBX: 0000000000000002 RCX: ffff888032ff9ec0
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffffff8f9353e0
RBP: 0000000000000000 R08: ffff888032ff9ec0 R09: 0000000000000005
R10: 0000000000000100 R11: 0000000000000004 R12: ffff8880570cc000
R13: dffffc0000000000 R14: ffff88802b40563c R15: ffff8880570cc000
FS:  0000000000000000(0000) GS:ffff888126173000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fb1f4d5d000 CR3: 000000006072a000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 __refcount_add include/linux/refcount.h:-1 [inline]
 __refcount_inc include/linux/refcount.h:366 [inline]
 refcount_inc include/linux/refcount.h:383 [inline]
 fib_info_hold include/net/ip_fib.h:629 [inline]
 nsim_fib4_prepare_event drivers/net/netdevsim/fib.c:930 [inline]
 nsim_fib_event_schedule_work drivers/net/netdevsim/fib.c:1000 [inline]
 nsim_fib_event_nb+0x1055/0x1240 drivers/net/netdevsim/fib.c:1043
 call_fib_notifier+0x45/0x80 net/core/fib_notifier.c:25
 call_fib_entry_notifier net/ipv4/fib_trie.c:90 [inline]
 fib_leaf_notify net/ipv4/fib_trie.c:2176 [inline]
 fib_table_notify net/ipv4/fib_trie.c:2194 [inline]
 fib_notify+0x36b/0x5e0 net/ipv4/fib_trie.c:2217
 fib_net_dump net/core/fib_notifier.c:70 [inline]
 register_fib_notifier+0x184/0x360 net/core/fib_notifier.c:108
 nsim_fib_create+0x85d/0x9f0 drivers/net/netdevsim/fib.c:1596
 nsim_dev_reload_create drivers/net/netdevsim/dev.c:1604 [inline]
 nsim_dev_reload_up+0x374/0x7c0 drivers/net/netdevsim/dev.c:1058
 devlink_reload+0x501/0x8d0 net/devlink/dev.c:475
 devlink_pernet_pre_exit+0x1ff/0x420 net/devlink/core.c:558
 ops_pre_exit_list net/core/net_namespace.c:161 [inline]
 ops_undo_list+0x187/0x940 net/core/net_namespace.c:234
 cleanup_net+0x56e/0x800 net/core/net_namespace.c:702
 process_one_work kernel/workqueue.c:3314 [inline]
 process_scheduled_works+0xb5d/0x1860 kernel/workqueue.c:3397
 worker_thread+0xa53/0xfc0 kernel/workqueue.c:3478
 kthread+0x388/0x470 kernel/kthread.c:436
 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>

Fixes: 0ae3eb7b4611 ("netdevsim: fib: Perform the route programming in a non-atomic context")
Fixes: c3852ef7f2f8 ("ipv4: fib: Replay events when registering FIB notifier")
Reported-by: syzbot+cb2aa2390ac024e25f5c@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/netdev/6a290011.39669fcc.33b062.00b1.GAE@google.com/
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20260610061744.2030996-2-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 days agobnx2x: fix resource leaks in bnx2x_init_one() error paths
Haoxiang Li [Tue, 9 Jun 2026 07:46:10 +0000 (15:46 +0800)] 
bnx2x: fix resource leaks in bnx2x_init_one() error paths

bnx2x_init_one() falls through to the common memory cleanup path for
several failures after probe has already acquired additional resources.

If register_netdev() fails after bnx2x_set_int_mode(), MSI/MSI-X remains
enabled. If later failures happen after bnx2x_iov_init_one(), PF SR-IOV
state can be left allocated. Also, failures after bnx2x_vfpf_acquire()
must release the PF resources before freeing the VF-PF mailbox allocated
by bnx2x_vf_pci_alloc().

Add error labels matching the resource acquisition order so probe failure
disables MSI/MSI-X, removes SR-IOV state, releases VF-PF resources,
deallocates VF PCI resources, and then frees the common driver memory.
Also clear PCI drvdata before freeing the netdev on probe failure.

Cc: stable+noautosel@kernel.org # untested fix to unlikely error path
Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260609074610.1968721-1-lihaoxiang@isrc.iscas.ac.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 days agonet/sched: cls_flow: Dont expose folded kernel pointers
Jamal Hadi Salim [Wed, 10 Jun 2026 10:18:39 +0000 (06:18 -0400)] 
net/sched: cls_flow: Dont expose folded kernel pointers

The flow classifier falls back to addr_fold() for fields that are missing
from packet headers. In map mode, userspace controls mask, xor, rshift,
addend and divisor, and can observe the resulting classid through class
statistics. This allows a tc classifier in a user/network namespace to
recover the 32-bit folded value of skb->sk, skb_dst() or skb_nfct().

Align with standard kernel practices for pointer hashing and replace the
XOR folding with a keyed siphash (which is cryptographically secure)

Fixes: e5dfb815181f ("[NET_SCHED]: Add flow classifier")
Reported-by: Kyle Zeng <kylebot@openai.com>
Tested-by: Kyle Zeng <kylebot@openai.com>
Tested-by: Victor Nogueira <victor@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260610101839.14135-1-jhs@mojatatu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 days agonet: dsa: qca8k: fix led devicename when using external mdio bus
George Moussalem [Mon, 8 Jun 2026 07:22:08 +0000 (11:22 +0400)] 
net: dsa: qca8k: fix led devicename when using external mdio bus

The qca8k dsa switch can use either an external or internal mdio bus.
This depends on whether the mdio node is defined under the switch node
itself. Upon registering the internal mdio bus, the internal_mdio_bus
of the dsa switch is assigned to this bus. When an external mdio bus is
used, the driver still uses the internal_mdio_bus id which is used to
create the device names of the leds.
This leads to the leds being prefixed with '(efault)' as the
internal_mii_bus is null. So let's fix this by adding a null check and
use the devicename of the external bus instead when an external bus is
configured.

Fixes: 1e264f9d2918 ("net: dsa: qca8k: add LEDs basic support")
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20260608-qca8k-leds-fix-v3-1-a915bb2f37ae@outlook.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 days agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Jakub Kicinski [Thu, 11 Jun 2026 21:29:53 +0000 (14:29 -0700)] 
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

Cross-merge networking fixes after downstream PR (net-7.1-rc8).

Conflicts:

drivers/net/ethernet/wangxun/txgbe/txgbe_aml.c
  f67aead16e85 ("net: txgbe: rework service event handling")
  57d39faed4c9 ("net: txgbe: improve functions of AML 40G devices")

net/rds/info.c
  512db8267b73 ("rds: mark snapshot pages dirty in rds_info_getsockopt()")
  6e94eeb2a2a6 ("rds: convert to getsockopt_iter")

Adjacent changes:

include/net/sock.h
  1ee90b77b727 ("net: guard timestamp cmsgs to real error queue skbs")
  f0de88303d5e ("net: make is_skb_wmem() available to modules")

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 days agoMerge tag 'dma-mapping-7.1-2026-06-11' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Thu, 11 Jun 2026 21:22:26 +0000 (14:22 -0700)] 
Merge tag 'dma-mapping-7.1-2026-06-11' of git://git.kernel.org/pub/scm/linux/kernel/git/mszyprowski/linux

Pull dma-mapping fix from Marek Szyprowski:
 "Three more fixes for the DMA-mapping code, related to PCI P2PDMA, DMA
  debug and DMA link ranges API (Li RongQing and Jason Gunthorpe)"

* tag 'dma-mapping-7.1-2026-06-11' of git://git.kernel.org/pub/scm/linux/kernel/git/mszyprowski/linux:
  iommu/dma: Do not try to iommu_map a 0 length region in swiotlb
  dma-debug: fix physical address retrieval in debug_dma_sync_sg_for_device
  dma-mapping: direct: fix missing mapping for THRU_HOST_BRIDGE segments

12 days agoMerge tag 'sunxi-dt-for-7.2-2' of https://git.kernel.org/pub/scm/linux/kernel/git...
Arnd Bergmann [Thu, 11 Jun 2026 21:07:12 +0000 (23:07 +0200)] 
Merge tag 'sunxi-dt-for-7.2-2' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into soc/dt

Allwinner device tree changes for 7.2 - Take 2

Some changes for old chips and some for recent ones.

- A83T gained the MIPI CSI-2 receiver
- overlays enabled for Pine64 boards
- D1s / T113 and H616 gained the high speed timer
- T113s watchdog enabled (for reboot)
- H616 gained proper SRAM regions
- A523 family gained EL2 virtual timer interrupt and GPADC
- A523 pinctrl IRQ fix

* tag 'sunxi-dt-for-7.2-2' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
  arm64: dts: allwinner: a523: Add missing GPIO interrupt
  arm64: dts: allwinner: a523: add gpadc node
  arm64: dts: allwinner: Add EL2 virtual timer interrupt
  ARM: dts: sun8i: a83t: Add MIPI CSI-2 controller node
  dt-bindings: media: sun6i-a31-isp: Add optional interconnect properties
  dt-bindings: media: sun6i-a31-csi: Add optional interconnect properties
  arm64: dts: allwinner: sun50i-a64: Enable DT overlays
  arm: dts: allwinner: t113s: enable watchdog for reboot
  arm64: dts: allwinner: h616: add hstimer node
  riscv: dts: allwinner: d1s-t113: add hstimer node
  arm64: dts: allwinner: sun50i-h616: Add SRAM nodes

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
12 days agoMAINTAINERS: add Onur Özkan as Rust reviewer
Miguel Ojeda [Thu, 11 Jun 2026 05:55:38 +0000 (07:55 +0200)] 
MAINTAINERS: add Onur Özkan as Rust reviewer

Onur has been involved with the Rust for Linux project for a year now. He
works on the Tyr driver for Arm Mali GPUs [1] and has been driving the
`ww_mutex` series and the SRCU abstractions, as well as improving the
core Rust support in several areas.

In addition, he is already a reviewer of the `RUST [SYNC]` entry and has
been involved with upstream Rust -- for instance, he led the bootstrap
team for two years.

His expertise with the language and its toolchain will be very useful to
have around in the future. Thus add him to the `RUST` entry as reviewer.

Link: https://rust-for-linux.com/tyr-gpu-driver
Acked-by: Onur Özkan <work@onurozkan.dev>
Acked-by: Gary Guo <gary@garyguo.net>
Link: https://patch.msgid.link/20260611055538.61425-4-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
12 days agoMAINTAINERS: add Alexandre Courbot as Rust reviewer
Miguel Ojeda [Thu, 11 Jun 2026 05:55:37 +0000 (07:55 +0200)] 
MAINTAINERS: add Alexandre Courbot as Rust reviewer

Alexandre has been involved with the Rust for Linux project for more
than a year now. He is one of the main contributors to Nova [1], the
Rust driver for NVIDIA GPUs, and has authored core Rust infrastructure
motivated by that work, such as the `num` module with the `Bounded`
integer type, the `register!` and `bitfield!` macros, as well as
improvements to abstractions like DMA.

He maintains the nova-core driver, as well as the `RUST [NUM]`, `RUST
[BITFIELD]` and `RUST [INTEROP]` entries. In addition, he has been very
active reviewing Rust code in the mailing list.

He also proposed and implemented the `int_lowest_highest_one` feature
in the Rust standard library [2], which we should eventually use in
the kernel.

His experience maintaining a major Rust GPU driver and the abstractions
it needs will be very useful to have around in the future. Thus add him
to the `RUST` entry as reviewer.

Link: https://rust-for-linux.com/nova-gpu-driver
Link: https://github.com/rust-lang/rust/issues/145203
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
Acked-by: Gary Guo <gary@garyguo.net>
Link: https://patch.msgid.link/20260611055538.61425-3-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
12 days agoMAINTAINERS: add Tamir Duberstein as Rust reviewer
Miguel Ojeda [Thu, 11 Jun 2026 05:55:36 +0000 (07:55 +0200)] 
MAINTAINERS: add Tamir Duberstein as Rust reviewer

Tamir has been involved with the Rust for Linux project for more than
a year and a half now. He has been working on improving the integration
between the kernel and the Rust language and tooling: he led the effort
to replace the kernel's own `CStr` type with the standard library's,
and reworked the rust-analyzer integration, among other things.

He is already the maintainer of the `RUST [RUST-ANALYZER]` and `XARRAY API
[RUST]` entries. In addition, he has been active reviewing Rust code in
the mailing list.

He is also a long-time contributor to the upstream Rust project, including
on topics that matter for the Linux kernel [1].

His expertise with the language and its tooling will be very useful to
have around in the future. Thus add him to the `RUST` entry as reviewer.

Link: https://github.com/rust-lang/rust/pull/139994
Acked-by: Tamir Duberstein <tamird@kernel.org>
Acked-by: Gary Guo <gary@garyguo.net>
Link: https://patch.msgid.link/20260611055538.61425-2-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
12 days agoMAINTAINERS: add Daniel Almeida as Rust reviewer
Miguel Ojeda [Thu, 11 Jun 2026 05:55:35 +0000 (07:55 +0200)] 
MAINTAINERS: add Daniel Almeida as Rust reviewer

Daniel has been involved with the Rust for Linux project for more than
three years now. He is the lead of the Tyr driver for Arm Mali GPUs
[1] and submitted many of the core abstractions that drivers need: the
`irq` module, system resources, `IoMem`, the regulator API, the `bits`
module, the basic USB abstractions... He is also working on the initial
Rust V4L2 support [2].

He is already a maintainer and reviewer of several Rust-related entries,
and he has been very active reviewing Rust code in the mailing list.

His experience building Rust drivers and the APIs they require will be
very useful to have around in the future. Thus add him to the `RUST`
entry as reviewer.

Link: https://rust-for-linux.com/tyr-gpu-driver
Link: https://lore.kernel.org/rust-for-linux/20250818-v4l2-v1-0-6887e772aac2@collabora.com/
Acked-by: Daniel Almeida <daniel.almeida@collabora.com>
Acked-by: Gary Guo <gary@garyguo.net>
Link: https://patch.msgid.link/20260611055538.61425-1-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
12 days agoMerge tag 'imx-binding-7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/frank...
Arnd Bergmann [Thu, 11 Jun 2026 21:01:56 +0000 (23:01 +0200)] 
Merge tag 'imx-binding-7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/frank.li/linux into soc/dt

i.MX DT Binding for 7.2

- Add compatible string for TI SN65LVDS93.

* tag 'imx-binding-7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/frank.li/linux:
  dt-bindings: display/lvds-codec: add ti,sn65lvds93

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
12 days agoASoC: SOF: topology: fix memory leak in snd_sof_load_topology
Zhao Dongdong [Wed, 10 Jun 2026 07:20:43 +0000 (15:20 +0800)] 
ASoC: SOF: topology: fix memory leak in snd_sof_load_topology

When the topology filename contains "dummy" and tplg_cnt is 0, the
function returns -EINVAL directly without freeing the tplg_files
allocated by kcalloc() at line 2497. This leaks memory on every
such topology load attempt.

Fix this by setting ret = -EINVAL and jumping to the out: label,
which already handles the kfree(tplg_files) cleanup.

Fixes: 99c159279c6d ("ASoC: SOF: don't check the existence of dummy topology")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Dongdong <zhaodongdong@kylinos.cn>
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://patch.msgid.link/tencent_3EED6D778DC52C3703A2D1EE8119372E8E08@qq.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoMAINTAINERS: Add Axiado reviewer and Maintainers
Prasad Bolisetty [Thu, 11 Jun 2026 20:19:14 +0000 (13:19 -0700)] 
MAINTAINERS: Add Axiado reviewer and Maintainers

Adding 3 new maintainers Prasad,Tzu-Hao, and Karthikeyan
Removed previous maintainer as the previous maintainer moved from project

Signed-off-by: Prasad Bolisetty <pbolisetty@axiado.com>
Acked-by: Harshit Shah <hshah@axiado.com>
Signed-off-by: Tzu-Hao Wei <twei@axiado.com>
Signed-off-by: Karthikeyan Mitran <kmitran@axiado.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
12 days agoASoC: mediatek: Use guard() for mutex & spin locks
Mark Brown [Thu, 11 Jun 2026 19:59:21 +0000 (20:59 +0100)] 
ASoC: mediatek: Use guard() for mutex & spin locks

bui duc phuc <phucduc.bui@gmail.com> says:

This series converts mutex and spinlock handling in Mediatek ASoC drivers
to use guard() helpers.

Most patches are straightforward conversions to guard() helpers with no
functional change intended.

One exception is mt8192-afe-gpio, where the mutex release point moves from
immediately before dev_warn() to scope exit. However, the affected path
only emits a warning and immediately returns -EINVAL, without any further
processing.

Compile-tested only.

Link: https://patch.msgid.link/20260610102021.83273-1-phucduc.bui@gmail.com
12 days agoASoC: mediatek: mt8195: mt8365-dai-i2s: Use guard() for spin locks
bui duc phuc [Wed, 10 Jun 2026 10:20:21 +0000 (17:20 +0700)] 
ASoC: mediatek: mt8195: mt8365-dai-i2s: Use guard() for spin locks

Clean up the code using guard() for spin locks.
Merely code refactoring, and no behavior change.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260610102021.83273-11-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: mediatek: mt8195: mt8365-dai-adda: Use guard() for spin locks
bui duc phuc [Wed, 10 Jun 2026 10:20:20 +0000 (17:20 +0700)] 
ASoC: mediatek: mt8195: mt8365-dai-adda: Use guard() for spin locks

Clean up the code using guard() for spin locks.
Merely code refactoring, and no behavior change.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260610102021.83273-10-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: mediatek: mt8195: mt8365-afe-clk: Use guard() for mutex & spin locks
bui duc phuc [Wed, 10 Jun 2026 10:20:19 +0000 (17:20 +0700)] 
ASoC: mediatek: mt8195: mt8365-afe-clk: Use guard() for mutex & spin locks

Clean up the code using guard() for mutex & spin locks.
Merely code refactoring, and no behavior change.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260610102021.83273-9-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: mediatek: mt8195: mt8195-dai-etdm: Use guard() for spin locks
bui duc phuc [Wed, 10 Jun 2026 10:20:18 +0000 (17:20 +0700)] 
ASoC: mediatek: mt8195: mt8195-dai-etdm: Use guard() for spin locks

Clean up the code using guard() for spin locks.
Merely code refactoring, and no behavior change.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260610102021.83273-8-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: mediatek: mt8195: mt8195-afe-clk: Use guard() for spin locks
bui duc phuc [Wed, 10 Jun 2026 10:20:17 +0000 (17:20 +0700)] 
ASoC: mediatek: mt8195: mt8195-afe-clk: Use guard() for spin locks

Clean up the code using guard() for spin locks.
Merely code refactoring, and no behavior change.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260610102021.83273-7-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: mediatek: mt8192: mt8192-afe-gpio: Use guard() for mutex locks
bui duc phuc [Wed, 10 Jun 2026 10:20:16 +0000 (17:20 +0700)] 
ASoC: mediatek: mt8192: mt8192-afe-gpio: Use guard() for mutex locks

Convert the explicit mutex_lock()/mutex_unlock() pair to guard(mutex)
to simplify the locking logic and automatically release the mutex on
all exit paths.

This changes the mutex release point from immediately before dev_warn()
to automatic cleanup at scope exit. However, the affected path only emits
a warning and immediately returns -EINVAL, without any further processing.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260610102021.83273-6-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: mediatek: mt8188: mt8188-afe-clk: Use guard() for spin locks
bui duc phuc [Wed, 10 Jun 2026 10:20:15 +0000 (17:20 +0700)] 
ASoC: mediatek: mt8188: mt8188-afe-clk: Use guard() for spin locks

Clean up the code using guard() for spin locks.
Merely code refactoring, and no behavior change.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260610102021.83273-5-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: mediatek: mt8186: mt8186-afe-gpio: Use guard() for mutex locks
bui duc phuc [Wed, 10 Jun 2026 10:20:14 +0000 (17:20 +0700)] 
ASoC: mediatek: mt8186: mt8186-afe-gpio: Use guard() for mutex locks

Clean up the code using guard() for mutex locks.
Merely code refactoring, and no behavior change.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260610102021.83273-4-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: mediatek: common: mtk-btcvsd: Use guard() for spin locks
bui duc phuc [Wed, 10 Jun 2026 10:20:13 +0000 (17:20 +0700)] 
ASoC: mediatek: common: mtk-btcvsd: Use guard() for spin locks

Clean up the code using guard() for spin locks.
Merely code refactoring, and no behavior change.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260610102021.83273-3-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: mediatek: common: mtk-afe-fe-dai: Use guard() for mutex locks
bui duc phuc [Wed, 10 Jun 2026 10:20:12 +0000 (17:20 +0700)] 
ASoC: mediatek: common: mtk-afe-fe-dai: Use guard() for mutex locks

Clean up the code using guard() for mutex locks.
Merely code refactoring, and no behavior change.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260610102021.83273-2-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agolib/crypto: gf128hash: mark clmul32() as noinline_for_stack
Arnd Bergmann [Thu, 11 Jun 2026 12:59:39 +0000 (14:59 +0200)] 
lib/crypto: gf128hash: mark clmul32() as noinline_for_stack

During randconfig testing, I came across a lot of warnings for the newly
added carryless multiplication function triggering excessive stack usage
from spilling temporary variables to the stack:

lib/crypto/gf128hash.c:166:1: error: stack frame size (1192) exceeds limit (1024) in 'polyval_mul_generic' [-Werror,-Wframe-larger-than]

In addition to the possible risk of overflowing the kernel stack,
the generated object code surely performs very poorly.

This only happens on architectures that don't provide uint128_t
(which should be all 32-bit architectures on modern compilers), but
though I tested random x86 and arm configs, I only saw this with arm's
CONFIG_THUMB2_KERNEL, which adds more pressure to the register allocator.

The testing was done using clang-22, I don't know if gcc has the same
problem. Marking clmul32() as noinline_for_stack experimentally shows
all of the affected builds to completely solve the problem, reducing
the stack usage to a few bytes as expected.

Since u64 arithmetic frequently leads to compilers badly optimizing
32-bit targets, keeping clmul32 out of line is likely to help on
other 32-bit configurations as well when they run into this problem,
though it may also result in a small performance degradation in
configurations that would benefit from inlining.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20260611125952.3387258-1-arnd@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
12 days agoASoC: rockchip: Use guard() for spin locks
Mark Brown [Thu, 11 Jun 2026 19:50:31 +0000 (20:50 +0100)] 
ASoC: rockchip: Use guard() for spin locks

bui duc phuc <phucduc.bui@gmail.com> says:

This series converts spinlock handling in the Rockchip sound drivers
to use guard() helpers.
The changes are code cleanup only and should have no functional impact.

Link: https://patch.msgid.link/20260604033554.96996-1-phucduc.bui@gmail.com
12 days agoASoC: rockchip: rockchip_sai: Use guard() for spin locks
bui duc phuc [Thu, 4 Jun 2026 03:35:53 +0000 (10:35 +0700)] 
ASoC: rockchip: rockchip_sai: Use guard() for spin locks

Clean up the code using guard() for spin locks.
Merely code refactoring, and no behavior change.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260604033554.96996-4-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: rockchip: i2s-tdm: Use guard() for spin locks
bui duc phuc [Thu, 4 Jun 2026 03:35:52 +0000 (10:35 +0700)] 
ASoC: rockchip: i2s-tdm: Use guard() for spin locks

Clean up the code using guard() for spin locks.
Merely code refactoring, and no behavior change.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260604033554.96996-3-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: rockchip: rockchip_i2s: Use guard() for spin locks
bui duc phuc [Thu, 4 Jun 2026 03:35:51 +0000 (10:35 +0700)] 
ASoC: rockchip: rockchip_i2s: Use guard() for spin locks

Clean up the code using guard() for spin locks.
Merely code refactoring, and no behavior change.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260604033554.96996-2-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: rockchip: Reorder clock enable sequence
Mark Brown [Thu, 11 Jun 2026 19:49:43 +0000 (20:49 +0100)] 
ASoC: rockchip: Reorder clock enable sequence

bui duc phuc <phucduc.bui@gmail.com> says:

This series reorders the runtime resume clock enable sequence in the
Rockchip SPDIF and PDM drivers to enable the bus clock before the
functional controller clock.

It also updates the SPDIF DT binding clock descriptions to match the
actual clock usage in the driver.

Additionally, this v2 adds two new patches addressing issues reported
by the Sashiko AI Review tool regarding regcache sync failure handling
and runtime PM resume status validation.

Testing:
  - Patch 1: Verified (dt_binding_check passed).
  - Patches 2 to 5: Compile tested only. Please help test if you have
    the relevant Rockchip hardware.

Link: https://patch.msgid.link/20260602101608.45137-1-phucduc.bui@gmail.com
12 days agoASoC: rockchip: rockchip_pdm: Handle runtime PM resume failures in set_fmt
bui duc phuc [Tue, 2 Jun 2026 10:16:08 +0000 (17:16 +0700)] 
ASoC: rockchip: rockchip_pdm: Handle runtime PM resume failures in set_fmt

rockchip_pdm_set_fmt() calls pm_runtime_get_sync() before accessing
hardware registers, but ignores its return value.
If the runtime resume fails, the function continues to perform register
accesses while the device state is undefined.
Replace pm_runtime_get_sync() with pm_runtime_resume_and_get() and
return early on failure to avoid unpowered register accesses.

Reported-by: Sashiko AI Review <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/all/20260522110302.349421F000E9@smtp.kernel.org/
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260602101608.45137-6-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: rockchip: spdif: Restore regcache cache-only mode on sync failure
bui duc phuc [Tue, 2 Jun 2026 10:16:07 +0000 (17:16 +0700)] 
ASoC: rockchip: spdif: Restore regcache cache-only mode on sync failure

If regcache_sync() fails during runtime resume, the driver disables the
clocks and returns an error. However, the regmap cache-only mode is left
disabled.
Restore cache-only mode in the error path so subsequent register accesses
continue to use the cache while the device is inactive.

Reported-by: Sashiko AI Review <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/all/20260522103713.6C09D1F000E9@smtp.kernel.org/
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260602101608.45137-5-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: rockchip: rockchip_pdm: Reorder clock enable sequence
bui duc phuc [Tue, 2 Jun 2026 10:16:06 +0000 (17:16 +0700)] 
ASoC: rockchip: rockchip_pdm: Reorder clock enable sequence

Enable the 'hclk' bus clock before the 'clk' controller clock during
runtime resume.
The bus clock provides the register access interface, so enable it before
the controller clock. This also makes the resume sequence the reverse of
the suspend sequence, which keeps the clock ordering consistent.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260602101608.45137-4-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: rockchip: spdif: Reorder clock enable sequence
bui duc phuc [Tue, 2 Jun 2026 10:16:05 +0000 (17:16 +0700)] 
ASoC: rockchip: spdif: Reorder clock enable sequence

Enable the 'hclk' bus clock before the 'mclk' controller clock during
runtime resume.
The bus clock provides the register access interface, so enable it before
the controller clock. This also makes the resume sequence the reverse of
the suspend sequence, which keeps the clock ordering consistent.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260602101608.45137-3-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: dt-bindings: rockchip-spdif: Correct SPDIF clock descriptions
bui duc phuc [Tue, 2 Jun 2026 10:16:04 +0000 (17:16 +0700)] 
ASoC: dt-bindings: rockchip-spdif: Correct SPDIF clock descriptions

Update the binding descriptions to match the actual clock usage, where
'mclk' is the controller clock and 'hclk' is the bus clock.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260602101608.45137-2-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: ti: davinci-mcasp: Add audio-graph-card2 and DPCM support
Sen Wang [Wed, 3 Jun 2026 21:18:30 +0000 (16:18 -0500)] 
ASoC: ti: davinci-mcasp: Add audio-graph-card2 and DPCM support

Extend the McASP driver to support audio-graph-card2 of-graph topology,
while maintaining backwards compatibility for existing simple-audio-card
phandles and machine drivers, which now uses the default MCASP_GRAPH_NONE
code path.

Signed-off-by: Sen Wang <sen@ti.com>
Link: https://patch.msgid.link/20260603211835.635184-1-sen@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: topology: Check PCM and DAI name strings before use
Cássio Gabriel [Thu, 4 Jun 2026 03:10:58 +0000 (00:10 -0300)] 
ASoC: topology: Check PCM and DAI name strings before use

Topology objects store several PCM and DAI names in fixed-size UAPI
arrays. Other topology parser paths validate these fields with bounded
strnlen() checks before using them as C strings, but the PCM and DAI
paths still pass some fixed-size arrays directly to strlen(),
devm_kstrdup(), DAI lookup, and diagnostic prints.

A malformed topology blob with a non-NUL-terminated PCM, DAI, or stream
capability name can therefore make the parser read past the end of the
fixed-size field.

Reject unterminated PCM and DAI name fields before consuming them as C
strings.

Fixes: 64527e8a3529 ("ASoC: topology: Add FE DAIs dynamically")
Fixes: acfc7d46cddc ("ASoC: topology: Add FE DAI links dynamically")
Fixes: 0038be9a84dc ("ASoC: topology: Add support for configuring existing BE DAIs")
Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
Link: https://patch.msgid.link/20260604-asoc-topology-check-pcm-dai-names-v1-1-e1b0f6f7c2ce@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: cs35l56: Remove unnecessary conditionals waiting for enumeration
Charles Keepax [Mon, 8 Jun 2026 10:27:14 +0000 (11:27 +0100)] 
ASoC: cs35l56: Remove unnecessary conditionals waiting for enumeration

Commit [1] updated the core to use complete_all() which means that
the wait_for_completion() will now simply return if the device
is already attached, so skipping the completion isn't required
anymore.  Update the code to simply call sdw_slave_wait_for_init()
unconditionally.

[1] c40d6b3249b1 ("soundwire: fix enumeration completion")

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20260608102714.2503120-11-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: SDCA: Use new SoundWire enumeration helper
Charles Keepax [Mon, 8 Jun 2026 10:27:13 +0000 (11:27 +0100)] 
ASoC: SDCA: Use new SoundWire enumeration helper

Now the new wait for SoundWire enumeration helper no longer depends on
unattach_request it is safe to use from probe time. Update the driver
to use the new core helper.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20260608102714.2503120-10-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: wcd939x: Use new SoundWire enumeration helper
Charles Keepax [Mon, 8 Jun 2026 10:27:12 +0000 (11:27 +0100)] 
ASoC: wcd939x: Use new SoundWire enumeration helper

Now the new wait for SoundWire enumeration helper no longer depends on
unattach_request it is safe to use from probe time. Update the driver
to use the new core helper.

Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260608102714.2503120-9-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: wcd938x: Use new SoundWire enumeration helper
Charles Keepax [Mon, 8 Jun 2026 10:27:11 +0000 (11:27 +0100)] 
ASoC: wcd938x: Use new SoundWire enumeration helper

Now the new wait for SoundWire enumeration helper no longer depends on
unattach_request it is safe to use from probe time. Update the driver
to use the new core helper.

Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260608102714.2503120-8-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: wcd937x: Use new SoundWire enumeration helper
Charles Keepax [Mon, 8 Jun 2026 10:27:10 +0000 (11:27 +0100)] 
ASoC: wcd937x: Use new SoundWire enumeration helper

Now the new wait for SoundWire enumeration helper no longer depends on
unattach_request it is safe to use from probe time. Update the driver
to use the new core helper.

Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260608102714.2503120-7-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: pm4125: Use new SoundWire enumeration helper
Charles Keepax [Mon, 8 Jun 2026 10:27:09 +0000 (11:27 +0100)] 
ASoC: pm4125: Use new SoundWire enumeration helper

Now the new wait for SoundWire enumeration helper no longer depends on
unattach_request it is safe to use from probe time. Update the driver
to use the new core helper.

Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260608102714.2503120-6-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: rt5682: Use new SoundWire enumeration helper
Charles Keepax [Mon, 8 Jun 2026 10:27:08 +0000 (11:27 +0100)] 
ASoC: rt5682: Use new SoundWire enumeration helper

Now the new wait for SoundWire enumeration helper no longer depends on
unattach_request it is safe to use from probe time. Update the driver
to use the new core helper.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20260608102714.2503120-5-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: wsa881x: Use new SoundWire enumeration helper
Charles Keepax [Mon, 8 Jun 2026 10:27:06 +0000 (11:27 +0100)] 
ASoC: wsa881x: Use new SoundWire enumeration helper

Now the new wait for SoundWire enumeration helper no longer depends on
unattach_request it can be used for code that also doesn't check this
flag. Update the driver to use the new core helper.

Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260608102714.2503120-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agosoundwire: Always wait for initialisation of unattached devices
Charles Keepax [Mon, 8 Jun 2026 10:27:05 +0000 (11:27 +0100)] 
soundwire: Always wait for initialisation of unattached devices

Currently in sdw_slave_wait_for_init() the waiting can be skipped
if unattach_request is not set. Doing so was added in [1] likely
because the core used to do a complete() on the completion so
waiting in the case an unattach hadn't actually happened would
block for the full timeout. However patch [2] updated the core to
use complete_all() which means that the wait_for_completion() will
now simply return if the device is already attached skipping the
completion doesn't add much.

Additionally, unattach_request is only set if the host initiates
a bus reset. However, the host doing a bus reset is not the only
reason a device may be unattached from the bus. Other options
could include the driver probing before the device enumerates, a
sync-loss, or the device itself powering down.

Removing the skip using unattached_request, doesn't cost much in
terms of efficiency and allows the sdw_slave_wait_for_init() helper
to be used outside of runtime resume.

[1] b2bd75f806c4 ("soundwire: sdw_slave: track unattach_request to handle all init sequences")
[2] c40d6b3249b1 ("soundwire: fix enumeration completion")

Acked-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260608102714.2503120-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: Validate written enum values in custom controls
Mark Brown [Thu, 11 Jun 2026 19:44:46 +0000 (20:44 +0100)] 
ASoC: Validate written enum values in custom controls

HyeongJun An <sammiee5311@gmail.com> says:

Some custom ASoC kcontrol put() handlers use the written enum value
(ucontrol->value.enumerated.item[0]) to index a table or compute a bit
shift before validating that the value is within the control's enum range.
An out-of-range value written from userspace is therefore consumed before
it is rejected.

This is the same class addressed for the Meson codecs in commit
1e001206804b ("ASoC: meson: g12a-tohdmitx: Validate written enum values")
and commit 3150b70e944e ("ASoC: meson: g12a-toacodec: Validate written
enum values").

Fix four more instances:
 - hdac_hdmi reads e->texts[item] before validation.
 - aiu converts the item before validating it.
 - fsl_audmix converts the item and uses the result before validation.
 - tegra210_ahub reads e->values[item] before validation.

Link: https://patch.msgid.link/20260609124317.38046-1-sammiee5311@gmail.com
12 days agoASoC: tegra: tegra210_ahub: Validate written enum value
HyeongJun An [Tue, 9 Jun 2026 12:43:16 +0000 (21:43 +0900)] 
ASoC: tegra: tegra210_ahub: Validate written enum value

tegra_ahub_put_value_enum() reads e->values[item[0]] before
checking whether item[0] is within the enum item range. The existing
check therefore happens too late to prevent an out-of-range read of the
values array.

Move the check before the array access.

Fixes: 16e1bcc2caf4 ("ASoC: tegra: Add Tegra210 based AHUB driver")
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
Link: https://patch.msgid.link/20260609124317.38046-5-sammiee5311@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: fsl: fsl_audmix: Validate written enum values
HyeongJun An [Tue, 9 Jun 2026 12:43:15 +0000 (21:43 +0900)] 
ASoC: fsl: fsl_audmix: Validate written enum values

fsl_audmix_put_mix_clk_src() and fsl_audmix_put_out_src()
convert the user-provided enum item with snd_soc_enum_item_to_val()
before checking whether the item is within the enum's item count.

The generic snd_soc_put_enum_double() helper performs that
validation, but these callbacks use the converted value first: the
clock-source path tests it with BIT(), and the output-source path
indexes the prms transition table with it.

Reject out-of-range enum items before converting them.

Fixes: be1df61cf06e ("ASoC: fsl: Add Audio Mixer CPU DAI driver")
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
Link: https://patch.msgid.link/20260609124317.38046-4-sammiee5311@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: meson: aiu: Validate written enum values
HyeongJun An [Tue, 9 Jun 2026 12:43:14 +0000 (21:43 +0900)] 
ASoC: meson: aiu: Validate written enum values

The AIU HDMI and internal codec mux put callbacks use the written enum
value with snd_soc_enum_item_to_val() before checking whether the value is
valid for the enumeration.

Reject out-of-range values before converting the enum item, matching the
validation already done by the G12A HDMI and internal codec mux controls.

Fixes: b82b734c0e9a ("ASoC: meson: aiu: add hdmi codec control support")
Fixes: 65816025d461 ("ASoC: meson: aiu: add internal dac codec control support")
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
Link: https://patch.msgid.link/20260609124317.38046-3-sammiee5311@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: codecs: hdac_hdmi: Validate written enum value
HyeongJun An [Tue, 9 Jun 2026 12:43:13 +0000 (21:43 +0900)] 
ASoC: codecs: hdac_hdmi: Validate written enum value

hdac_hdmi_set_pin_port_mux() uses the written enum value to index the
texts array before calling snd_soc_dapm_put_enum_double(), which validates
that the value is within the enum item range.

An out-of-range value can therefore make the driver read past the texts
array before the helper rejects the write. Move the lookup after the helper
has accepted the value.

Fixes: 4a3478debf36 ("ASoC: hdac_hdmi: Add jack reporting")
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
Link: https://patch.msgid.link/20260609124317.38046-2-sammiee5311@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: img: Use guard() for spin locks
Mark Brown [Thu, 11 Jun 2026 19:43:33 +0000 (20:43 +0100)] 
ASoC: img: Use guard() for spin locks

bui duc phuc <phucduc.bui@gmail.com> says:

This series converts spinlock handling in several IMG ASoC drivers
to use guard() helpers.
All patches are straightforward cleanups with no functional change
intended.

Compile-tested only.

Link: https://patch.msgid.link/20260610104524.87166-1-phucduc.bui@gmail.com
12 days agoASoC: img: img-spdif-out: Use guard() for spin locks
bui duc phuc [Wed, 10 Jun 2026 10:45:24 +0000 (17:45 +0700)] 
ASoC: img: img-spdif-out: Use guard() for spin locks

Clean up the code using guard() for spin locks.
Merely code refactoring, and no behavior change.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260610104524.87166-3-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: img: img-spdif-in: Use guard() for spin locks
bui duc phuc [Wed, 10 Jun 2026 10:45:23 +0000 (17:45 +0700)] 
ASoC: img: img-spdif-in: Use guard() for spin locks

Clean up the code using guard() for spin locks.
Merely code refactoring, and no behavior change.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260610104524.87166-2-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: meson: axg-tdm-formatter: Use guard() for mutex locks
bui duc phuc [Wed, 10 Jun 2026 10:21:53 +0000 (17:21 +0700)] 
ASoC: meson: axg-tdm-formatter: Use guard() for mutex locks

Clean up the code using guard() for mutex locks.
Merely code refactoring, and no behavior change.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://patch.msgid.link/20260610102153.83367-1-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoMerge branches 'pm-sleep', 'pm-powercap' and 'pm-tools'
Rafael J. Wysocki [Thu, 11 Jun 2026 19:42:36 +0000 (21:42 +0200)] 
Merge branches 'pm-sleep', 'pm-powercap' and 'pm-tools'

Merge updates related to system sleep support, two updates of the
intel_rapl power capping driver, and a pm-graph utility fix for
7.2-rc1:

 - Add sysctl interface for DPM watchdog timeouts (Tzung-Bi Shih)

 - Use complete() instead of complete_all() in device_pm_sleep_init() to
   avoid a false-positive warning from lockdep_assert_RT_in_threaded_ctx()
   when CONFIG_PROVE_RAW_LOCK_NESTING is enabled (Jiakai Xu)

 - Use a flexible array for CRC uncompressed buffers during hibernation
   image saving (Rosen Penev)

 - Make the LZ4 algorithm available for hibernation compression (l1rox3)

 - Move the preallocate_image() call during hibernation after the
   "prepare" phase of the "freeze" transition (Matthew Leach)

 - Fix a memory leak in rapl_add_package_cpuslocked() in the intel_rapl
   power capping driver and use sysfs_emit() in cpumask_show() in that
   driver (Sumeet Pawnikar, Yury Norov)

 - Fix ValueError when parsing incomplete device properties in the
   pm-graph utility (Gongwei Li)

* pm-sleep:
  PM: dpm_watchdog: Add sysctl interface for DPM watchdog timeouts
  PM: hibernate: Use flexible array for CRC uncompressed buffers
  PM: hibernate: make LZ4 available for hibernation compression
  PM: sleep: Use complete() in device_pm_sleep_init()
  PM: hibernate: call preallocate_image() after freeze prepare

* pm-powercap:
  powercap: intel_rapl: Use sysfs_emit() in cpumask_show()
  powercap: intel_rapl: Fix memory leak in rapl_add_package_cpuslocked()

* pm-tools:
  PM: tools: pm-graph: fix ValueError when parsing incomplete device properties

12 days agoASoC: SOF: Intel: hda-sdw-bpt: select SND_SOF_SOF_HDA_SDW_BPT properly
Arnd Bergmann [Thu, 11 Jun 2026 13:23:06 +0000 (15:23 +0200)] 
ASoC: SOF: Intel: hda-sdw-bpt: select SND_SOF_SOF_HDA_SDW_BPT properly

When SND_SOC_SOF_INTEL_LNL is set, SND_SOF_SOF_HDA_SDW_BPT must also
be enabled, in order to let the soundwire support call into it.

However, there are configurations with SND_SOF_SOF_HDA_SDW_BPT=m
and SND_SOF_SOF_HDA_SDW_BPT=m but SOUNDWIRE_INTEL=y, which still
lead to a link failure:

aarch64-linux-ld: drivers/soundwire/intel_ace2x.o: in function `intel_ace2x_bpt_wait':
intel_ace2x.c:(.text+0xfc8): undefined reference to `hda_sdw_bpt_wait'
aarch64-linux-ld: drivers/soundwire/intel_ace2x.o: in function `intel_ace2x_bpt_send_async':
intel_ace2x.c:(.text+0x1ff8): undefined reference to `hda_sdw_bpt_get_buf_size_alignment'

Address this by moving the 'select SND_SOF_SOF_HDA_SDW_BPT' into
SND_SOC_SOF_HDA_GENERIC.

Fixes: 614d416dd8ae ("ASoC: SOF: Intel: hda-sdw-bpt: fix SND_SOF_SOF_HDA_SDW_BPT dependencies")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20260611132310.137688-2-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: SOF: Intel: select SND_SOC_SDW_UTILS=y from SND_SOC_SOF_HDA_GENERIC=y
Arnd Bergmann [Thu, 11 Jun 2026 13:23:05 +0000 (15:23 +0200)] 
ASoC: SOF: Intel: select SND_SOC_SDW_UTILS=y from SND_SOC_SOF_HDA_GENERIC=y

When SND_SOC_SOF_HDA_GENERIC=y but SND_SOC_SOF_INTEL_SOUNDWIRE=m, the
SND_SOC_SDW_UTILS is also set to =m even though there is a direct link
dependency from the hda.c:

aarch64-linux-ld: sound/soc/sof/intel/hda.o: in function `hda_machine_select':
hda.c:(.text+0x21ac): undefined reference to `codec_info_list'
hda.c:(.text+0x241c): undefined reference to `asoc_sdw_get_dai_type'
hda.c:(.text+0x25b4): undefined reference to `asoc_sdw_get_codec_info_list_count'
hda.c:(.text+0x25d8): undefined reference to `asoc_sdw_get_codec_info_list_count'

Change this the same way as the other related 'select' statements
to allow linking against it.

Fixes: 2b4d53eb5cf3 ("ASoC: SOF: Intel: select SND_SOC_SDW_UTILS in SND_SOC_SOF_HDA_GENERIC")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Julian Braha <julianbraha@gmail.com>
Link: https://patch.msgid.link/20260611132310.137688-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: cs35l56: Fix wrong error test on simple_write_to_buffer()
Richard Fitzgerald [Thu, 11 Jun 2026 15:12:34 +0000 (16:12 +0100)] 
ASoC: cs35l56: Fix wrong error test on simple_write_to_buffer()

In cs35l56_cal_data_debugfs_write() fix the if statement that checks for
error return to only check for negative values.

Reported by Sashiko:

  simple_write_to_buffer() returns the positive number of bytes copied
  on success. Since the condition returns immediately on any non-zero
  value, is it possible that the written calibration data is discarded
  and cs35l56_stash_calibration() is never called?

Fixes: f7097161e94c ("ASoC: cs35l56: Add common code for factory calibration")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/patchset/20260610093432.557375-1-rf%40opensource.cirrus.com
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20260611151234.1111153-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoASoC: soc-core: Create device_link to ensure correct suspend order
Richard Fitzgerald [Thu, 11 Jun 2026 11:08:56 +0000 (12:08 +0100)] 
ASoC: soc-core: Create device_link to ensure correct suspend order

In snd_soc_bind_card() create a device_link from card to all components
to ensure correct order of system_suspend. The card is the consumer and
the components are the supplier, so that the card will system_suspend
before any of the components.

The PM core will normally system_suspend drivers in the opposite order
that they registered. This ensures children are suspended before their
parents, for example users of a bus driver should suspend before the bus
driver suspends.

For ASoC, snd_soc_suspend() shuts down any active audio, which requires
that the components are still able to communicate with their hardware.
Previously there was nothing to ensure this ordering, because there is
(usually) no relationship between a machine driver and component drivers.
If the machine driver registered before the codec drivers, the codec
drivers would be suspended before the machine driver snd_soc_suspend()
runs, so that ASoC is attempting to stop audio on a driver that has
already suspended.

Creating a device_link is safe if there is already a device_link between
those devices because of multiple components sharing the same dev.
device_link_add() kernel doc says:

 "if a device link between the given @consumer and @supplier pair
  exists already when this function is called for them, the existing link
  will be returned regardless of its current type and status ...
  The caller of this function is then expected to treat
  the link as though it has just been created, so (in particular) if
  DL_FLAG_STATELESS was passed in @flags, the link needs to be released
  explicitly when not needed any more"

For the same reason it is safe if the codec driver or machine driver
later call device_link_add() to create a link between the same two
devices.

(I have tested creating multiple links between the card->dev and a
component->dev and did not encounter any problems with suspend/resume or
module unloading.)

The DL_FLAG_AUTOREMOVE_* flags assume that they are being called from
the probe() function of that device. This isn't guaranteed in ASoC card
binding because of deferred binding. The exact behavior and consequences
of the DL_FLAG_AUTOREMOVE_* are also unclear from the documentation.
So DL_FLAG_STATELESS is used for safety, and the links are removed
explicitly when the card unbinds or if the bind fails.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20260611110856.1088110-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 days agoPM: dpm_watchdog: Add sysctl interface for DPM watchdog timeouts
Tzung-Bi Shih [Mon, 8 Jun 2026 02:15:26 +0000 (02:15 +0000)] 
PM: dpm_watchdog: Add sysctl interface for DPM watchdog timeouts

Introduce sysctl knobs to allow configuring DPM watchdog timeouts at
runtime.

Currently, these timeouts are fixed at compile time via
CONFIG_DPM_WATCHDOG_TIMEOUT and CONFIG_DPM_WATCHDOG_WARNING_TIMEOUT.
This limits flexibility if the timeouts need to be adjusted for
different testing scenarios or hardware behaviors without rebuilding
the kernel.

Add the following sysctl files under /proc/sys/kernel/:

 - dpm_watchdog_timeout_secs: The total timeout before panic. The
   maximum value is capped at CONFIG_DPM_WATCHDOG_TIMEOUT to prevent
   unreasonably large timeouts.

 - dpm_watchdog_warning_timeout_secs: The warning timeout. The maximum
   value is capped at the current dpm_watchdog_timeout_secs.

Both sysctls have a minimum value of 1.

Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://patch.msgid.link/20260608021526.1023248-4-tzungbi@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
12 days agoMerge tag 'asoc-fix-v7.1-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git...
Takashi Iwai [Thu, 11 Jun 2026 19:29:47 +0000 (21:29 +0200)] 
Merge tag 'asoc-fix-v7.1-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v7.1

A few more fixes for this release, some smaller driver specific ones
plus a final quirk.

12 days agoMerge branches 'pm-cpuidle', 'pm-opp' and 'pm-qos'
Rafael J. Wysocki [Thu, 11 Jun 2026 19:20:57 +0000 (21:20 +0200)] 
Merge branches 'pm-cpuidle', 'pm-opp' and 'pm-qos'

Merge cpuidle updates, OPP (operating performance points) updates and a
PM QoS update for 7.2-rc1:

 - Allow the intel_idle driver to avoid exposing C-states that are
   redundant when PC6 is disabled (Artem Bityutskiy)

 - Fix memory leak and a potential race in the OPP core (Abdun Nihaal,
   Di Shen)

 - Mark Rust OPP methods as inline (Nicolás Antinori)

 - Fix misc device registration failure path in the PM QoS core (Yuho
   Choi)

* pm-cpuidle:
  intel_idle: Drop C-states redundant when PC6 is disabled
  intel_idle: Introduce a helper for checking PC6
  intel_idle: Add constants for MSR_PKG_CST_CONFIG_CONTROL

* pm-opp:
  opp: rust: mark OPP methods as inline
  OPP: of: Fix potential memory leak in opp_parse_supplies()
  OPP: Fix race between OPP addition and lookup

* pm-qos:
  PM: QoS: Fix misc device registration unwind

12 days agoMerge branch 'pm-cpufreq'
Rafael J. Wysocki [Thu, 11 Jun 2026 19:19:13 +0000 (21:19 +0200)] 
Merge branch 'pm-cpufreq'

Merge cpufreq updates for 7.2:

 - Fix a race between cpufreq suspend and CPU hotplug during system
   shutdown (Tianxiang Chen)

 - Avoid redundant target() calls for unchanged limits and fix a typo
   in a comment in the cpufreq core (Viresh Kumar)

 - Fix concurrency issues related to sysfs attributes access that affect
   cpufreq governors using the common governor code (Zhongqiu Han)

 - Simplify frequency limit handling in the conservative cpufreq
   governor (Lifeng Zheng)

 - Fix descriptions of the conservative governor freq_step tunable and
   the ondemand governor sampling_down_factor tunable in the cpufreq
   documentation (Pengjie Zhang)

 - Fix use-after-free and double free during _OSC evaluation in the PCC
   cpufreq driver (Yuho Choi)

 - Rework the handling of policy min and max frequency values in the
   cpufreq core to allow drivers to specify special initial values for
   the scaling_min_freq and scaling_max_freq sysfs attributes (Pierre
   Gondois)

 - Add cpufreq scaling support for Qualcomm Shikra SoC (Taniya Das,
   Imran Shaik).

 - Improve the warning message on HWP-disabled hybrid processors printed
   by the intel_pstate driver and sync policy->cur during CPU offline in
   it (Yohei Kojima, Fushuai Wang)

 - Drop cpufreq support for AMD Elan SC4* (Sean Young)

 - Minor fixes for cpufreq drivers (Krzysztof Kozlowski, Akashdeep Kaur,
   Hans Zhang, Guangshuo Li, Xueqin Luo)

 - Clean up dead dependencies on X86 in the cpufreq Kconfig (Julian
   Braha)

* pm-cpufreq: (25 commits)
  cpufreq: Use policy->min/max init as QoS request
  cpufreq: Remove driver default policy->min/max init
  cpufreq: Set default policy->min/max values for all drivers
  cpufreq: Extract cpufreq_policy_init_qos() function
  cpufreq: Documentation: fix conservative governor freq_step description
  cpufreq: ti: Add EPROBE_DEFER for K3 SoCs
  cpufreq: qcom: Add cpufreq scaling support for Qualcomm Shikra SoC
  dt-bindings: cpufreq: Document Qualcomm Shikra SoC EPSS
  cpufreq: governor: Fix stale prev_cpu_nice spike when enabling ignore_nice_load
  cpufreq: governor: Fix data races on per-CPU idle/nice baselines
  cpufreq: intel_pstate: Improve warning message on HWP-disabled hybrid CPUs
  cpufreq: elanfreq: Drop support for AMD Elan SC4*
  cpufreq: clean up dead dependencies on X86 in Kconfig
  cpufreq: conservative: Simplify frequency limit handling
  cpufreq: Avoid redundant target() calls for unchanged limits
  cpufreq: Fix typo in comment
  cpufreq: intel_pstate: Sync policy->cur during CPU offline
  cpufreq: Documentation: fix sampling_down_factor range
  cpufreq: Fix hotplug-suspend race during reboot
  cpufreq: pcc: fix use-after-free and double free in _OSC evaluation
  ...

12 days agoRDMA/mlx5: Release the HW‑provided UAR index rather than the SW one
Leon Romanovsky [Thu, 11 Jun 2026 10:20:15 +0000 (13:20 +0300)] 
RDMA/mlx5: Release the HW‑provided UAR index rather than the SW one

Free the UAR index returned by the hardware.

Fixes: 4ed131d0bb15 ("IB/mlx5: Expose dynamic mmap allocation")
Link: https://patch.msgid.link/r/20260611-fix-uar-release-v1-1-f5464d845dbf@nvidia.com
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
12 days agoRDMA/mlx5: Fix undefined shift of user RQ WQE size
Maher Sanalla [Thu, 11 Jun 2026 12:50:42 +0000 (15:50 +0300)] 
RDMA/mlx5: Fix undefined shift of user RQ WQE size

set_rq_size() computes the RQ WQE size as "1 << rq_wqe_shift" based on
the user-provided rq_wqe_shift, which is only checked to be greater than
32, so shifts of 32 are still accepted. A shift of 31 also overflows a
signed integer, leading to undefined behavior.

Use check_shl_overflow() to compute the RQ WQE size and reject any
invalid values.

Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters")
Link: https://patch.msgid.link/r/20260611-maher-sec-fixes-v1-1-cd8eb2542869@nvidia.com
Signed-off-by: Maher Sanalla <msanalla@nvidia.com>
Signed-off-by: Edward Srouji <edwards@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
12 days agoRDMA/mlx5: Remove raw RSS QP restrack tracking
Patrisious Haddad [Sun, 7 Jun 2026 18:18:09 +0000 (21:18 +0300)] 
RDMA/mlx5: Remove raw RSS QP restrack tracking

Raw RSS QP restrack tracking wasn't working to begin with as it was
only tracking the first raw RSS QP which was added, since at creation
the raw RSS QP number is reserved so the QP number for this qp type
was always zero.
The following raw RSS QP additions were always failing silently.

Since the fix isn't trivial and there were no users that required or
complained about this issue we are dropping this for now instead of fixing.

Fixes: 968f0b6f9c01 ("RDMA/mlx5: Consolidate into special function all create QP calls")
Link: https://patch.msgid.link/r/20260607-restrack-uaf-fix-v1-2-d72e45eb76c2@nvidia.com
Signed-off-by: Patrisious Haddad <phaddad@nvidia.com>
Reviewed-by: Michael Guralnik <michaelgur@nvidia.com>
Signed-off-by: Edward Srouji <edwards@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
12 days agoRDMA/mlx5: Remove DCT restrack tracking
Patrisious Haddad [Sun, 7 Jun 2026 18:18:08 +0000 (21:18 +0300)] 
RDMA/mlx5: Remove DCT restrack tracking

DCT restrack tracking wasn't working to begin with as it was only
tracking the first DCT which was added, since at creation the DCT number
isn't yet initialized because the DCT FW object is only created during
modify. The following DCT additions were failing silently.

Since the fix isn't trivial and there were no users that required or
complained about this issue we are dropping this for now instead of fixing.

Fixes: fd3af5e21866 ("RDMA/mlx5: Track DCT, DCI and REG_UMR QPs as diver_detail resources.")
Link: https://patch.msgid.link/r/20260607-restrack-uaf-fix-v1-1-d72e45eb76c2@nvidia.com
Signed-off-by: Patrisious Haddad <phaddad@nvidia.com>
Reviewed-by: Michael Guralnik <michaelgur@nvidia.com>
Signed-off-by: Edward Srouji <edwards@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
12 days agolib/test_firmware: allocate the configured into_buf size
Samuel Moelius [Fri, 5 Jun 2026 00:30:37 +0000 (00:30 +0000)] 
lib/test_firmware: allocate the configured into_buf size

The batched into_buf test path allocates TEST_FIRMWARE_BUF_SIZE bytes
unconditionally, but then passes test_fw_config->buf_size to
request_firmware_into_buf() or request_partial_firmware_into_buf().

Userspace can set config_buf_size above TEST_FIRMWARE_BUF_SIZE before
triggering a batched request. If the firmware file is large enough, the
firmware loader writes past the end of the 1 KiB test buffer.

Allocate the buffer with the same size that the test passes to the firmware
API so config_buf_size remains the actual buffer size under test.

Assisted-by: Codex:gpt-5.5-cyber-preview
Link: https://lore.kernel.org/20260605003038.2005840-1-sam.moelius@trailofbits.com
Signed-off-by: Samuel Moelius <sam.moelius@trailofbits.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Kees Cook <kees@kernel.org>
Cc: Luis R. Rodriguez <mcgrof@kernel.org>
Cc: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 days agofs: efs: remove unneeded debug prints
Maxwell Doose [Fri, 5 Jun 2026 03:52:51 +0000 (22:52 -0500)] 
fs: efs: remove unneeded debug prints

The current code uses debug prints conditionally compiled with #ifdef
DEBUG.  However, that code, when compiled, causes compiler errors due to
incompatible formatters and undefined variables, notably:

fs/efs/file.c: In function `efs_get_block':
fs/efs/file.c:26:35: error: `block' undeclared (first use in this
function); did you mean `iblock'?
  26 |                         __func__, block, inode->i_blocks, inode->i_size);
     |                                   ^~~~~

and:

fs/efs/file.c: In function `efs_bmap':
./include/linux/kern_levels.h:5:25: error: format `%ld' expects
argument of type `long int', but argument 4 has type `blkcnt_t' {aka
`long long unsigned int'} [-Werror=format=]
   5 | #define KERN_SOH        "\001"          /* ASCII Start Of Header */
     |                         ^~~~~~

which also extends to the other formatters.  As this part of the code has
been dead for just about 14 years now, it has not been modernized to stay
compatible with the most recent gcc compilers.  Fix these issues by
removing the debug prints.

Link: https://lore.kernel.org/20260605035251.89305-2-m32285159@gmail.com
Fixes: f403d1dbac6d ("fs/efs: add pr_fmt / use __func__")
Signed-off-by: Maxwell Doose <m32285159@gmail.com>
Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Fabian Frederick <fabf@skynet.be>
Cc: Christian Brauner <brauner@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 days agocheckpatch: cuppress warnings when Reported-by: is followed by Link:
Cryolitia PukNgae [Fri, 5 Jun 2026 06:57:04 +0000 (14:57 +0800)] 
checkpatch: cuppress warnings when Reported-by: is followed by Link:

> The tag should be followed by a Closes: tag pointing to the report,
> unless the report is not available on the web. The Link: tag can be
> used instead of Closes: if the patch fixes a part of the issue(s)
> being reported.

According to Documentation/process/submitting-patches.rst, Link: is also
acceptable to follow a Reported-by:, if the patch fixes a part of the
issue(s) being reported.

Link: https://lore.kernel.org/20260605-checkpatch-v1-1-8c68ae618513@linux.dev
Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Cheng Nie <niecheng1@uniontech.com>
Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
Cc: Joe Perches <joe@perches.com>
Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 days agoMAINTAINERS: add Alexander as a kcov reviewer
Alexander Potapenko [Fri, 5 Jun 2026 08:54:23 +0000 (10:54 +0200)] 
MAINTAINERS: add Alexander as a kcov reviewer

Also move Dmitry Vyukov to the bottom of the list.

Link: https://lore.kernel.org/20260605085423.1962700-1-glider@google.com
Signed-off-by: Alexander Potapenko <glider@google.com>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Marco Elver <elver@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 days agomailmap: update Alexander Sverdlin's Email addresses
Alexander Sverdlin [Wed, 3 Jun 2026 22:58:40 +0000 (00:58 +0200)] 
mailmap: update Alexander Sverdlin's Email addresses

- add kernel.org address
- add sverdlin.org address (as primary address)
- drop siemens.com address (for accounting purposes only)

Link: https://lore.kernel.org/20260603225847.1849399-1-asv@kernel.org
Signed-off-by: Alexander Sverdlin <asv@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 days agofs: fat: inode: replace sprintf() with scnprintf()
Maxwell Doose [Wed, 3 Jun 2026 14:52:21 +0000 (09:52 -0500)] 
fs: fat: inode: replace sprintf() with scnprintf()

The kernel documentation notes that sprintf() is deprecated and unsafe.
Replace it with the more preferred scnprintf() to help with hardening.

Link: https://lore.kernel.org/20260603145222.59012-1-m32285159@gmail.com
Signed-off-by: Maxwell Doose <m32285159@gmail.com>
Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 days agoRDMA/mlx5: Drop FRMR pool handle on UMR revoke failure
Michael Guralnik [Wed, 10 Jun 2026 00:01:45 +0000 (03:01 +0300)] 
RDMA/mlx5: Drop FRMR pool handle on UMR revoke failure

When UMR revoke fails during MR cleanup, the handle is left in an
unknown state and cannot be returned to the pool. The driver already
destroys the mkey via the fallback path, but the pool's in_use counter
is never decremented, drifting upward over time.

Call ib_frmr_pool_drop on the revoke-failure path so the pool's
accounting stays consistent with the handles it has handed out.

Fixes: 36680ef7bceb ("RDMA/mlx5: Switch from MR cache to FRMR pools")
Link: https://patch.msgid.link/r/20260610000145.820592-10-michaelgur@nvidia.com
Signed-off-by: Michael Guralnik <michaelgur@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
12 days agoRDMA/core: Add ib_frmr_pool_drop for unrecoverable handles
Michael Guralnik [Wed, 10 Jun 2026 00:01:44 +0000 (03:01 +0300)] 
RDMA/core: Add ib_frmr_pool_drop for unrecoverable handles

A driver that has popped a handle from an FRMR pool can hit failures
that leave the handle in a state where it can't safely be returned
for reuse. The driver destroys the handle itself, but the pool has
no way to learn about it, so the in_use counter drifts upward.

Add ib_frmr_pool_drop to balance the pool's accounting in this case.
Every pop is now balanced by exactly one push or drop.

Fixes: 36680ef7bceb ("RDMA/mlx5: Switch from MR cache to FRMR pools")
Link: https://patch.msgid.link/r/20260610000145.820592-9-michaelgur@nvidia.com
Signed-off-by: Michael Guralnik <michaelgur@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
12 days agoRDMA/core: Fix FRMR handle leak on push failure
Michael Guralnik [Wed, 10 Jun 2026 00:01:43 +0000 (03:01 +0300)] 
RDMA/core: Fix FRMR handle leak on push failure

Failure to push a handle to the pool, caused by ENOMEM on queue page
allocation, will trigger missing in_use counter update, skewing pool
state indefinitely.
Fix that by moving the handling of handle destruction in such case
into the FRMR code, ensuring the handle is either pushed to the pool
or destroyed inside the same function.

Adjust mlx5_ib call site accordingly.

Fixes: ce5df0b891ed ("IB/core: Introduce FRMR pools")
Link: https://patch.msgid.link/r/20260610000145.820592-8-michaelgur@nvidia.com
Signed-off-by: Michael Guralnik <michaelgur@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
12 days agoRDMA/core: Avoid NULL dereference on FRMR bad usage
Michael Guralnik [Wed, 10 Jun 2026 00:01:42 +0000 (03:01 +0300)] 
RDMA/core: Avoid NULL dereference on FRMR bad usage

In case a driver calls FRMR pop operation without a successful init,
return after triggering a warning to avoid the NULL dereference.

Fixes: ce5df0b891ed ("IB/core: Introduce FRMR pools")
Link: https://patch.msgid.link/r/20260610000145.820592-7-michaelgur@nvidia.com
Signed-off-by: Michael Guralnik <michaelgur@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
12 days agoRDMA/core: Fix FRMR set pinned push error path
Michael Guralnik [Wed, 10 Jun 2026 00:01:41 +0000 (03:01 +0300)] 
RDMA/core: Fix FRMR set pinned push error path

Add destruction of FRMR handles in case the push to the pool fails.
This prevents resources leak in case pool page allocation fails.

Fixes: 020d189d16a6 ("RDMA/core: Add pinned handles to FRMR pools")
Link: https://patch.msgid.link/r/20260610000145.820592-6-michaelgur@nvidia.com
Signed-off-by: Michael Guralnik <michaelgur@nvidia.com>
Reviewed-by: Tao Cui <cuitao@kylinos.cn>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>