summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
6 daysfirmware: qcom: scm: Allow QSEECOM on Yoga Slim 7x Gen11Konrad Dybcio
Allow the use of QSEECOM on the Glymur-based Lenovo Yoga Slim 7x Gen11, as there seem to be no issues with the firmware that would mandate disabling it. Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Tested-by: Oleg Keri <okerixx@gmail.com> Link: https://lore.kernel.org/r/20260731-topic-yoga_submission-v2-3-f1887031da4f@oss.qualcomm.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
6 daysarm64: dts: qcom: glymur: Add Lenovo Yoga Slim 7x Gen11Konrad Dybcio
Introduce a device tree for the Glymur-based Lenovo Yoga Slim 7x Gen11 laptop. It's fairly similar to the reference design, although there are a couple of major differences, including a different EC. Currently working: - Audio playback and capture - GPU, Display - Keyboard, touchpad, touchscreen, lid switch - Privacy LED - Charging, Type-C - Wi-Fi, Bluetooth - Modem should work on the SKUs that have it, but it remains untested due to lack of access to such a device Co-developed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Co-developed-by: Abel Vesa <abel.vesa@oss.qualcomm.com> Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com> Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Tested-by: Oleg Keri <okerixx@gmail.com> Link: https://lore.kernel.org/r/20260731-topic-yoga_submission-v2-2-f1887031da4f@oss.qualcomm.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
6 daysdt-bindings: arm: qcom: Add Lenovo Yoga Slim 7x Gen11Konrad Dybcio
The Yoga Slim 7x Gen11 is a Snapdragon X2 Elite-based 14" laptop from Lenovo, featuring an OLED touch panel. Add a compatible for it. According to the spec page [1], there also exist other variations (based on the Mahua SoC and/or with a different type of display panel), but those are to be described separately [1] https://psref.lenovo.com/Product/Yoga_Slim_7_14Q8Y11?tab=spec Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Tested-by: Oleg Keri <okerixx@gmail.com> Link: https://lore.kernel.org/r/20260731-topic-yoga_submission-v2-1-f1887031da4f@oss.qualcomm.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
7 daysselftests: ublk: add batch IO cases to recover_03Yang Xiuwei
Add -b coverage for quiesce recover. Signed-off-by: Yang Xiuwei <yangxiuwei@kylinos.cn> Reviewed-by: Ming Lei <tom.leiming@gmail.com> Link: https://patch.msgid.link/20260821103047.369522-3-yangxiuwei@kylinos.cn Signed-off-by: Jens Axboe <axboe@kernel.dk>
7 daysublk: clear force_abort in ublk_queue_reset_io_flags()Yang Xiuwei
Quiesce sets ubq->force_abort for batch I/O. Recovery never clears it, so batch fetch keeps failing with -ENODEV and the device stays QUIESCED. Fixes: a4d883755399 ("ublk: add UBLK_U_IO_FETCH_IO_CMDS for batch I/O processing") Signed-off-by: Yang Xiuwei <yangxiuwei@kylinos.cn> Reviewed-by: Ming Lei <tom.leiming@gmail.com> Link: https://patch.msgid.link/20260821103047.369522-2-yangxiuwei@kylinos.cn Signed-off-by: Jens Axboe <axboe@kernel.dk>
7 daysdrm/xe: Skip clearing purged page-table BOsTejas Upadhyay
VRAM page offlining can clear a page-table BO's vmap before VM teardown calls xe_pt_clear(). Check for a purged BO under its dma-resv lock before writing to the mapping. v4(Sashiko): - dont leave svm notifier lock early v3(Sashiko): - Validate NULL vmap v2(Sashiko): - Fix lock ordering Reviewed-by: Matthew Brost <matthew.brost@intel.com> Link: https://patch.msgid.link/20260909111620.1276402-2-tejas.upadhyay@intel.com Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
7 daysselftests: net: add ctl_file_write() helperJakub Kicinski
Setting a sysctl or a sysfs attribute for the duration of a test and putting the old value back has been open coded multiple times. We generally avoid creating library helpers but this one is very common, and the defer is a little tricky as using the same function for defer as the initial write leads to an infinite loop (not that I would ever make such mistake!) Some of the conversions are not identical, but arguably ctl_file_write() semantics are more correct. Reviewed-by: Nimrod Oren <noren@nvidia.com> Reviewed-by: Bobby Eshleman <bobbyeshleman@meta.com> Link: https://patch.msgid.link/20260909180009.1894019-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 daysMerge branch 'sit-convert-configuration-to-rcu-and-lockless-fill_info'Jakub Kicinski
Eric Dumazet says: ==================== sit: convert configuration to RCU and lockless fill_info SIT (IPv6-in-IPv4) tunnel configuration and status reporting have historically relied on the RTNL lock for synchronization. Consequently, netlink dumps via ipip6_fill_info() had to run with RTNL held, adding contention during network device dumps. At the same time, the transmit path (dev->lltx == true), tunnel lookups, and error handling run locklessly and can race with configuration updates. This can result in torn reads of multi-word fields (such as the 128-bit 6RD IPv6 prefix) or transiently zeroed encapsulation parameters. Furthermore, ipip6_tunnel_update() currently unhashes, re-hashes, and calls synchronize_net() unconditionally, even when the tunnel endpoint addresses (saddr and daddr) have not changed. This patch series addresses PRL issues, modernizes SIT parameter management to use RCU protection, optimizes tunnel updates, and removes the RTNL requirement from ipip6_fill_info(): - Patch 1 fixes a pre-existing UAF in PRL (Potential Router List) deletion where call_rcu() was invoked before unlinking t->prl. - Patch 2 adds GFP_KERNEL_ACCOUNT to struct ip_tunnel_prl_entry allocations in ipip6_tunnel_add_prl(). - Patch 3 removes the unsafe in-place memset() in ip_tunnel_encap_setup() and uses WRITE_ONCE() to prevent lockless readers from observing transiently zeroed or torn fields. - Patch 4 annotates data races on tunnel->fwmark with READ_ONCE() and WRITE_ONCE(). - Patch 5 converts 6RD configuration (tunnel->ip6rd) to an RCU-protected pointer, preventing torn reads on the 128-bit IPv6 prefix. - Patch 6 implements a dedicated ipip6_get_iflink() callback to decouple SIT parameter handling from generic ip_tunnel. - Patch 7 dynamically allocates struct ip_tunnel_parm_kern (sit_parms) as a preparatory step. - Patch 8 converts tunnel->sit_parms to full RCU protection. Updates publish new parameters via rcu_assign_pointer() and free the old ones via kfree_rcu(). When saddr and daddr do not change, unhashing, re-hashing, and synchronize_net() are completely bypassed. - Patch 9 wraps attribute serialization in ipip6_fill_info() under rcu_read_lock(), eliminating the reliance on the RTNL lock. ==================== Link: https://patch.msgid.link/20260907075846.2913645-1-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 dayssit: no longer rely on RTNL in ipip6_fill_info()Eric Dumazet
Now that SIT parameters and 6RD parameters are RCU-protected, and fwmark/encap are annotated with READ_ONCE()/WRITE_ONCE(), ipip6_fill_info() no longer requires RTNL to be held. Wrap the attribute serialization in rcu_read_lock() and rcu_read_unlock(). Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com> Link: https://patch.msgid.link/20260907075846.2913645-10-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 dayssit: convert configuration to RCU protectionEric Dumazet
Now that SIT parameters are dynamically allocated, convert tunnel->sit_parms to an RCU-protected pointer. Updates in ipip6_tunnel_update() allocate a new parameter block, publish it using rcu_assign_pointer(), and free the old one via kfree_rcu(). We only need to unlink and re-link the tunnel in the hash table if either saddr or daddr changed. When neither address changes, the unhash/re-hash and synchronize_net() can be completely skipped. Readers in ipip6_tunnel_lookup(), ipip6_tunnel_xmit(), ipip6_err(), and ipip6_rcv() now safely dereference tunnel->sit_parms under RCU. Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com> Link: https://patch.msgid.link/20260907075846.2913645-9-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 dayssit: dynamically allocate struct ip_tunnel_parm_kernEric Dumazet
In preparation for converting SIT configuration parameters to RCU, dynamically allocate struct ip_tunnel_parm_kern as sit_parms in struct ip_tunnel. Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com> Link: https://patch.msgid.link/20260907075846.2913645-8-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 dayssit: implement ipip6_get_iflink()Eric Dumazet
SIT currently uses ip_tunnel_get_iflink() which reads tunnel->parms.link. In order to decouple SIT parameter handling from ip_tunnel, implement its own ndo_get_iflink callback. Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com> Link: https://patch.msgid.link/20260907075846.2913645-7-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 dayssit: convert 6RD configuration to RCU protectionEric Dumazet
In order to allow lockless readers in future patches, convert 'tunnel->ip6rd' to an RCU protected pointer. Updating 6RD configuration via ipip6_tunnel_update_6rd() or ipip6_tunnel_clone_6rd() now allocates a struct ip_tunnel_6rd_parm and uses rcu_assign_pointer() to publish it, freeing the previous parameters with kfree_rcu(). Readers in check_6rd() and only_dnatted() use rcu_dereference() under existing RCU read lock, preventing torn reads on the 128-bit IPv6 prefix. Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com> Link: https://patch.msgid.link/20260907075846.2913645-6-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 dayssit: annotate data-races around tunnel->fwmarkEric Dumazet
ipip6_tunnel_xmit() runs locklessly (dev->lltx == true) and reads tunnel->fwmark. In preparation for converting ipip6_fill_info() to run without RTNL, add READ_ONCE() and WRITE_ONCE() annotations around tunnel->fwmark. Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com> Link: https://patch.msgid.link/20260907075846.2913645-5-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 daysip_tunnel: use WRITE_ONCE in ip_tunnel_encap_setupEric Dumazet
Update ip_tunnel_encap_setup() to use WRITE_ONCE() when writing to encap fields (type, sport, dport, flags) and hlen fields. This ensures that concurrent lockless readers (like fill_info) do not see torn writes. Also remove the unsafe memset() on t->encap which could cause concurrent readers to transiently see zeroed fields. Removing it also fixes a bug where t->encap was left cleared even if ip_encap_hlen() failed, resulting in partial configuration. Fixes: 56328486539d ("net: Changes to ip_tunnel to support foo-over-udp encapsulation") Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com> Link: https://patch.msgid.link/20260907075846.2913645-4-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 dayssit: charge ip_tunnel_prl_entry allocations to memcgEric Dumazet
ipip6_tunnel_add_prl() allocates struct ip_tunnel_prl_entry for each potential router entry added via SIOCADDPRL. An unprivileged user with CAP_NET_ADMIN in a user namespace can add an unbounded number of entries, consuming uncharged kernel memory. Commit 1b51d8271973 ("memcg: ipv6/sit: account and don't WARN on ip_tunnel_prl structs allocation") added accounting to the temporary buffer in ipip6_tunnel_get_prl(), but missed the entry allocations in ipip6_tunnel_add_prl(). Use GFP_KERNEL_ACCOUNT when allocating struct ip_tunnel_prl_entry. Fixes: 1b51d8271973 ("memcg: ipv6/sit: account and don't WARN on ip_tunnel_prl structs allocation") Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com> Link: https://patch.msgid.link/20260907075846.2913645-3-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 dayssit: fix UAF in ipip6_tunnel_del_prl()Eric Dumazet
When flushing all potential router list (PRL) entries, ipip6_tunnel_del_prl() called call_rcu(&x->rcu_head, prl_list_destroy_rcu) before clearing t->prl. A concurrent reader in isatap_chksrc() could enter an RCU read-side critical section after call_rcu() but before t->prl is set to NULL, allowing prl_list_destroy_rcu() to free nodes while the reader traverses them. Clear t->prl using RCU_INIT_POINTER() before invoking call_rcu(). Also use rcu_assign_pointer() when unlinking individual entries. Fixes: ef9a9d1183b3 ("ipv6 sit: RCU conversion phase I") Signed-off-by: Eric Dumazet <edumazet@google.com> Link: https://patch.msgid.link/20260907075846.2913645-2-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 daysnet: davicom: Propagate wakeup IRQ errorsbui duc phuc
The wakeup IRQ is optional, but errors from platform_get_irq_optional() are currently ignored. Propagate errors from the IRQ lookup, except -ENXIO which indicates that the optional IRQ is not available. Found by manual code inspection. Cc: stable+noautosel@kernel.org # untested fix to unlikely driver error path Signed-off-by: bui duc phuc <phucduc.bui@gmail.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20260909045738.16705-1-phucduc.bui@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 daysx86/amd_node: Fix PCI device reference counting in amd_smn_init()Yazen Ghannam
The local "root" pointer is a temporary variable used during the device search. Therefore, refcount related to the search iterators should be cleaned up after the search is complete. Use the __free() cleanup macro to ensure the refcount is decremented when the temporary pointer goes out of scope. Additionally, increment the refcount when caching a root pointer. This ensures the in-use refcount is separate from the temporary search refcounting. Finally, drop the redundant "root = NULL" before the second search loop. The pci_get_class() iterator always decrements the refcount of its "from" argument, so the first loop can only fall through with "root" already NULL. Fixes: 0a4b61d9c2e4 ("x86/amd_node: Fix AMD root device caching") Closes: https://sashiko.dev/#/patchset/20260806160159.230453-1-jason.andryuk%40amd.com Reported-by: Sashiko <sashiko-bot@kernel.org> Assisted-by: LLM Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Cc: <stable@kernel.org> Link: https://patch.msgid.link/20260903154325.74343-1-yazen.ghannam@amd.com
7 daysMerge tag 'batadv-next-pullrequest-20260907' of https://git.open-mesh.org/batadvJakub Kicinski
Simon Wunderlich says: ==================== This cleanup patchset includes the following patches, all by Sven Eckelmann: - translation table cleanups (12 patches) - kerneldoc fixes noted by sashiko (3 patches) * tag 'batadv-next-pullrequest-20260907' of https://git.open-mesh.org/batadv: batman-adv: correct batadv_hash_remove kdoc return type batman-adv: bat_iv: fix ogm_neigh_is_sob parameters references batman-adv: tt: clarify kernel doc for batadv_tt_local_set_pending_event() batman-adv: tt: drop the cleanup label from batadv_tt_local_remove() batman-adv: tt: extract immediate purge of a local entry batman-adv: tt: extract marking of a removed local entry batman-adv: tt: extract removal of the superseded local entry batman-adv: tt: replace add_orig_entry goto in batadv_tt_global_add() batman-adv: tt: extract merging of flags into existing global entries batman-adv: tt: extract allocation of new global entries batman-adv: tt: extract update of dynamic client flags batman-adv: tt: extract refresh of existing local entries batman-adv: tt: replace forward gotos in batadv_tt_local_add() batman-adv: tt: extract allocation of new local entries batman-adv: tt: look up wifi state of incoming interface in helper ==================== Link: https://patch.msgid.link/20260907081824.2474040-1-sw@simonwunderlich.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 daysnet: starfire: fix ioaddr sign-extension causing ioremap() failureIvy Lopez
ioaddr is declared as a signed long, but is assigned the result of pci_resource_start(), which returns an unsigned resource_size_t. On configurations where the BAR address has its high bit set, the value sign-extends when passed to ioremap(), producing a bogus 64-bit address and causing device probe to fail: ioremap: invalid physical address fffffffffe480000 starfire 0000:08:04.0: cannot Remap 0x80000 @ 0xfe480000, aborting Change ioaddr to resource_size_t, matching both the return type of pci_resource_start() and the type ioremap() expects for its physical address argument, rather than unsigned long, which is not guaranteed to be wide enough on all configurations. Switch the associated error print to %pa accordingly. Link: https://bugzilla.kernel.org/show_bug.cgi?id=198035 Signed-off-by: Ivy Lopez <skunkolee@gmail.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20260909002829.224639-1-skunkolee@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 daysMerge branch 'bpf-tcp-fix-bpf_sock_destroy-on-time_wait-and-listener-socks'Alexei Starovoitov
Jiayuan Chen says: ==================== bpf,tcp: Fix bpf_sock_destroy() on TIME_WAIT and listener socks Fix two bugs in bpf_sock_destroy(). One is an out-of-bounds read of sk->sk_protocol on TIME_WAIT and NEW_SYN_RECV socks, since the field is not in struct sock_common. The other is a might_sleep splat when destroying a listener with children in its accept queue, the cond_resched() in inet_csk_listen_stop() runs under the iterator's rcu_read_lock(). Patch 3 adds a subtest for each. v2 -> v3: - Patch 1: add Reviewed-by from Kuniyuki. - Patch 2: reword why cond_resched() has to go, it can reschedule or report a bogus quiescent state there. - Patch 2: keep the cond_resched() for the non-BPF path rather than removing it as Kuniyuki suggested. VOLUNTARY and NONE are still there on some arches, and on x86 in stable where this goes, so a big listener close() still relies on it. Can go once those modes are gone. - Selftest: don't leak the fd if accept() unexpectedly succeeds. v2: https://lore.kernel.org/bpf/20260906074135.185212-1-jiayuan.chen@linux.dev/ v1 -> v2: - Patch 1: fix the return comment too. - Patch 2: new. - Selftest: server recv()s EOF before close so the FINs can't cross, comment style, keep the blank line before RUN_TESTS(), add the tcp_listen_pending subtest. v1: https://lore.kernel.org/bpf/20260903125306.299943-1-jiayuan.chen@linux.dev/ ==================== Link: https://patch.msgid.link/20260910112107.148770-1-jiayuan.chen@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org>
7 daysselftests/bpf: Test bpf_sock_destroy() on TIME_WAIT and listener socksJiayuan Chen
Add two subtests. tcp_timewait: the client shuts down first and the server closes after it, so the client sock ends up in TIME_WAIT. A tcp iterator then finds the timewait sock by the cookie it inherited from the client sock and destroys it. Iterate once more to make sure it is gone. Without the first fix bpf_sock_destroy() reads past the timewait sock and KASAN complains. tcp_listen_pending: connect to a listener but never accept, so the child sits in the accept queue, then destroy the listener. Without the second fix the cond_resched() in inet_csk_listen_stop() trips the might_sleep check under rcu_read_lock(). ./test_progs -a sock_destroy #444/1 sock_destroy/tcp_client:OK #444/2 sock_destroy/tcp_server:OK #444/3 sock_destroy/tcp_listen_pending:OK #444/4 sock_destroy/tcp_timewait:OK #444/5 sock_destroy/udp_client:OK #444/6 sock_destroy/udp_server:OK #444/7 sock_destroy/trace_tcp_destroy_sock:OK #444 sock_destroy:OK Summary: 1/7 PASSED, 0 SKIPPED, 0/0 FAILED Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev> Link: https://lore.kernel.org/r/20260910112810.153801-1-jiayuan.chen@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org>
7 daystcp: Skip cond_resched() in inet_csk_listen_stop() under BPF contextJiayuan Chen
bpf_sock_destroy() runs from the tcp iterator, under rcu_read_lock(). If the sock is a listener that still has children in its accept queue, tcp_abort() ends up in inet_csk_listen_stop() and the cond_resched() there trips the debug check: BUG: sleeping function called from invalid context at net/ipv4/inet_connection_sock.c:1523 in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 628, name: test_progs preempt_count: 0, expected: 0 RCU nest depth: 1, expected: 0 locks held by test_progs/628: 3, last CPU#3: #0: ffff8881158cee18 (&p->lock){+.+.}-{4:4}, at: bpf_seq_read+0x56/0x1210 #1: ffff8881106bb858 (sk_lock-AF_INET6){+.+.}-{0:0}, at: bpf_iter_tcp_seq_show+0x32b/0x4b0 #2: ffffffffb435af20 (rcu_read_lock){....}-{1:3}, at: bpf_iter_run_prog+0x46b/0xde0 CPU: 3 UID: 0 PID: 628 Comm: test_progs Tainted: G W 7.2.0+ #65 PREEMPT Tainted: [W]=WARN Call Trace: <TASK> dump_stack_lvl+0xc1/0xf0 dump_stack+0x10/0x20 __might_resched+0x3d2/0x610 inet_csk_listen_stop+0x7b/0xbf0 tcp_abort+0x23b/0x3b0 bpf_sock_destroy+0xfc/0x140 bpf_prog_448133d24601754f_iter_tcp6_server+0x81/0x8a bpf_iter_run_prog+0x538/0xde0 bpf_iter_tcp_seq_show+0x26b/0x4b0 bpf_seq_read+0x424/0x1210 vfs_read+0x197/0xe40 ksys_read+0x119/0x240 __x64_sys_read+0x72/0xc0 x64_sys_call+0x647/0x27e0 do_syscall_64+0xe5/0x610 entry_SYSCALL_64_after_hwframe+0x76/0x7e RIP: 0033:0x7fad39b28aca RSP: 002b:00007ffc381c61c0 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 00007ffc381c6a88 RCX: 00007fad39b28aca RDX: 0000000000000032 RSI: 00007ffc381c6250 RDI: 0000000000000014 RBP: 00007ffc381c61e0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003 R13: 0000000000000000 R14: 000055f077c1bbb0 R15: 00007fad3a0f3000 </TASK> The commit that added the kfunc already guards lock_sock() in tcp_abort() and udp_abort() with has_current_bpf_ctx(), but missed the listener path. Do the same for the cond_resched(). The loop runs inside the iterator's rcu_read_lock(), it must not reschedule or report a quiescent state there. Fixes: 4ddbcb886268 ("bpf: Add bpf_sock_destroy kfunc") Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev> Link: https://lore.kernel.org/r/20260910112736.153710-1-jiayuan.chen@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org>
7 daysbpf: Fix out-of-bounds read of sk_protocol in bpf_sock_destroy()Jiayuan Chen
sk_protocol lives in struct sock, not in struct sock_common. A timewait or request sock handed to bpf_sock_destroy() by the tcp iterator is neither, so reading sk->sk_protocol runs past the object: ================================================================== BUG: KASAN: slab-out-of-bounds in bpf_sock_destroy+0xc7/0xe0 Read of size 2 at addr ffff8881047d11b4 by task test_progs/428 Tainted: [W]=WARN Call Trace: <TASK> dump_stack_lvl+0x91/0xf0 print_report+0xd1/0x630 kasan_report+0xf3/0x130 __asan_report_load2_noabort+0x14/0x30 bpf_sock_destroy+0xc7/0xe0 bpf_prog_c3dd61f9d9cd9f37_iter_tcp6_timewait+0x9f/0xb7 bpf_iter_run_prog+0x538/0xde0 bpf_iter_tcp_seq_show+0x26b/0x4b0 bpf_seq_read+0x424/0x1210 vfs_read+0x197/0xe40 ksys_read+0x119/0x240 __x64_sys_read+0x72/0xc0 x64_sys_call+0x647/0x27e0 do_syscall_64+0xe5/0x610 entry_SYSCALL_64_after_hwframe+0x76/0x7e Only check sk_protocol on full socks. tcp_abort() already knows how to deal with TIME_WAIT and NEW_SYN_RECV socks. Also fix the comment, it never matched the code. Fixes: 4ddbcb886268 ("bpf: Add bpf_sock_destroy kfunc") Reported-by: Xiang Mei (Microsoft) <xmei5@asu.edu> Closes: https://lore.kernel.org/bpf/20260702224519.800135-1-xmei5@asu.edu/ Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev> Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com> Link: https://lore.kernel.org/r/20260910112634.152195-1-jiayuan.chen@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org>
7 daysselftests/bpf: Test BTF walk into a flexible array of zero-sized elementsJiayuan Chen
The program stashes a bpf_obj_new() object whose type ends with a flexible array of empty structs, then reads it back as an untrusted kptr. Without the previous patch this divides by zero in btf_struct_walk() instead of being rejected. # ./test_progs -t verifier_btf_flex_array ... #602 verifier_btf_flex_array:OK Summary: 1/1 PASSED, 0 SKIPPED, 0/0 FAILED Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev> Link: https://lore.kernel.org/r/20260910122316.186384-2-jiayuan.chen@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org>
7 daysbpf: Fix divide-by-zero in btf_struct_walk()Jiayuan Chen
When an access goes past the struct and the last member is a flexible array, btf_struct_walk() folds the offset back into a single element with (off - moff) % t->size, but never checks that the element type has a size. BTF takes an empty struct, so this in program BTF /* event could be empty */ struct event { #ifdef HAVE_TIMESTAMP __u64 ts; #endif }; struct batch { int nr; struct event events[]; }; divides by zero at prog load time. Getting there needs a PTR_TO_BTF_ID that is not MEM_ALLOC, e.g. a plain read of a local kptr stashed in a map from a sleepable program. Oops: divide error: 0000 [#1] SMP KASAN PTI RIP: 0010:btf_struct_walk+0x53f/0x1570 Call Trace: <TASK> btf_struct_access+0x42a/0xcd0 check_ptr_to_btf_access+0x4dc/0x1160 check_mem_access+0x3a45/0x8740 check_load_mem+0x36a/0xd10 do_check_common+0x3ef0/0xb210 bpf_check+0x6d3b/0x8580 bpf_prog_load+0xf7c/0x2720 __sys_bpf+0xa83/0x3690 __x64_sys_bpf+0xc7/0x150 x64_sys_call+0x1f3f/0x27e0 do_syscall_64+0xe5/0x610 entry_SYSCALL_64_after_hwframe+0x76/0x7e </TASK> Reject a zero-sized element type. The fixed array path in the same function already bails out on the same thing: btf_struct_walk() ... /* skip empty array */ if (moff == mtrue_end) continue; msize /= total_nelems; Fixes: 9c5f8a1008a1 ("bpf: Support variable length array in tracing programs") Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev> Acked-by: Eduard Zingerman <eddyz87@gmail.com> Link: https://lore.kernel.org/r/20260910122316.186384-1-jiayuan.chen@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org>
7 daysbpf: Clear scalar delta on narrowing stack spillDaniel Borkmann
check_stack_write_fixed_off() breaks the scalar link on a narrowing spill by zeroing the id of the destination stack slot, but leaves the delta in place. save_register_state() has just copied the source register verbatim, so the slot keeps the BPF_ADD_CONST delta of a register it is no longer linked to. This is the same shape as the case addressed in 1b327732c846 ("bpf: Clear delta when clearing reg id for non-{add,sub} ops"). Unlike the latter, no miscomputation seems reachable, so mainly consistency. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Eduard Zingerman <eddyz87@gmail.com> Link: https://lore.kernel.org/r/20260910185604.44949-1-daniel@iogearbox.net Signed-off-by: Alexei Starovoitov <ast@kernel.org>
7 daysselftests/bpf: Add tests for the KF_PERFMON gatesDaniel Borkmann
Add test cases where each one loads with CAP_BPF alone and checks that the program is correctly rejected. # LDLIBS=-static PKG_CONFIG='pkg-config --static' ./vmtest.sh -- ./test_progs -t verifier_kfunc_perfmon [...] #627/1 verifier_kfunc_perfmon/rdonly_cast_noperfmon:OK #627/2 verifier_kfunc_perfmon/rdonly_cast_noperfmon @unpriv:OK #627/3 verifier_kfunc_perfmon/probe_read_kernel_dynptr_noperfmon:OK #627/4 verifier_kfunc_perfmon/probe_read_kernel_dynptr_noperfmon @unpriv:OK #627/5 verifier_kfunc_perfmon/stream_vprintk_noperfmon:OK #627/6 verifier_kfunc_perfmon/stream_vprintk_noperfmon @unpriv:OK #627/7 verifier_kfunc_perfmon/get_kmem_cache_noperfmon:OK #627/8 verifier_kfunc_perfmon/get_kmem_cache_noperfmon @unpriv:OK #627/9 verifier_kfunc_perfmon/arg_untrusted_read_noperfmon:OK #627/10 verifier_kfunc_perfmon/arg_untrusted_read_noperfmon @unpriv:OK #627 verifier_kfunc_perfmon:OK Summary: 1/10 PASSED, 0 SKIPPED, 0/0 FAILED Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/r/20260910213510.49358-4-daniel@iogearbox.net Signed-off-by: Alexei Starovoitov <ast@kernel.org>
7 daysbpf: Require CAP_PERFMON for untrusted read-only memory readsDaniel Borkmann
Marking bpf_rdonly_cast() KF_PERFMON CAP-limits one producer of PTR_TO_MEM | MEM_RDONLY | PTR_UNTRUSTED, but not the type itself. A global subprogram argument tagged __arg_untrusted results in the same register with no kfunc call. Reported-by: STAR Labs SG <info@starlabs.sg> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/r/20260910213510.49358-3-daniel@iogearbox.net Signed-off-by: Alexei Starovoitov <ast@kernel.org>
7 daysbpf: Require CAP_PERFMON for kfuncs reading memoryDaniel Borkmann
Mark fault-safe probe reading kfuncs as KF_PERFMON, similarly as we do for the old-style BPF helper equivalents. bpf_rdonly_cast() is included in this list as well as it returns PTR_TO_MEM | MEM_RDONLY | PTR_UNTRUSTED for an unchecked object and is using fault-safe BPF_PROBE_MEM. Note that only the void form of bpf_rdonly_cast() produced a register that was readable without CAP_PERFMON. For a struct type id the kfunc returns PTR_TO_BTF_ID | PTR_UNTRUSTED, whose dereference has always been gated in check_ptr_to_btf_access(). The flag is not conditional on the type id, so for the latter it only moves the rejection from the dereference to the call itself, which is the better place to report it anyway. The bpf_stream_vprintk() and bpf_stream_print_stack() kfuncs are marked as well. The former ends up in the same bpf_bprintf_prepare() as the bpf_snprintf() helper, where %pks, %pus and %pI4 read through a program- supplied address and %pB resolves one into a symbol. The latter walks the stack and prints each instruction pointer via %pS. Lastly, bpf_get_kmem_cache() takes a raw scalar address that the verifier does not constrain and dereferences the page/slab metadata for it. Field reads on the returned pointer are still blocked (PTR_TO_BTF_ID | PTR_UNTRUSTED -> check_ptr_to_btf_access() results in -EPERM without the CAP), but the NULL/non-NULL result is observable. Reported-by: STAR Labs SG <info@starlabs.sg> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/r/20260910213510.49358-2-daniel@iogearbox.net Signed-off-by: Alexei Starovoitov <ast@kernel.org>
7 daysbpf: Add KF_PERFMON kfunc flagDaniel Borkmann
Tracing related BPF helpers e.g. under bpf_base_func_proto() are gated behind CAP_PERFMON. However, the same is currently not true for kfuncs and they are accessible via plain CAP_BPF. Add a new KF_PERFMON flag which can be used such that check_kfunc_call() ensures env->allow_ptr_leaks is permitted. This follows similar pattern to existing KF_DESTRUCTIVE flag. The rejection returns -EPERM to match the other CAP_PERFMON gates in the verifier, that is, check_ptr_to_btf_access() and check_ptr_to_map_access(), which report the very same policy to user space. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/r/20260910213510.49358-1-daniel@iogearbox.net Signed-off-by: Alexei Starovoitov <ast@kernel.org>
7 daysMerge branches 'csd-lock.2026.09.03a', 'hazptr.2026.09.03a' and ↵Paul E. McKenney
'hrtimer_sleeper.2026.09.03a' into HEAD csd-lock.2026.09.03a: Report CSD-lock stall recovery time, add test hazptr.2026.09.03a: Hazard-pointer implementation and tests hrtimer_sleeper.2026.09.03a: KCSAN update for hrtimer_sleeper access
7 dayshrtimer: Apply READ_ONCE() to lockless base->running loadsPaul E. McKenney
Updates to base->running are protected by the hrtimer base lock, but some loads are lockless. Therefore, prevent compiler mischief by applying READ_ONCE() to the lockless loads. KCSAN located this issue. Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Cc: Anna-Maria Behnsen <anna-maria@linutronix.de> Cc: Frederic Weisbecker <frederic@kernel.org> Cc: Thomas Gleixner <tglx@kernel.org>
7 dayshazptr: handle NULL address in hazptr_detachMathieu Desnoyers
When hazptr_acquire loads a NULL pointer, it sets: - slot_item->slot.addr = NULL, - slot_item->ctx.ctx = ctx - ctx->slot = slot And it returns NULL. Then hazptr_detach is called on this ctx, it will act on the ctx as if needed to be promoted to backup slot, even though it has a NULL addr. Looking at what hazptr_note_context_switch() does before promoting to backup slot, it checks for a NULL slot->addr, which is exactly what is missing from hazptr_detach. With this in place there would be no need to explicitly check the hazptr_acquire() return value before calling hazptr_detach(). hazptr_release() has a early return check for NULL addr as well, so it makes sense that detach does an early return (no-op) similarly. Fixes: 6357ec235c59 ("hazptrtorture: Fix hazptr ownership issue") Reported-by: kernel test robot <yi1.lai@intel.com> Closes: https://lore.kernel.org/oe-lkp/202608130915.62b53936-lkp@intel.com Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Reviewed-by: Bradley Morgan <brads@mainlining.org> Cc: Paul E. McKenney <paulmck@kernel.org> Cc: Boqun Feng <boqun@kernel.org> Cc: Bradley Morgan <brads@mainlining.org> Cc: <rcu@vger.kernel.org> Cc: <lkmm@lists.linux.dev> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Tested-by: kernel test robot <yi1.lai@intel.com>
7 daysriscv: dts: spacemit: enable onboard eeprom for OrangePiChukun Pan
Enable the i2c2 bus and add the connected GT24C02B EEPROM. [ 6.766] TlvInfo Header: [ 6.766] Id String: TlvInfo [ 6.769] Version: 1 [ 6.772] Total Length: 38 [ 6.775] TLV Name Code Len Value [ 6.779] -------------------- ---- --- ----- [ 6.783] Base MAC Address 0x24 6 ..... [ 6.788] MAC Addresses 0x2A 2 2 [ 6.792] Product Name 0x21 15 x1_orangepi-r2s [ 6.797] Unknown 0x41 1 0x01 [ 6.801] CRC-32 0xFE 4 0xE5A74B18 [ 6.806] Checksum is valid. Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn> Tested-by: Gong Shuai <gsh517025@gmail.com> # OrangePi-RV2 Reviewed-by: Yixun Lan <dlan@kernel.org> Link: https://patch.msgid.link/20260901080010.95040-1-amadeus@jmu.edu.cn Signed-off-by: Yixun Lan <dlan@kernel.org>
7 daysriscv: dts: spacemit: sort nodes on OrangePi RV2Chukun Pan
Sort the nodes for DT. Also reorder the properties of the sdhci0 node. Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn> Acked-by: Yixun Lan <dlan@kernel.org> Link: https://patch.msgid.link/20260802100101.327815-1-amadeus@jmu.edu.cn Signed-off-by: Yixun Lan <dlan@kernel.org>
7 daysMerge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netJakub Kicinski
Cross-merge networking fixes after downstream PR (net-7.3-rc3). Conflicts: drivers/net/dsa/mt7530.c 3c18e3c9a54e ("net: dsa: mt7530: populate lpi_interfaces to fix EEE support") 10d9d8328e8a ("net: dsa: mt7530: replace mt7530_read with regmap_read") Adjacent changes: drivers/net/bonding/bond_alb.c 1746ef2e2df2 ("bonding: use skb_cow_head() in bond_do_alb_xmit() and rlb_arp_xmit()") 4cef95f72bbd ("bonding: fix u32 overflow in compute_gap()") Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 daysdrm/xe/hwmon: Use shared pcode default timeout for power limit writeKarthik Poosa
Drop the local PL_WRITE_MBX_TIMEOUT_MS macro and use the common PCODE_DEFAULT_TIMEOUT_MS for the power limit write mailbox command. This removes a duplicate timeout definition and keeps hwmon in sync with the pcode default (now 10ms). Signed-off-by: Karthik Poosa <karthik.poosa@intel.com> Link: https://patch.msgid.link/20260907083520.192418-3-karthik.poosa@intel.com Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
7 daysdrm/xe/pcode: Increase default pcode mailbox timeout to 10msKarthik Poosa
The previous 1ms timeout may be insufficient for some mailbox commands, leading to spurious -ETIMEDOUT failures under load. Increase the default timeout to 10ms and introduce PCODE_DEFAULT_TIMEOUT_MS for a shared timeout definition, in line with pcode mailbox specification guidance. Signed-off-by: Karthik Poosa <karthik.poosa@intel.com> Link: https://patch.msgid.link/20260907083520.192418-2-karthik.poosa@intel.com Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
7 daysworkqueue: Derive the standard attrs from the workqueue flagsBreno Leitao
alloc_and_link_pwqs() picks one of three static attrs arrays indexed by WQ_HIGHPRI, and branches to a separate apply_workqueue_attrs_locked() call for percpu, ordered and unbound workqueues. The arrays differ only in the nice level and the ordered bit, which the flags already say. Build the attrs from the flags instead. alloc_wq_std_attrs() sets nice for WQ_HIGHPRI and ordered for __WQ_ORDERED, which collapses the three branches into one call and drops the three arrays along with their workqueue_init_early() loop. The ordering WARN now sits behind its own __WQ_ORDERED test rather than the unbound branch. __WQ_ORDERED is internal and every macro that sets it pairs it with WQ_UNBOUND, so the WARN covers the same workqueues as before. The attrs are allocated per creation now. apply_wqattrs_prepare() already allocates one on the same path, including in workqueue_init_early(), so that is not a new constraint, and it only copies what it is given, so the caller can free them once apply_workqueue_attrs_locked() returns. Signed-off-by: Breno Leitao <leitao@debian.org> Signed-off-by: Tejun Heo <tj@kernel.org>
7 daysworkqueue: Give percpu workqueues their own max_activeBreno Leitao
wq->max_active means two different things, depending on how the workqueue is backed. On a concurrency managed per-cpu pool it caps pwq->nr_active, so it is a per-cpu limit. On an unbound pool it feeds wq_node_nr_active() and is shared by the whole workqueue. Tejun once said [1]: It kinda sucks that max_active's meaning is different across the boundary tho. Maybe percpu max_active should be separate into its own field, idk. Add wq->percpu_max_active for the first meaning and leave max_active as the system wide one. wq_adjust_max_active() updates whichever of the two applies, and min_active stays with max_active as only the unbound side uses it. Suggested-by: Tejun Heo <tj@kernel.org> Link: https://lore.kernel.org/all/amESSqf0TMmzhFGz@slm.duckdns.org/ [1] Signed-off-by: Breno Leitao <leitao@debian.org> Signed-off-by: Tejun Heo <tj@kernel.org>
7 daysMerge tag 'thermal-7.3-rc3' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull thermal control fix from Rafael Wysocki: "Replace snprintf() with scnprintf() in the thermal core sysfs code to avoid compiler warnings about potential truncation of the names of the sysfs attributes (Andy Shevchenko)" * tag 'thermal-7.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: thermal: sysfs: switch to use scnprintf() to suppress truncation warning
7 daysMerge tag 'pm-7.3-rc3' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management fixes from Rafael Wysocki: "These harden the cpufreq core against races with sysfs during policy creation, fix two issues in the OPP (Operating Performance Points) library, and make OPP print symbolic error names: - Zero-initialize the policy cpumask and initialize the policy rwsem before exposing the policy sysfs interface (Runyu Xiao and Zhongqiu Han) - Fix potential multiplication overflow when calculating freq in OPP core (Colin Ian King) - Fix use after free in _update_opp_table_clk() (Peter Griffin) - Use %pe to print symbolic error name in OPP (Sumeet Pawnikar)" * tag 'pm-7.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: opp: fix use after free in _update_opp_table_clk() cpufreq: zero-initialize policy cpumask before sysfs publication cpufreq: initialize policy rwsem before sysfs publication opp: Use %pe to print symbolic error name OPP: of: Fix potential multiplication overflow when calculating freq
7 daysMerge tag 'hwmon-for-v7.3-rc3' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon fixes from Guenter Roeck: - Core - Fix potential UAF in pec_store - Ensure that 'dev' passed to hwmon_notify_event() is a hwmon device - Document hwmon_notify_event() - applesmc: Fix key backlight workqueue leak on register failure - aspeed-pwm-tacho: Propagate reset deassert errors - asus_rog_ryujin: HID report fixes - chipcap2: Fix channels in humidity alarm notifications - corsair-cpro: debugfs fixes - gpd-fan: Documentation: replace full-width colon by a standard ASCII colon - gpio-fan: Take fan_data->lock in gpio_fan_shutdown(), and fix use-after-free in alarm work - ina2xx: Fix in0 and curr1 alarm handling, and acquire hwmon_lock in shunt_resistor_show() - ltc4282: Fully initializeclk_init_data - mcp9982: Propagate one-shot polling errors - nct6694: Do not expose enable on DTIN temperature channels - PMBus core: Clear generic status alarms with CLEAR_FAULTS - sht4x: Fix return value from heater_enable_store(), and add missing locks * tag 'hwmon-for-v7.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (24 commits) hwmon: (nct6694) do not expose enable on DTIN temperature channels hwmon: (asus_rog_ryujin) Synchronize HID command and report handling hwmon: (asus_rog_ryujin) Validate HID report lengths hwmon: (corsair-cpro) Remove debugfs entries when probe fails hwmon: (aspeed-pwm-tacho) Propagate reset deassert errors hwmon: (gpio-fan) take fan_data->lock in gpio_fan_shutdown() hwmon: (corsair-cpro) Create debugfs entries after hwmon registration hwmon: (pmbus) Clear generic status alarms with CLEAR_FAULTS hwmon: (chipcap2) fix channels in humidity alarm notifications hwmon: (applesmc) fix key backlight workqueue leak on register failure hwmon: (sht4x) Fix return value from heater_enable_store() hwmon: (sht4x) Add missing locks hwmon: (yogafan) fix non-kernel-doc comment Documentation: hwmon: replace full-width colon by a standard ASCII colon hwmon: (ina2xx) Decouple in0 and curr1 alarms hwmon: (ina2xx) Replace masks with enum in alert functions hwmon: (ina2xx) Parameterize ina2xx_data in ina226_alert_read() hwmon: Ensure that 'dev' passed to hwmon_notify_event() is a hwmon device hwmon: (ina2xx) Acquire hwmon_lock in shunt_resistor_show() hwmon: Fix potential UAF in pec_store ...
7 dayswifi: ath12k: add support to load shared firmware on multiPDAaradhana Sahu
IPQ5332 platform uses a MultiPD architecture where multiple firmware instances share common read-only code segments. The driver currently loads only the per-UserPD firmware, which leaves the shared read-only firmware unloaded. Add support for loading the shared read-only firmware once before the UserPDs are powered up. The shared segment contains common code that is identical across all UserPDs and reduces the total firmware memory requirement. Store the reserved memory mapping in struct ath12k_ahb_rproc_info so it can be shared by all UserPDs and mapped only once. Keep the mapping valid across UserPD power cycles, and unmap it when the last UserPD is removed. Shut down the shared firmware from the rproc deconfiguration path when the last UserPD is removed. Also, pass NULL for the reloc_base parameter because the driver uses fixed memory regions configured through device tree and does not need the adjusted physical address after relocation. Tested-on: IPQ5332 hw1.0 AHB WLAN.WBE.1.6-01275-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aaradhana Sahu <aaradhana.sahu@oss.qualcomm.com> Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com> Link: https://patch.msgid.link/20260811054316.518494-1-aaradhana.sahu@oss.qualcomm.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
7 dayswifi: ath9k: use rcu_dereference_bh() for sta->rates in ath_merge_ratetbl()Jeff Johnson
Commit c4f518736472 ("wifi: ath9k: Remove redundant rcu_read_lock/unlock() in spin_lock") removed the explicit rcu_read_lock()/rcu_read_unlock() pair from ath_txq_schedule(), relying on spin_lock_bh() to provide an implicit RCU read-side critical section. That is correct on kernels without CONFIG_DEBUG_LOCK_ALLOC, where rcu_read_lock_any_held() falls back to !preemptible() as a proxy, and spin_lock_bh() disables preemption. However, rcu_dereference() in ath_merge_ratetbl() checks rcu_read_lock_held(), which under CONFIG_DEBUG_LOCK_ALLOC only returns true when lock_is_held(&rcu_lock_map) — set exclusively by an explicit rcu_read_lock(). A spin_lock_bh() does not set rcu_lock_map, so on a CONFIG_DEBUG_LOCK_ALLOC + CONFIG_PROVE_RCU kernel, any call path that reaches ath_merge_ratetbl() with a non-NULL sta will produce a lockdep splat. The correct fix is to use rcu_dereference_bh(), whose validity check calls rcu_read_lock_bh_held(), which returns true whenever BH is disabled (in_softirq() || irqs_disabled()). This matches the actual protection at all callers of ath_set_rates() that pass a non-NULL sta: they all hold a spin_lock_bh() (either sc->chan_lock or txq->axq_lock). Fixes: c4f518736472 ("wifi: ath9k: Remove redundant rcu_read_lock/unlock() in spin_lock") Assisted-by: LLM Acked-by: Toke Høiland-Jørgensen <toke@toke.dk> Link: https://patch.msgid.link/20260813-ath9k-rcu-fix-v1-1-424665a1ce60@oss.qualcomm.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
7 daysMerge tag 'net-7.3-rc3' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Nothing too exciting, usual stream of fixes. Including fixes from Netfilter, Bluetooth and WPAN. Current release - new code bugs: - Bluetooth: hci_sync: fix not setting CE length properly - eth: enic: match mailbox replies to request numbers Previous releases - regressions: - tunnels: drop stale dst when building an ICMP error for PMTUD - ipv6: null-check fib6_node before accessing in __ip6_del_rt_siblings() (bug in the rtnl_lock -> RCU conversion) - eth: bnxt_en: - fix crashes on Thor2 due to OOB coalescing buffer accesses - prevent queue stop with deferred completions Previous releases - always broken: - eth: - ice: don't dereference pointers from TP_printk() - fix OOB writes on ethtool flow rule dump in 3 drivers - mlx5: fix FEC configuration with RS_544_514_INTERLEAVED_QUAD - dsa: tag_brcm: legacy FCS: request needed tailroom Misc: - net: cap tx_queue_len at S16_MAX to prevent oversized ring alloc - ipv6: flowlabel: cap duplicate leases per socket" * tag 'net-7.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (164 commits) selftests: tc-testing: test action batch failure cleanup net/sched: act_api: release all action references on NEWACTION failure openvswitch: fix wrong flag value in get_ipv6_ext_hdrs() ipmr: account multicast table and route memory net: phy: dp83td510: handle the active-high LED polarity mode net: macb: initialize PTP state before registering clock net: hsr: enable promiscuous mode on interlink port with fwd offload ipv6: fix fib6 walker UAF on seq stop net: stmmac: fix TX descriptor availability check for TSO traffic net/rds: fix tcp stream corruption with large pages net: mana: restore the XDP program pointer when pre-allocation fails net: phy: dp83867: handle the active-high LED polarity mode octeontx2-af: fix PF/CGX debugfs PCI bus lookup net: net_failover: Fix the deadlock in net_failover_slave_name_change() net: phy: mediatek-ge: disable EEE on the MT7530 PHY tcp: reject non zerocopy devmem tx net: ethernet: mtk_eth_soc: populate lpi_interfaces to fix EEE support net: dsa: mt7530: populate lpi_interfaces to fix EEE support net: hinic: fix mailbox segment buffer overflow net: sun4i-emac: fix missing of_node_put() for phy_node ...
7 daysMerge tag 'cifs-fixes-7.3-rc3' of https://git.manguebit.org/linuxLinus Torvalds
Pull smb client fixes from Paulo Alcantara: - File type corruption fixes in reparse point handling: setting S_IFMT bits without clearing the existing type first corrupted the file mode (e.g. S_IFREG | S_IFCHR == S_IFLNK). Fixed in the WSL, POSIX and native symlink reparse parsers. Also fixes an uninitialized SID structure in the POSIX readdir path when parsing fails. - Ownership mapping fixes: forceuid/forcegid mount options were ignored in several code paths (SID-to-id mapping, WSL extended attributes, POSIX extensions getattr), allowing an untrusted server to dictate local file ownership despite explicit mount overrides. - Heap overflow and overflow fixes in DACL rewriting: replacing short SIDs with long ones could overflow the DACL buffer, and the u16 accumulator for DACL size could wrap around with enough ACEs. - Reference count leak fixes in oplock break and deferred close: duplicate oplock breaks on a queued work item leaked a cifsFileInfo reference, and deferred close had a similar leak when requeueing a running work item. Both cause busy-inode oopses on unmount. - DFS superblock use-after-free fix: the iterator callback stored a raw superblock pointer without pinning it, racing with automount expiry. - One-byte slab OOB read in the native symlink parser when handling share-root relative paths. - Hardening of legacy SMB1 input: reject userspace-crafted cifs.idmap key descriptions that bypass kernel origin checks, and validate DataOffset in CIFSSMBRead() to prevent heap info disclosure from a malicious server. - DFS cache fix: defer metadata updates until target copying succeeds to prevent partial-state cache entries on allocation failure. * tag 'cifs-fixes-7.3-rc3' of https://git.manguebit.org/linux: smb: client: fix one-byte OOB read in smb2_parse_native_symlink() smb: client: fail DACL rewrite when the new DACL exceeds 64K smb: client: fix heap overflow in DACL owner/group rewrite smb: client: fix file type corruption in cifs_reparse_point_to_fattr() smb: client: fix file type corruption in posix_reparse_to_fattr() smb: client: fix file type corruption in wsl_to_fattr() smb: client: avoid using uninitialized SIDs in cifs_posix_to_fattr() smb: client: fix WSL reparse point uid/gid override smb: client: honor forceuid/forcegid when mapping SIDs to uid/gid smb: client: fix uid/gid override in getattr with posix extensions smb: client: fix cifsFileInfo reference leak in deferred close smb: client: avoid leaking refcount when cifs_sb_tlink() fails smb: client: avoid leaking refcount in cifs_queue_oplock_break() smb: client: fill cache fields after populating cache in copy_ref_data() smb: client: pin DFS superblock in iterator callback smb: client: reject userspace cifs.idmap descriptions smb: client: reject out-of-bounds DataOffset in CIFSSMBRead() smb: client: reject short READ responses in CIFSSMBRead()
7 daysfbdev: vfb: defer cleanup until the last referenceWeiming Shi
FBIOGETCMAP takes a shallow snapshot of info->cmap and performs the usercopy after dropping info->lock. vfb_remove() frees the colormap immediately after unregistering the framebuffer, even when an open file still holds a reference to fb_info. A concurrent driver unbind can therefore free the colormap while the ioctl copies it to userspace. KASAN reports: BUG: KASAN: slab-use-after-free in _copy_to_user Read of size 512 by task poc/125 _copy_to_user (./include/linux/instrumented.h:129 ./include/linux/uaccess.h:201 lib/usercopy.c:24) fb_cmap_to_user (./include/linux/uaccess.h:230 drivers/video/fbdev/core/fbcmap.c:211) do_fb_ioctl (drivers/video/fbdev/core/fb_chrdev.c:114) Allocated by task 1: fb_alloc_cmap_gfp (./include/linux/slab.h:973 ./include/linux/slab.h:1290 drivers/video/fbdev/core/fbcmap.c:108) vfb_probe (drivers/video/fbdev/vfb.c:459) Freed by task 124: fb_dealloc_cmap (drivers/video/fbdev/core/fbcmap.c:151) vfb_remove (drivers/video/fbdev/vfb.c:489) unregister_framebuffer() drops the registration reference, and fbdev calls fb_destroy after the last put_fb_info(). Move the registered framebuffer's cleanup into an fb_destroy callback so its colormap and screen buffer stay alive until all file references have been released. Fixes: 5e266e2e0e19 ("vfb: fix memory leaks in removal path") Reported-by: co+c25629c98ba36ebe@bugs.sh Cc: stable@kernel.org Closes: https://lore.kernel.org/linux-fbdev/f2Kf9GYn1lKR5S1dbvGVtykMxK1RlgP5z8sW@bugs.sh/ Assisted-by: Codex:gpt-5 Signed-off-by: Weiming Shi <bestswngs@gmail.com> Link: https://lore.kernel.org/linux-fbdev/f2Kf9GYn1lKR5S1dbvGVtykMxK1RlgP5z8sW@bugs.sh/ Signed-off-by: Helge Deller <deller@gmx.de>