6.1.188-rc1 review
Subsystems (3)
Greg Kroah-Hartman
maintainerPATCH 1074/1191 rtc: gamecube: check return value of devm_rtc_register_device()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linkai Gong <[email protected]>
[ Upstream commit ca45cfa74370644d371b552bef57938c19e3c80c ]
gamecube_rtc_probe() ignored the return value of devm_rtc_register_device() and always returned success. Propagate the error so probe fails when RTC registration fails.
--- drivers/rtc/rtc-gamecube.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/rtc/rtc-gamecube.c +1 -3
@@ -355,9 +355,7 @@ static int gamecube_rtc_probe(struct platform_device *pdev) rtc->range_max =U32_MAX ; rtc->ops = &gamecube_rtc_ops; -devm_rtc_register_device (rtc); - -return 0 ; +return devm_rtc_register_device (rtc); }static const struct of_device_id gamecube_rtc_of_match[] = {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1075/1191 prctl: fix PR_SET_MM_AUXV losing the forced AT_NULL terminator
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bradley Morgan <[email protected]>
[ Upstream commit 5146e0688d86f0654263e4b0e4ff1719b4072f16 ]
prctl_set_auxv() copies the user vector into a stack buffer, forces AT_NULL on the last two entries there, and then copies only len bytes into mm->saved_auxv. Which is fine until the vector is shorter than the buffer, because then the forced terminator sits past the end of the copy and never lands in saved_auxv at all.
The code even says
/* Make sure the last entry is always AT_NULL */
and it does, just not in the part that gets copied.
So mm->saved_auxv keeps the stale tail from exec. Reproducing it is easy:
from a process with CAP_SYS_RESOURCE (just run it as root), call prctl(PR_SET_MM, PR_SET_MM_AUXV, ...) with a vector that has a couple of entries and no AT_NULL inside len (32 bytes on arm64), and then hexdump /proc/self/auxv, or gcore the process and look at the AUXV note with readelf -n. This is arm64, the new vector was just { AT_UID, 0x1111, AT_GID, 0x2222 }:
idx before (from exec) after the prctl
[0] AT_SYSINFO_EHDR 0x7ed1d6e000 AT_UID 0x1111 <- new
[1] AT_MINSIGSTKSZ 0x1270 AT_GID 0x2222 <- new
[2] AT_HWCAP 0x119fff AT_HWCAP 0x119fff <- stale
[3] AT_PAGESZ 0x1000 AT_PAGESZ 0x1000 <- stale
... 16 more entries ... <- stale
[20] AT_NULL 0x0 AT_NULL 0x021 entries before the prctl, still 21 after: the two new ones plus all 19 left over from exec.
Every consumer walks the vector until AT_NULL, so what they get now is a vector that never existed at exec, the head from the prctl glued onto the tail of the old binary. gdb and crash pull the AUXV note out of coredumps to find AT_PHDR, AT_ENTRY, AT_SYSINFO_EHDR and friends, and a mixed vector points them at the wrong layout. /proc/<pid>/auxv and PR_GET_AUXV hand the same mess out to live processes too. Nothing crashes, everything just quietly reads a frankenstein auxv.
And callers that terminate their own vector hide the whole thing, which is likely why nobody noticed since PR_SET_MM_AUXV landed in 2012. Nothing exciting security wise either, I mean it needs CAP_SYS_RESOURCE to begin with.
prctl_set_mm_map() right above already copies the whole buffer for exactly this reason, so just do the same here. user_auxv is zero initialized and only partially filled from userspace, so the rest is zeros and nothing leaks.
--- kernel/sys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sys.c +1 -1
@@ -2142,7 +2142,7 @@ static int prctl_set_auxv(struct mm_struct *mm, unsigned long addr,BUILD_BUG_ON (sizeof (user_auxv) !=sizeof (mm->saved_auxv));task_lock (current); -memcpy (mm->saved_auxv, user_auxv, len); +memcpy (mm->saved_auxv, user_auxv,sizeof (user_auxv));task_unlock (current);return 0 ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1076/1191 clk: ti: Make sure clk_init_data is fully initialized
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
[ Upstream commit 3ae1674975d48fb6d343d03ff7961abd6904af1a ]
The clk_init_data structure contains several mutually-exclusive members for different methods to specify the possible parents of a clock, prompting drivers to initialize only the members they need. However, not initializing all members may cause subtle issues, which are only exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is enabled.
_register_mux() fills in init.parent_data, and assumes that init.parent_names is NULL. However, the latter is uninitialized, and thus may cause a crash.
Make sure all members are fully initialized, to fix such bugs, and to avoid future breakage when converting drivers to a different method for specifying the parents.
--- drivers/clk/ti/adpll.c | 4 ++-- drivers/clk/ti/divider.c | 2 +- drivers/clk/ti/mux.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/clk/ti/adpll.c +2 -2
@@ -481,7 +481,7 @@ static const struct clk_ops ti_adpll_ops = {static int ti_adpll_init_dco (struct ti_adpll_data *d) { -struct clk_init_data init; +struct clk_init_data init = {};struct clk *clock;const char *postfix;int width, err;
@@ -574,7 +574,7 @@ static int ti_adpll_init_clkout(struct ti_adpll_data *d, struct clk *clk1) {struct ti_adpll_clkout_data *co; -struct clk_init_data init; +struct clk_init_data init = {};struct clk_ops *ops;const char *parent_names[2 ];const char *child_name;
drivers/clk/ti/divider.c +1 -1
@@ -309,7 +309,7 @@ static struct clk *_register_divider(struct device_node *node,u32 flags, struct clk_omap_divider *div) { - struct clk_init_data init; + struct clk_init_data init = {};const char *parent_name;const char *name;
drivers/clk/ti/mux.c +1 -1
@@ -124,9 +124,9 @@ static struct clk *_register_mux(struct device_node *node, const char *name, struct clk_omap_reg *reg, u8 shift, u32 mask, s8 latch, u8 clk_mux_flags, u32 *table) { + struct clk_init_data init = {};struct clk_omap_mux *mux;struct clk *clk; -struct clk_init_data init;/* allocate the mux */ mux =kzalloc (sizeof (*mux),GFP_KERNEL );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1077/1191 clk: visconti: Make sure clk_init_data is fully initialized
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
[ Upstream commit 39c0e6c844a14945040cca4ccf6997792ab764c4 ]
The clk_init_data structure contains several mutually-exclusive members for different methods to specify the possible parents of a clock, prompting drivers to initialize only the members they need. However, not initializing all members may cause subtle issues, which are only exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is enabled.
visconti_clk_register_gate() fills in init.parent_data, and assumes that init.parent_names is NULL. However, the latter in uninitialized, and thus may cause a crash.
Make sure all members are fully initialized, to fix such bugs, and to avoid future breakage when converting drivers to a different method for specifying the parents.
--- drivers/clk/visconti/clkc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/visconti/clkc.c +1 -1
@@ -81,9 +81,9 @@ static struct clk_hw *visconti_clk_register_gate(struct device *dev,u8 rs_idx, spinlock_t *lock) { + struct clk_init_data init = {};struct visconti_clk_gate *gate;struct clk_parent_data *pdata; -struct clk_init_data init;struct clk_hw *hw;int ret;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1078/1191 RDMA/ucma: Allow path records to exactly fit the output buffer
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Serhat Kumral <[email protected]>
[ Upstream commit 8049741ac93acd3a590dac070e12571fddf0e294 ]
ucma_query_path() emits a path record only when the remaining output buffer is strictly larger than struct ib_path_rec_data. A buffer sized exactly for the response header and N complete records therefore gets only N - 1 records, while resp->num_paths still advertises N. A caller sizing its buffer for a single record gets a header claiming one path and no path data at all.
ucma_query_ib_service() in the same file computes the record count with a plain division and so accepts an exact fit; make ucma_query_path() behave the same way.
Current librdmacm is unaffected because it always sizes the response for six records while the kernel currently reports at most two paths. Other users of the UAPI that provide an exactly sized buffer can observe the truncated response.
--- drivers/infiniband/core/ucma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/core/ucma.c +1 -1
@@ -923,7 +923,7 @@ static ssize_t ucma_query_path(struct ucma_context *ctx, resp->num_paths = ctx->cm_id->route.num_pri_alt_paths;for (i =0 , out_len -=sizeof (*resp); - i < resp->num_paths && out_len >sizeof (struct ib_path_rec_data ); + i < resp->num_paths && out_len >=sizeof (struct ib_path_rec_data ); i++, out_len -=sizeof (struct ib_path_rec_data )) {struct sa_path_rec *rec = &ctx->cm_id->route.path_rec[i];
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1079/1191 net: bridge: Reject descending VLAN tunnel ranges
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ruoyu Wang <[email protected]>
[ Upstream commit b74a072d8fb71d3c9ffba4a17d5943e63266fb38 ]
A pair of descending VLAN and tunnel IDs can pass the tunnel range span check. The VLAN subtraction produces a negative int, which is converted to unsigned when compared with the u32 tunnel ID subtraction. It can therefore equal the wrapped tunnel ID delta.
The range loop then performs no iterations. Since the batched notification handling added a post-loop error check, this leaves err uninitialized and makes the request's return value unpredictable.
Reject descending VLAN ranges before comparing the spans. Valid ascending and single-entry ranges remain unchanged, while malformed descending ranges consistently return -EINVAL.
This issue was found by a static analysis checker and confirmed by manual source review.
--- net/bridge/br_netlink_tunnel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/bridge/br_netlink_tunnel.c +2 -1
@@ -299,7 +299,8 @@ int br_process_vlan_tunnel_info(const struct net_bridge *br,if (!(tinfo_last->flags &BRIDGE_VLAN_INFO_RANGE_BEGIN ))return -EINVAL ; -if ((tinfo_curr->vid - tinfo_last->vid) != +if (tinfo_curr->vid < tinfo_last->vid || + (tinfo_curr->vid - tinfo_last->vid) != (tinfo_curr->tunid - tinfo_last->tunid))return -EINVAL ; t = tinfo_last->tunid;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1080/1191 net: thunderbolt: Count delivered packets in rx_packets and rx_bytes
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fan Ye <[email protected]>
[ Upstream commit c5ae83ee02c04487b1be1d143b791ec2caca888e ]
tbnet_poll() increments rx_packets once per received frame because that is the NAPI work unit, and then adds the same number to stats.rx_packets. An skb is handed to the stack only when the last frame of a packet arrives, so once the MTU exceeds TBNET_MAX_PAYLOAD_SIZE the statistic reports frames. tx_packets is bumped once per skb, so the two ends of a link
disagree: at MTU 65330 the receiver reports 16 times the packets its sender sent.
rx_bytes has the matching problem: frames of a packet that is later dropped mid-assembly are already accounted, so it does not correspond to rx_packets as documented. Account for both where the packet is completed, and leave the NAPI work counter alone.
--- drivers/net/thunderbolt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/thunderbolt.c +3 -3
@@ -856,17 +856,17 @@ static int tbnet_poll(struct napi_struct *napi, int budget) last = net->rx_hdr.frame_index == net->rx_hdr.frame_count -1 ; rx_packets++; - net->stats.rx_bytes += frame_size;if (last) { +/* Before eth_type_trans() pulls the Ethernet header. */ + net->stats.rx_packets++; + net->stats.rx_bytes += skb->len; skb->protocol =eth_type_trans (skb, net->dev);napi_gro_receive (&net->napi, skb); net->skb =NULL ; } } - net->stats.rx_packets += rx_packets; -if (cleaned_count)tbnet_alloc_rx_buffers (net, cleaned_count);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1081/1191 forcedeth: stop the tx_timeout register dump past the requested window
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Czernohous <[email protected]>
[ Upstream commit cfa9178ce2e5b4f2e2a9e8b577a6cff841665aa0 ]
nv_tx_timeout() dumps the register window in rows of eight dwords:
for (i = 0; i <= np->register_size; i += 32) {
netdev_info(dev, "%3x: %08x ... %08x\n", i,
readl(base + i + 0), ..., readl(base + i + 28));The loop bound only checks the row's starting offset, so the final row reads a full 32 bytes from a position that is below the end of the window but too close to it. base is mapped with exactly that length:
np->base = ioremap(addr, np->register_size);
so the tail of that row is read from beyond the length the driver asked for. Per variant, the last iteration reads past register_size by:
NV_PCI_REGSZ_VER1 (0x270): row 0x260 reads to 0x27f, 16 bytes over NV_PCI_REGSZ_VER2 (0x2d4): row 0x2c0 reads to 0x2df, 12 bytes over NV_PCI_REGSZ_VER3 (0x604): row 0x600 reads to 0x61f, 28 bytes over
This happens on every supported device, not just one of them. Note that it is not a consequence of the sizes being odd: with i <= register_size the offending row is reached whatever the size, and a size that were a multiple of 32 would overrun by a full row rather than by a remainder.
To be precise about the severity: the reads stay inside the BAR. Memory BAR sizes are powers of two, the driver only accepts a region with pci_resource_len() >= register_size (forcedeth.c:5757-5762), and the next power of two at or above each register_size already covers the offending row: 0x400 for 0x270 and 0x2d4, 0x800 for 0x604. ioremap() also rounds the mapped length up to page granularity, so the reads land inside the mapping the CPU has as well. What they leave is the window the driver asked for, not the BAR and not the mapping. That is still a driver reading registers it did not ask for, and it is trivial to avoid, but nobody should expect a fault from it.
Changing <= to < is not enough: register_size is a length and every size above is larger than its last row start, so i still reaches the offending row. Check that the whole row fits instead.
The trade-off is that a partial trailing row is no longer dumped: 16 bytes for VER1, 20 for VER2, 4 for VER3. That seemed preferable to reading outside the requested window, and to open-coding a second, narrower dump for the remainder in what is a debug-only path. Extending the dump to cover the tail can be done on top if anyone misses those registers.
Only reachable with the debug_tx_timeout module parameter, which defaults to false. It has not been observed at runtime: forcing a genuine TX timeout on the reference machine is not something I can do safely, so this rests on the arithmetic above and on a build test, not on a reproduction. UBSAN does not catch it either, since these are MMIO reads rather than an array access. It was found by reading the function while fixing the saved_config_space off-by-one in nv_suspend() and nv_resume().
The dump was introduced with a fixed 0x400 bound while ioremap() mapped only NV_PCI_REGSZ (0x270), so it read about 0x190 bytes too far from the start. Commit 86a0f04387bf ("[PATCH] forcedeth: fix initialization") later replaced 0x400 with np->register_size, which shrank the overrun to the remainder but did not remove it.
--- drivers/net/ethernet/nvidia/forcedeth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/nvidia/forcedeth.c +1 -1
@@ -2754,7 +2754,7 @@ static void nv_tx_timeout(struct net_device *dev, unsigned int txqueue)netdev_info (dev,"Ring at %lx\n" , (unsigned long )np->ring_addr);netdev_info (dev,"Dumping tx registers\n" ); -for (i =0 ; i <= np->register_size; i +=32 ) { +for (i =0 ; i +32 <= np->register_size; i +=32 ) { netdev_info(dev, "%3x: %08x %08x %08x %08x " "%08x %08x %08x %08x\n",
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1082/1191 net: ipa: Convert to platform remove callback returning void
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Uwe Kleine-König <[email protected]>
[ Upstream commit a92dbb9cdf0465d56c7e0fc5d674e6834f7c6a79 ]
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove callback to the void returning variant.
Stable-dep-of: 6b9eaa61ff2d ("net: ipa: balance runtime PM reference on remove error")
--- drivers/net/ipa/ipa_main.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-)
drivers/net/ipa/ipa_main.c +13 -16
@@ -854,7 +854,7 @@ static int ipa_probe(struct platform_device *pdev)return ret; } -static int ipa_remove (struct platform_device *pdev) +static void ipa_remove (struct platform_device *pdev) {struct ipa *ipa =dev_get_drvdata (&pdev->dev);struct ipa_power *power = ipa->power;
@@ -877,8 +877,16 @@ static int ipa_remove(struct platform_device *pdev)usleep_range (USEC_PER_MSEC ,2 *USEC_PER_MSEC ); ret =ipa_modem_stop (ipa); } -if (ret) -return ret; +if (ret) { +/* +* Not cleaning up here properly might also yield a +* crash later on. As the device is still unregistered +* in this case, this might even yield a crash later on. +*/ +dev_err (dev,"Failed to stop modem (%pe), leaking resources\n" , +ERR_PTR (ret)); +return ; + }ipa_teardown (ipa); }
@@ -896,17 +904,6 @@ static int ipa_remove(struct platform_device *pdev)ipa_power_exit (power);dev_info (dev,"IPA driver removed" ); - -return 0 ; -} - -static void ipa_shutdown (struct platform_device *pdev) -{ -int ret; - - ret =ipa_remove (pdev); -if (ret) -dev_err (&pdev->dev,"shutdown: remove returned %d\n" , ret); }static const struct attribute_group *ipa_attribute_groups[] = {
@@ -919,8 +916,8 @@ static const struct attribute_group *ipa_attribute_groups[] = {static struct platform_driver ipa_driver = { .probe = ipa_probe, - .remove = ipa_remove, - .shutdown = ipa_shutdown, + .remove_new = ipa_remove, + .shutdown = ipa_remove, .driver = { .name ="ipa" , .pm = &ipa_pm_ops,
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1083/1191 net: ipa: balance runtime PM reference on remove error
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ruoyu Wang <[email protected]>
[ Upstream commit 6b9eaa61ff2df63c6eb35d5cd025e2cef0861d76 ]
ipa_remove() takes a runtime PM reference before accessing IPA hardware during teardown. If a concurrent modem start or stop keeps ipa_modem_stop() busy across both attempts, the callback intentionally returns without releasing the remaining resources because proceeding with teardown could crash. That return also skips the matching pm_runtime_put_noidle(), leaving the callback's usage-count reference held.
Drop only this runtime PM reference before returning. pm_runtime_put_noidle() does not request an idle transition, so the hardware and resources retained on this exceptional path remain untouched while the usage count stays balanced.
This issue was found by a static analysis checker and confirmed by manual source review.
--- drivers/net/ipa/ipa_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ipa/ipa_main.c +3 -3
@@ -879,12 +879,12 @@ static void ipa_remove(struct platform_device *pdev) }if (ret) {/* -* Not cleaning up here properly might also yield a -* crash later on. As the device is still unregistered -* in this case, this might even yield a crash later on. +* Continuing teardown after failing to stop the modem +* could crash, so leave the remaining resources allocated. */ dev_err (dev,"Failed to stop modem (%pe), leaking resources\n" ,ERR_PTR (ret)); +pm_runtime_put_noidle (dev);return ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1084/1191 inetpeer: randomize RB-tree node comparison using SipHash
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 2ee66e9487172fcd189bc52a767c30dad7141c09 ]
The inetpeer rate limiting system stores peer entries in a Red-Black tree keyed deterministically on the remote IP address. Because tree lookups walk the RB-tree using standard lexicographical comparisons (inetpeer_addr_cmp), an off-path adversary can predict the exact topology of the tree and the sequence of nodes traversed during lookups (the gc_stack candidate list).
By combining deterministic tree traversal with aggressive garbage collection (triggered when tree size exceeds inet_peer_threshold), an attacker can selectively force the eviction of targeted inet_peer nodes. When an evicted node is subsequently re-created upon receiving a new packet, its rate-limiting token bucket (rate_tokens, rate_last) is reset to full capacity. This creates a side-channel primitive allowing off-path attackers to bypass IP-keyed ICMP rate limits and infer open UDP ports (similar to SAD DNS style attacks).
Mitigate this by randomizing the RB-tree node comparison logic using SipHash with a secret key (inetpeer_hash_key) initialized via net_get_random_once(). Nodes are ordered in the tree by SipHash(addr, key) rather than raw IP addresses. Because the secret key is unknown to external entities, the tree layout and lookup traversal paths are unpredictable to off-path adversaries, breaking the deterministic eviction gadget.
Cache the computed 64-bit SipHash (hash) in struct inet_peer and compute the target hash (dhash) once at the beginning of inet_getpeer() to avoid recomputing SipHash at every step of the RB-tree walk.
--- include/net/inetpeer.h | 4 ++++ net/ipv4/inetpeer.c | 38 +++++++++++++++++++++++++++++++++++--- 2 files changed, 39 insertions(+), 3 deletions(-)
include/net/inetpeer.h +4 -0
@@ -35,6 +35,7 @@ struct inetpeer_addr {struct inet_peer {struct rb_node rb_node; +u64 hash;struct inetpeer_addr daddr;u32 metrics[RTAX_MAX ];
@@ -125,6 +126,9 @@ static inline int inetpeer_addr_cmp(const struct inetpeer_addr *a, {int i, n; +if (a->family != b->family) +return a->family < b->family ?-1 :1 ; +if (a->family ==AF_INET ) n =sizeof (a->a4) /sizeof (u32);else
net/ipv4/inetpeer.c +35 -3
@@ -22,6 +22,7 @@#include <net/ip.h> #include <net/inetpeer.h> #include <net/secure_seq.h> +#include <linux/siphash.h> /* * Theory of operations.
@@ -53,6 +54,34 @@*/ static struct kmem_cache *peer_cachep__ro_after_init ; +static siphash_aligned_key_t inetpeer_hash_key__read_mostly ; + +static u64 inetpeer_addr_hash (const struct inetpeer_addr *a) +{ +net_get_random_once (&inetpeer_hash_key,sizeof (inetpeer_hash_key)); + +if (a->family ==AF_INET ) +return siphash_2u32 ((__force u32 )a->a4.addr, a->a4.vif, + &inetpeer_hash_key); + +return siphash_4u32 ((__force u32 )a->a6.s6_addr32[0 ], + (__force u32 )a->a6.s6_addr32[1 ], + (__force u32 )a->a6.s6_addr32[2 ], + (__force u32 )a->a6.s6_addr32[3 ], + &inetpeer_hash_key); +} + +static int inetpeer_entry_cmp (u64 dhash, +const struct inetpeer_addr *daddr, +const struct inet_peer *p) +{ +if (dhash < p->hash) +return -1 ; +if (dhash > p->hash) +return 1 ; + +return inetpeer_addr_cmp (daddr, &p->daddr); +}void inet_peer_base_init (struct inet_peer_base *bp) {
@@ -89,6 +118,7 @@ void __init inet_initpeers(void)/* Called with rcu_read_lock() or base->lock held */ static struct inet_peer *lookup(const struct inetpeer_addr *daddr, + u64 dhash, struct inet_peer_base *base, unsigned int seq, struct inet_peer *gc_stack[],
@@ -110,7 +140,7 @@ static struct inet_peer *lookup(const struct inetpeer_addr *daddr,break ; parent = next; p = rb_entry(parent, struct inet_peer, rb_node); - cmp =inetpeer_addr_cmp (daddr, &p->daddr); + cmp =inetpeer_entry_cmp (dhash, daddr, p);if (cmp ==0 ) { now = jiffies;if (READ_ONCE (p->dtime) != now)
@@ -180,6 +210,7 @@ struct inet_peer *inet_getpeer(struct inet_peer_base *base, const struct inetpeer_addr *daddr) {struct inet_peer *p, *gc_stack[PEER_MAX_GC ]; +u64 dhash =inetpeer_addr_hash (daddr);struct rb_node **pp, *parent;unsigned int gc_cnt, seq;
@@ -187,7 +218,7 @@ struct inet_peer *inet_getpeer(struct inet_peer_base *base,* Because of a concurrent writer, we might not find an existing entry. */ seq =read_seqbegin (&base->lock); - p =lookup (daddr, base, seq,NULL , &gc_cnt, &parent, &pp); + p =lookup (daddr, dhash, base, seq,NULL , &gc_cnt, &parent, &pp);if (p)return p;
@@ -199,11 +230,12 @@ struct inet_peer *inet_getpeer(struct inet_peer_base *base,write_seqlock_bh (&base->lock); gc_cnt =0 ; - p =lookup (daddr, base, seq, gc_stack, &gc_cnt, &parent, &pp); + p =lookup (daddr, dhash, base, seq, gc_stack, &gc_cnt, &parent, &pp);if (!p) { p =kmem_cache_alloc (peer_cachep,GFP_ATOMIC );if (p) { p->daddr = *daddr; + p->hash = dhash; p->dtime = (__u32 )jiffies;refcount_set (&p->refcnt,1 );atomic_set (&p->rid,0 );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1085/1191 net/smc: free stashed qentry before overwrite in REQ_ADD_LINK to ADD_LINK transition
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mahanta Jambigi <[email protected]>
[ Upstream commit 036322025d6e440cb75fc6fecbba9a16b271a2ae ]
When smc_llc_event_handler() transitions the local LLC flow from SMC_LLC_FLOW_REQ_ADD_LINK to SMC_LLC_FLOW_ADD_LINK on arrival of an ADD_LINK request, it calls smc_llc_flow_qentry_set() unconditionally:
if (lgr->llc_flow_lcl.type == SMC_LLC_FLOW_REQ_ADD_LINK) {
lgr->llc_flow_lcl.type = SMC_LLC_FLOW_ADD_LINK;
smc_llc_flow_qentry_set(&lgr->llc_flow_lcl, qentry);
...
}A CONFIRM_LINK or ADD_LINK_CONT arriving while flow->type is SMC_LLC_FLOW_REQ_ADD_LINK is stashed into flow->qentry via the SMC_LLC_CONFIRM_LINK / SMC_LLC_ADD_LINK_CONT handler (which stores into flow->qentry for any non-NONE flow type). When the subsequent ADD_LINK arrives, the REQ_ADD_LINK branch overwrites flow->qentry with the new pointer without first freeing the stashed allocation, leaking one kmalloc object.
The stashed entry has no consumer: smc_llc_wait() is only called from llc_add_link_work, which is not yet scheduled while the flow type remains REQ_ADD_LINK. No waiter is sleeping on llc_msg_waiter at this point. It is safe to unconditionally free any stashed qentry before the overwrite.
Call smc_llc_flow_qentry_del() before smc_llc_flow_qentry_set() in the REQ_ADD_LINK branch. smc_llc_flow_qentry_del() already checks flow->qentry before freeing, so the normal path where no entry is stashed is a no-op.
--- net/smc/smc_llc.c | 2 ++ 1 file changed, 2 insertions(+)
net/smc/smc_llc.c +2 -0
@@ -1885,6 +1885,8 @@ static void smc_llc_event_handler(struct smc_llc_qentry *qentry)if (lgr->llc_flow_lcl.type ==SMC_LLC_FLOW_REQ_ADD_LINK ) {/* server started add_link processing */ +/* free any qentry stashed in REQ_ADD_LINK state */ +smc_llc_flow_qentry_del (&lgr->llc_flow_lcl); lgr->llc_flow_lcl.type =SMC_LLC_FLOW_ADD_LINK ;smc_llc_flow_qentry_set (&lgr->llc_flow_lcl, qentry);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1086/1191 net/smc: free pending qentry in smc_llc_flow_stop() before memset
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mahanta Jambigi <[email protected]>
[ Upstream commit 5ee0ceddc7785c6dcf4a8107fef01f0414a354f4 ]
smc_llc_flow_stop() resets a flow struct with a blind memset:
spin_lock_bh(&lgr->llc_flow_lock); memset(flow, 0, sizeof(*flow)); flow->type = SMC_LLC_FLOW_NONE; spin_unlock_bh(&lgr->llc_flow_lock);
If flow->qentry is non-NULL at this point the pointer is overwritten without the allocation being freed, leaking one kmalloc object.
A late-arriving duplicate CONFIRM_LINK or ADD_LINK_CONT message can set flow->qentry after the legitimate message has been consumed by the waiter via smc_llc_flow_qentry_clr() (which NULLs the pointer but leaves flow->type non-zero) but before the flow completes and smc_llc_flow_stop() runs. In that window the duplicate is stashed into flow->qentry, and then lost when smc_llc_flow_stop() zeros the struct.
Call smc_llc_flow_qentry_del() inside the lock before the memset. smc_llc_flow_qentry_del() already checks flow->qentry before freeing, so the normal case where no entry is pending is a no-op.
--- net/smc/smc_llc.c | 1 + 1 file changed, 1 insertion(+)
net/smc/smc_llc.c +1 -0
@@ -321,6 +321,7 @@ int smc_llc_flow_initiate(struct smc_link_group *lgr,void smc_llc_flow_stop (struct smc_link_group *lgr,struct smc_llc_flow *flow) {spin_lock_bh (&lgr->llc_flow_lock); +smc_llc_flow_qentry_del (flow);memset (flow,0 ,sizeof (*flow)); flow->type =SMC_LLC_FLOW_NONE ;spin_unlock_bh (&lgr->llc_flow_lock);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1087/1191 NFSv4.2: fix LAYOUTSTATS send buffer exhaustion
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Junrui Luo <[email protected]>
[ Upstream commit c75ef2137e749f2673f0617cfdaae53b2bb7195a ]
encode_layoutstats_maxsz budgets XDR_QUADLEN(PNFS_LAYOUTSTATS_MAXSIZE), i.e. 256 bytes, for the layoutupdate4 body written by the layout driver. The flexfiles record can exceed that.
ff_layout_encode_ff_layoutupdate() emits, per data server, a netaddr4, an nfs_fh4, two ff_io_latency4, an nfstime4 and a bool. A data server whose filehandle is NFS_MAXFHSIZE bytes long already accounts for 132 of those bytes, and the two ff_io_latency4 at 64 bytes each, the nfstime4 and the bool add a further 144, so the body passes 256 bytes before the netaddr4 is encoded at all. encode_layoutstats() additionally writes the deviceid4 and the layoutupdate4 lou_type word, neither of which the macro accounts for.
The filehandle and the address are both chosen by the server, through LAYOUTGET and GETDEVICEINFO, so it can drive the encoder past the end of the send buffer. xdr_reserve_space() returns NULL once that happens, and the two ff_layout_encode_io_latency() calls run with dss_info->mirror->lock held, so a NULL return there leaves the lock permanently held.
Raise PNFS_LAYOUTSTATS_MAXSIZE to 384 so that the record fits inside the reservation.
--- include/linux/nfs_xdr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/nfs_xdr.h +1 -1
@@ -348,7 +348,7 @@ struct nfs4_layoutreturn {struct nfs4_xdr_opaque_data ld_private; }; -#define PNFS_LAYOUTSTATS_MAXSIZE 256 +#define PNFS_LAYOUTSTATS_MAXSIZE 384struct nfs42_layoutstat_args ;struct nfs42_layoutstat_devinfo ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1088/1191 nfs: move the nfs4_data_server_cache into struct nfs_net
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Layton <[email protected]>
[ Upstream commit d5fb22a7c585b12ec3e6cef150689f7386e8cfd0 ]
Since struct nfs4_pnfs_ds should not be shared between net namespaces, move from a global list of objects to a per-netns list and spinlock.
Stable-dep-of: 13c23c5cb977 ("NFSv4/pnfs: key the data server cache on the NFS version")
--- fs/nfs/client.c | 7 +++++++ fs/nfs/netns.h | 6 +++++- fs/nfs/pnfs_nfs.c | 31 +++++++++++++++++-------------- 3 files changed, 29 insertions(+), 15 deletions(-)
fs/nfs/client.c +7 -0
@@ -1210,6 +1210,10 @@ void nfs_clients_init(struct net *net)INIT_LIST_HEAD (&nn->nfs_volume_list);#if IS_ENABLED (CONFIG_NFS_V4 )idr_init (&nn->cb_ident_idr); +#endif +#if IS_ENABLED (CONFIG_NFS_V4_1 ) +INIT_LIST_HEAD (&nn->nfs4_data_server_cache); +spin_lock_init (&nn->nfs4_data_server_lock);#endif spin_lock_init (&nn->nfs_client_lock); nn->boot_time =ktime_get_real ();
@@ -1227,6 +1231,9 @@ void nfs_clients_exit(struct net *net)nfs_cleanup_cb_ident_idr (net);WARN_ON_ONCE (!list_empty (&nn->nfs_client_list));WARN_ON_ONCE (!list_empty (&nn->nfs_volume_list)); +#if IS_ENABLED (CONFIG_NFS_V4_1 ) +WARN_ON_ONCE (!list_empty (&nn->nfs4_data_server_cache)); +#endif }#ifdef CONFIG_PROC_FS
fs/nfs/netns.h +5 -1
@@ -31,7 +31,11 @@ struct nfs_net {unsigned short nfs_callback_tcpport;unsigned short nfs_callback_tcpport6;int cb_users[NFS4_MAX_MINOR_VERSION +1 ]; -#endif +#endif /* CONFIG_NFS_V4 */ +#if IS_ENABLED (CONFIG_NFS_V4_1 ) +struct list_head nfs4_data_server_cache; +spinlock_t nfs4_data_server_lock; +#endif /* CONFIG_NFS_V4_1 */ struct nfs_netns_client *nfs_client;spinlock_t nfs_client_lock;ktime_t boot_time;
fs/nfs/pnfs_nfs.c +17 -14
@@ -16,6 +16,7 @@#include "nfs4session.h" #include "internal.h" #include "pnfs.h" +#include "netns.h" #define NFSDBG_FACILITY NFSDBG_PNFS
@@ -551,14 +552,14 @@ EXPORT_SYMBOL_GPL(pnfs_generic_commit_pagelist);/* * Data server cache * -* Data servers can be mapped to different device ids. -* nfs4_pnfs_ds reference counting +* Data servers can be mapped to different device ids, but should +* never be shared between net namespaces. +* +* nfs4_pnfs_ds reference counting: * - set to 1 on allocation * - incremented when a device id maps a data server already in the cache. * - decremented when deviceid is removed from the cache. */ -static DEFINE_SPINLOCK (nfs4_ds_cache_lock); -static LIST_HEAD (nfs4_data_server_cache);/* Debug routines */ static void
@@ -651,12 +652,12 @@ _same_data_server_addrs_locked(const struct list_head *dsaddrs1,* Lookup DS by addresses. nfs4_ds_cache_lock is held */ static struct nfs4_pnfs_ds * -_data_server_lookup_locked (const struct net *net,const struct list_head *dsaddrs) +_data_server_lookup_locked (const struct nfs_net *nn,const struct list_head *dsaddrs) {struct nfs4_pnfs_ds *ds; -list_for_each_entry (ds, &nfs4_data_server_cache, ds_node) -if (ds->ds_net == net &&_same_data_server_addrs_locked (&ds->ds_addrs, dsaddrs)) +list_for_each_entry (ds, &nn->nfs4_data_server_cache, ds_node) +if (_same_data_server_addrs_locked (&ds->ds_addrs, dsaddrs))return ds;return NULL ; }
@@ -700,10 +701,11 @@ static void destroy_ds(struct nfs4_pnfs_ds *ds)void nfs4_pnfs_ds_put (struct nfs4_pnfs_ds *ds) { -if (refcount_dec_and_lock (&ds->ds_count, - &nfs4_ds_cache_lock)) { +struct nfs_net *nn =net_generic (ds->ds_net, nfs_net_id); + +if (refcount_dec_and_lock (&ds->ds_count, &nn->nfs4_data_server_lock)) {list_del_init (&ds->ds_node); -spin_unlock (&nfs4_ds_cache_lock); +spin_unlock (&nn->nfs4_data_server_lock);destroy_ds (ds); } }
@@ -765,6 +767,7 @@ nfs4_pnfs_remotestr(struct list_head *dsaddrs, gfp_t gfp_flags)struct nfs4_pnfs_ds *nfs4_pnfs_ds_add (const struct net *net,struct list_head *dsaddrs,gfp_t gfp_flags) { +struct nfs_net *nn =net_generic (net, nfs_net_id);struct nfs4_pnfs_ds *tmp_ds, *ds =NULL ;char *remotestr;
@@ -780,8 +783,8 @@ nfs4_pnfs_ds_add(const struct net *net, struct list_head *dsaddrs, gfp_t gfp_fla/* this is only used for debugging, so it's ok if its NULL */ remotestr =nfs4_pnfs_remotestr (dsaddrs, gfp_flags); -spin_lock (&nfs4_ds_cache_lock); - tmp_ds =_data_server_lookup_locked (net, dsaddrs); +spin_lock (&nn->nfs4_data_server_lock); + tmp_ds =_data_server_lookup_locked (nn, dsaddrs);if (tmp_ds ==NULL ) {INIT_LIST_HEAD (&ds->ds_addrs);list_splice_init (dsaddrs, &ds->ds_addrs);
@@ -790,7 +793,7 @@ nfs4_pnfs_ds_add(const struct net *net, struct list_head *dsaddrs, gfp_t gfp_flaINIT_LIST_HEAD (&ds->ds_node); ds->ds_net = net; ds->ds_clp =NULL ; -list_add (&ds->ds_node, &nfs4_data_server_cache); +list_add (&ds->ds_node, &nn->nfs4_data_server_cache);dprintk ("%s add new data server %s\n" , __func__, ds->ds_remotestr); }else {
@@ -802,7 +805,7 @@ nfs4_pnfs_ds_add(const struct net *net, struct list_head *dsaddrs, gfp_t gfp_fla refcount_read(&tmp_ds->ds_count)); ds = tmp_ds; } -spin_unlock (&nfs4_ds_cache_lock); +spin_unlock (&nn->nfs4_data_server_lock); out:return ds; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1089/1191 NFSv4/pnfs: key the data server cache on the NFS version
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Junrui Luo <[email protected]>
[ Upstream commit 13c23c5cb977f66390795437fd3837887ce1fd75 ]
nfs4_pnfs_ds_add() keys the per-net data server cache on the multipath address set alone, and struct nfs4_pnfs_ds records no version. That suffices for the files layout driver, which always connects with version 4, but flexfiles takes its version tuple from GETDEVICEINFO per device, and one address can legitimately serve both NFSv3 and NFSv4.
Two deviceids on one address with different ds_versions[0].version therefore share a single nfs4_pnfs_ds, and whichever mirror connects first pins ds_clp to its own version. The other one is handed that client anyway, so it selects rpc_call_ops for a version the connection does not speak, and the mismatched sequence-slot handling dereferences NULL.
Add the version to the cache key so the two cannot alias, giving each version its own nfs4_pnfs_ds and connection while both mirrors stay usable. Only the major version is compared, since that is what selects rpc_call_ops and rpc_ops; v4.0 and v4.1 keep sharing a client. The files layout driver passes the 4 it already hardcodes at connect time.
--- fs/nfs/filelayout/filelayoutdev.c | 3 ++- fs/nfs/flexfilelayout/flexfilelayoutdev.c | 3 ++- fs/nfs/pnfs.h | 3 ++- fs/nfs/pnfs_nfs.c | 14 +++++++++----- 4 files changed, 15 insertions(+), 8 deletions(-)
fs/nfs/filelayout/filelayoutdev.c +2 -1
@@ -169,7 +169,8 @@ nfs4_fl_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev, goto out_err_free_deviceid; } - dsaddr->ds_list[i] =nfs4_pnfs_ds_add (net, &dsaddrs, gfp_flags); + dsaddr->ds_list[i] =nfs4_pnfs_ds_add (net, &dsaddrs,4 , + gfp_flags);if (!dsaddr->ds_list[i]) goto out_err_drain_dsaddrs;
fs/nfs/flexfilelayout/flexfilelayoutdev.c +2 -1
@@ -149,7 +149,8 @@ nfs4_ff_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev, new_ds->ds_versions = ds_versions; new_ds->ds_versions_cnt = version_count; - new_ds->ds =nfs4_pnfs_ds_add (net, &dsaddrs, gfp_flags); + new_ds->ds =nfs4_pnfs_ds_add (net, &dsaddrs, ds_versions[0 ].version, + gfp_flags);if (!new_ds->ds) goto out_err_drain_dsaddrs;
fs/nfs/pnfs.h +2 -1
@@ -62,6 +62,7 @@ struct nfs4_pnfs_ds {const struct net *ds_net;struct nfs_client *ds_clp;refcount_t ds_count; +u32 ds_version;/* cache key, with ds_addrs */ unsigned long ds_state;#define NFS4DS_CONNECTING 0/* ds is establishing connection */ };
@@ -408,7 +409,7 @@ void pnfs_generic_write_commit_done(struct rpc_task *task, void *data);void nfs4_pnfs_ds_put (struct nfs4_pnfs_ds *ds);struct nfs4_pnfs_ds *nfs4_pnfs_ds_add (const struct net *net,struct list_head *dsaddrs, -gfp_t gfp_flags); +u32 version,gfp_t gfp_flags);void nfs4_pnfs_v3_ds_connect_unload (void ); int nfs4_pnfs_ds_connect(struct nfs_server *mds_srv, struct nfs4_pnfs_ds *ds, struct nfs4_deviceid_node *devid, unsigned int timeo,
fs/nfs/pnfs_nfs.c +9 -5
@@ -649,15 +649,17 @@ _same_data_server_addrs_locked(const struct list_head *dsaddrs1, }/* -* Lookup DS by addresses. nfs4_ds_cache_lock is held +* Lookup DS by addresses and NFS version. nfs4_ds_cache_lock is held */ static struct nfs4_pnfs_ds * -_data_server_lookup_locked (const struct nfs_net *nn,const struct list_head *dsaddrs) +_data_server_lookup_locked (const struct nfs_net *nn, +const struct list_head *dsaddrs,u32 version) {struct nfs4_pnfs_ds *ds;list_for_each_entry (ds, &nn->nfs4_data_server_cache, ds_node) -if (_same_data_server_addrs_locked (&ds->ds_addrs, dsaddrs)) +if (ds->ds_version == version && +_same_data_server_addrs_locked (&ds->ds_addrs, dsaddrs))return ds;return NULL ; }
@@ -765,7 +767,8 @@ nfs4_pnfs_remotestr(struct list_head *dsaddrs, gfp_t gfp_flags)* uncached and return cached struct nfs4_pnfs_ds. */ struct nfs4_pnfs_ds * -nfs4_pnfs_ds_add (const struct net *net,struct list_head *dsaddrs,gfp_t gfp_flags) +nfs4_pnfs_ds_add (const struct net *net,struct list_head *dsaddrs,u32 version, +gfp_t gfp_flags) {struct nfs_net *nn =net_generic (net, nfs_net_id);struct nfs4_pnfs_ds *tmp_ds, *ds =NULL ;
@@ -784,7 +787,7 @@ nfs4_pnfs_ds_add(const struct net *net, struct list_head *dsaddrs, gfp_t gfp_fla remotestr =nfs4_pnfs_remotestr (dsaddrs, gfp_flags);spin_lock (&nn->nfs4_data_server_lock); - tmp_ds =_data_server_lookup_locked (nn, dsaddrs); + tmp_ds =_data_server_lookup_locked (nn, dsaddrs, version);if (tmp_ds ==NULL ) {INIT_LIST_HEAD (&ds->ds_addrs);list_splice_init (dsaddrs, &ds->ds_addrs);
@@ -793,6 +796,7 @@ nfs4_pnfs_ds_add(const struct net *net, struct list_head *dsaddrs, gfp_t gfp_flaINIT_LIST_HEAD (&ds->ds_node); ds->ds_net = net; ds->ds_clp =NULL ; + ds->ds_version = version;list_add (&ds->ds_node, &nn->nfs4_data_server_cache);dprintk ("%s add new data server %s\n" , __func__, ds->ds_remotestr);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1090/1191 scsi: qla2xxx: Fix an loop timeout test
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
[ Upstream commit 11e48f5201fd86ffa038809dd9c41144d43ee2e4 ]
This loop timeout with "retries" set to -1, not 0. Fix the test for failure.
--- drivers/scsi/qla2xxx/qla_nx2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qla2xxx/qla_nx2.c +1 -1
@@ -3507,7 +3507,7 @@ qla8044_poll_flash_status_reg(struct scsi_qla_host *vha)msleep (QLA8044_FLASH_STATUS_REG_POLL_DELAY ); } -if (!retries) +if (retries ==-1 ) ret_val =QLA_FUNCTION_FAILED ;return ret_val;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1091/1191 erofs: Fix EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS default logic
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
[ Upstream commit ab74edaeb1ae7c7194e79007e6afdfe788111a3f ]
When NR_CPUS is less than 16, or when SMP is disabled, the default value of 16 is invalid.
While actual configuration picks up a sensible and valid default (NR_CPUS or 1), "make savedefconfig" will still write a line like
CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS=1
to the defconfig file, even if that matches the sensible default.
Avoid needlessly enlarging the defconfig files, and reduce churn for updating them, by specifying valid defaults depending on SMP and NR_CPUS.
While at it, make the prompt depend on SMP, as there is no point in asking the user about the maximum number of decompression streams if there is only one valid answer.
--- fs/erofs/Kconfig | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
fs/erofs/Kconfig +5 -3
@@ -100,11 +100,13 @@ config EROFS_FS_ZIP_LZMA If unsure, say N. config EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS - int "EROFS LZMA default maximum decompression streams" + int "EROFS LZMA default maximum decompression streams" if SMP depends on EROFS_FS_ZIP_LZMA range 1 NR_CPUS if SMP range 1 1 if !SMP - default 16 + default 16 if SMP && NR_CPUS >= 16 + default NR_CPUS if SMP + default 1 help By default EROFS allocates one LZMA decompression stream per CPU. Each stream can hold a dictionary of up to 8 MiB taken from the
@@ -112,7 +114,7 @@ config EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS of memory. This caps the default; the lzma_streams module parameter still overrides it. - If unsure, keep the default of 16. + If unsure, keep the suggested default (16 or lower). config EROFS_FS_ONDEMAND bool "EROFS fscache-based on-demand read support"
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1092/1191 Bluetooth: L2CAP: reject accept queue add unless BT_LISTEN
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pauli Virtanen <[email protected]>
[ Upstream commit d4bfa78fd67929b62b02013c107973e0c5b7aa9a ]
New sk should not be added to parent socket accept queue after last l2cap_sock_cleanup_listen() has run in l2cap_sock_teardown_cb() and state set to BT_CLOSED, as that can result to UAF on dereferencing the dangling parent reference.
l2cap_sock_new_connection_cb() may race with parent l2cap_chan teardown, due to chan->state accessed without consistent locking:
[Task 1] [Task 2]
l2cap_sock_release(parent) l2cap_connect
l2cap_sock_shutdown pchan = l2cap_global_chan_by_psm
l2cap_chan_lock(pchan)
l2cap_chan_close
l2cap_sock_teardown_cb
pchan->state = BT_CLOSED
l2cap_chan_unlock(pchan) ------> l2cap_chan_lock(pchan)
l2cap_new_connection
l2cap_sock_new_connection_cb
l2cap_chan_lock(pchan) <-------- l2cap_chan_unlock(pchan)
l2cap_sock_kill(parent) /* bt_sk(sk)->parent dangling */Fix by adding check for sk_state == BT_LISTEN after acquiring sk lock in l2cap_sock_new_connection_cb(). Add lock_sock() around sk_state writes where missing, to avoid data races.
Although the data races on pchan->state should be fixed too, this defensive sk_state check probably makes sense in any case.
--- net/bluetooth/l2cap_sock.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
net/bluetooth/l2cap_sock.c +13 -0
@@ -1524,6 +1524,11 @@ static int l2cap_sock_new_connection_cb(struct l2cap_chan *chan,lock_sock (parent); +if (parent->sk_state !=BT_LISTEN ) { +release_sock (parent); +return -EINVAL ; + } +/* Check for backlog size */ if (sk_acceptq_is_full (parent)) {BT_DBG ("backlog full %d" , parent->sk_ack_backlog);
@@ -1688,10 +1693,14 @@ static void l2cap_sock_state_change_cb(struct l2cap_chan *chan, int state,if (!sk)return ; +lock_sock (sk); + sk->sk_state = state;if (err) sk->sk_err = err; + +release_sock (sk); } static struct sk_buff *l2cap_sock_alloc_skb_cb(struct l2cap_chan *chan,
@@ -1767,6 +1776,8 @@ static void l2cap_sock_resume_cb(struct l2cap_chan *chan)if (!sk)return ; +lock_sock (sk); +if (test_and_clear_bit (FLAG_PENDING_SECURITY , &chan->flags)) { sk->sk_state =BT_CONNECTED ; chan->state =BT_CONNECTED ;
@@ -1774,6 +1785,8 @@ static void l2cap_sock_resume_cb(struct l2cap_chan *chan)clear_bit (BT_SK_SUSPEND , &bt_sk (sk)->flags); sk->sk_state_change (sk); + +release_sock (sk); }static void l2cap_sock_set_shutdown_cb (struct l2cap_chan *chan)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1093/1191 Bluetooth: mgmt: fix hdev->discovery.uuids NULL dereference
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pavel Shpakovskiy <[email protected]>
[ Upstream commit 59eecbe2f2f38d8f3e1104bd11da97f9a2c58998 ]
'uuid_count' member of struct 'discovery_state' is assigned and read without any locks, so there is a chance of situation when uuid_count != 0, but uuids is NULL and there will be NULL pointer dereference.
Possible race:
'hci_update_passive_scan_sync'
'hci_discovery_filter_clear'
hdev->discovery.uuid_count = 0;
<----------------------preempted----------------------------->
'start_service_discovery'
// Set uuid_count to value != 0
hdev->discovery.uuid_count = uuid_count;
hdev->discovery.uuids = kmemdup(...);
<----------------------preempted----------------------------->
spin_lock(&hdev->discovery.lock);
kfree(hdev->discovery.uuids);
hdev->discovery.uuids = NULL;
spin_unlock(&hdev->discovery.lock);Now uuids == NULL and uuid_count != 0.
So 'mgmt_device_found' -> 'is_filter_match' -> 'eir_has_uuids' receives non consistent discovery state, where NULL dereference of uuids happens.
To fix it let's add discovery.lock around every read/write of uuid_count, uuids pair of struct members. It is also important to assign uuid_count value only after success kmemdup() allocation in start_service_discovery(), otherwise uuids is NULL, because kmemdup failed, but uuid_count is already assigned to non zero value.
The following panic happens:
[ ] ------------[ cut here ]------------
[ ] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
[ ] Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP [ ] CPU: 0 PID: 15056 Comm: kworker/u9:2
[ ] Workqueue: hci0 hci_rx_work
[ ] pstate: 10400009 (nzcV daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ ] pc : eir_has_uuids+0x2d8/0x590
[ ] lr : is_filter_match+0x258/0x320
...
[ ] Call trace:
[ ] eir_has_uuids+0x2d8/0x590 [ ] is_filter_match+0x258/0x320 [ ] mgmt_device_found+0x5b0/0xafc [ ] process_adv_report.part.0+0x8c8/0xf14 [ ] hci_le_adv_report_evt+0x338/0x3f0 [ ] hci_le_meta_evt+0x1f0/0x4c8 [ ] hci_event_packet+0x440/0xc9c [ ] hci_rx_work+0x44c/0xaf8 [ ] process_one_work+0x54c/0x103c [ ] worker_thread+0x6c4/0x10c4 [ ] kthread+0x274/0x2ec [ ] ret_from_fork+0x10/0x20
[ ] Code: 14000004 91004021 eb14003f 54000180 (f9400024) [ ] ---[ end trace 0000000000000000 ]---
--- include/net/bluetooth/hci_core.h | 2 +- net/bluetooth/mgmt.c | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-)
include/net/bluetooth/hci_core.h +1 -1
@@ -876,9 +876,9 @@ static inline void hci_discovery_filter_clear(struct hci_dev *hdev) hdev->discovery.result_filtering = false; hdev->discovery.report_invalid_rssi = true; hdev->discovery.rssi =HCI_RSSI_INVALID ; - hdev->discovery.uuid_count =0 ;spin_lock (&hdev->discovery.lock); + hdev->discovery.uuid_count =0 ;kfree (hdev->discovery.uuids); hdev->discovery.uuids =NULL ;spin_unlock (&hdev->discovery.lock);
net/bluetooth/mgmt.c +13 -5
@@ -6060,6 +6060,7 @@ static int start_service_discovery(struct sock *sk, struct hci_dev *hdev,struct mgmt_pending_cmd *cmd;const u16 max_uuid_count = ((U16_MAX -sizeof (*cp)) /16 );u16 uuid_count, expected_len; +u8 (*uuids)[16 ] =NULL ;u8 status;int err;
@@ -6136,12 +6137,10 @@ static int start_service_discovery(struct sock *sk, struct hci_dev *hdev, hdev->discovery.result_filtering = true; hdev->discovery.type = cp->type; hdev->discovery.rssi = cp->rssi; - hdev->discovery.uuid_count = uuid_count;if (uuid_count >0 ) { - hdev->discovery.uuids =kmemdup (cp->uuids, uuid_count *16 , -GFP_KERNEL ); -if (!hdev->discovery.uuids) { + uuids =kmemdup (cp->uuids, uuid_count *sizeof (*uuids),GFP_KERNEL ); +if (!uuids) { err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_START_SERVICE_DISCOVERY, MGMT_STATUS_FAILED,
@@ -6151,6 +6150,11 @@ static int start_service_discovery(struct sock *sk, struct hci_dev *hdev, } } +spin_lock (&hdev->discovery.lock); + hdev->discovery.uuids = uuids; + hdev->discovery.uuid_count = uuid_count; +spin_unlock (&hdev->discovery.lock); + err =hci_cmd_sync_queue (hdev, start_discovery_sync, cmd, start_discovery_complete);if (err <0 ) {
@@ -10206,6 +10210,7 @@ static bool is_filter_match(struct hci_dev *hdev, s8 rssi, u8 *eir, !test_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks))))return false; +spin_lock (&hdev->discovery.lock);if (hdev->discovery.uuid_count !=0 ) {/* If a list of UUIDs is provided in filter, results with no * matching UUID should be dropped.
@@ -10214,9 +10219,12 @@ static bool is_filter_match(struct hci_dev *hdev, s8 rssi, u8 *eir, hdev->discovery.uuids) && !eir_has_uuids(scan_rsp, scan_rsp_len, hdev->discovery.uuid_count, - hdev->discovery.uuids)) + hdev->discovery.uuids)) { +spin_unlock (&hdev->discovery.lock);return false; + } } +spin_unlock (&hdev->discovery.lock);/* If duplicate filtering does not report RSSI changes, then restart * scanning to ensure updated result with updated RSSI values.
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1094/1191 Bluetooth: L2CAP: fix race l2cap_sock_cleanup_listen() vs. put_chan
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pauli Virtanen <[email protected]>
[ Upstream commit 66d6ef18548ae6d7dd452b84115fc82c0a73a4ea ]
For L2CAP sockets without owning sk->sk_socket, reading l2cap_pi(sk)->chan may race against concurrent l2cap_sock_kill() -> l2cap_sock_put_chan(). This excludes simultaneous proto_ops callbacks, but access in l2cap_sock_cleanup_listen() has unsafe lockless read.
[Task 1] [Task 2 (hdev->workqueue)]
l2cap_sock_release(parent) l2cap_disconn_cfm
l2cap_sock_cleanup_listen l2cap_conn_del
bt_accept_dequeue l2cap_chan_del
lock_sock(sk) l2cap_sock_teardown_cb
bt_accept_unlink
bt_sk(sk)->parent = NULL
release_sock(sk) ----------------> lock_sock(sk)
parent = /* NULL */
lock_sock(sk) <--------------------- release_sock(sk)
sock_set_flag(sk, SOCK_ZAPPED)
l2cap_sock_close_cb
l2cap_sock_kill(sk)
l2cap_sock_put_chan
chan = READ l2cap_pi(sk)->chan l2cap_pi(sk)->chan = NULL
l2cap_chan_hold_unless_zero l2cap_put_chan(chan)
kref_get_unless_zero(&chan->ref)Task 1 may observe NULL which causes null-ptr-deref.
Fix the race by taking lock_sock() in l2cap_sock_kill() to synchronize with l2cap_sock_cleanup_listen(). hold_unless_zero() is not needed here, l2cap_pi(sk)->chan owns reference if it is non-NULL.
Clarify code comments vs. locking.
--- include/net/bluetooth/l2cap.h | 5 +++++ net/bluetooth/l2cap_sock.c | 23 +++++++++++++---------- 2 files changed, 18 insertions(+), 10 deletions(-)
include/net/bluetooth/l2cap.h +5 -0
@@ -696,7 +696,12 @@ struct l2cap_rx_busy {struct l2cap_pinfo {struct bt_sock bt; + +/* With owning sk_socket chan may be read without lock, other access +* should hold lock_sock. +*/ struct l2cap_chan *chan; +struct list_head rx_busy; };
net/bluetooth/l2cap_sock.c +13 -10
@@ -1268,7 +1268,12 @@ static void l2cap_sock_kill(struct sock *sk)BT_DBG ("sk %p state %s" , sk,state_to_string (sk->sk_state)); +/* Take lock to synchronize against access without owning sk->sk_socket, +* eg. in l2cap_sock_cleanup_listen(). proto_ops etc. don't need lock. +*/ +lock_sock (sk);l2cap_sock_put_chan (sk); +release_sock (sk);/* Kill poor orphan */ sock_set_flag (sk,SOCK_DEAD );
@@ -1472,14 +1477,10 @@ static void l2cap_sock_cleanup_listen(struct sock *parent)* establish sk_lock -> conn->lock and invert the established * conn->lock -> chan->lock -> sk_lock order (lockdep deadlock). * -* Instead, briefly take the child sk lock to fetch and pin its chan. -* l2cap_conn_del() reaches the chan free only via -* l2cap_chan_del() -> l2cap_sock_teardown_cb(), which itself takes -* the child sk lock; holding it across l2cap_chan_hold_unless_zero() -* therefore guarantees the chan cannot be freed while we read and -* pin it (hold_unless_zero() additionally skips a chan already past -* its last reference). We then drop the sk lock before taking -* chan->lock, so sk and chan locks are never held together. +* Instead, briefly take the child sk lock to synchronize vs. +* l2cap_sock_kill that puts l2cap_pi(sk)->chan. We then drop the sk +* lock before taking chan->lock, so sk and chan locks are never held +* together. * * Since we cannot call l2cap_chan_close() without conn->lock, * schedule l2cap_chan_timeout to close the channel; it already
@@ -1489,10 +1490,12 @@ static void l2cap_sock_cleanup_listen(struct sock *parent)struct l2cap_chan *chan;lock_sock_nested (sk,L2CAP_NESTING_NORMAL ); - chan =l2cap_chan_hold_unless_zero (l2cap_pi (sk)->chan); + chan =l2cap_pi (sk)->chan; +if (chan) +l2cap_chan_hold (chan);release_sock (sk);if (!chan) { -/* l2cap_conn_del() already tearing this child down */ +/* Already torn down */ sock_put (sk);continue ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1095/1191 Bluetooth: btmtksdio: Take exclusive ownership of the SKB before TX
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Lu <[email protected]>
[ Upstream commit 155e3003d1e614f85566b636973df7118e1b4851 ]
btmtksdio_tx_packet() prepends the MediaTek SDIO header with skb_push() and writes into that space after only checking the headroom size. On a cloned SKB that headroom belongs to a buffer shared with the other owner, which the driver has no right to write to.
Cloned SKBs do reach this path: hci_send_cmd_sync() keeps a clone of every HCI command in hdev->sent_cmd before handing the SKB to the driver, and l2cap_ertm_send() clones SKBs for retransmission.
Replace the open-coded headroom check with skb_cow_head(), which both guarantees the headroom and reallocates a private buffer when the SKB is cloned. The cost is one reallocation and copy per cloned packet, the usual price of this pattern in network drivers.
This has no observable effect on its own, as the driver only writes in front of skb->data where no other owner looks. It is a prerequisite for "Bluetooth: btmtksdio: Fix out-of-bounds DMA read in the TX path", which writes padding behind skb->tail, and carries the same Fixes: tag so that both are backported together.
--- drivers/bluetooth/btmtksdio.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/bluetooth/btmtksdio.c +6 -7
@@ -259,13 +259,12 @@ static int btmtksdio_tx_packet(struct btmtksdio_dev *bdev,struct mtkbtsdio_hdr *sdio_hdr;int err; -/* Make sure that there are enough rooms for SDIO header */ -if (unlikely (skb_headroom (skb) <sizeof (*sdio_hdr))) { - err =pskb_expand_head (skb,sizeof (*sdio_hdr),0 , -GFP_ATOMIC ); -if (err <0 ) -return err; - } +/* Make sure that the data buffer is not shared with anyone else and +* that there is enough room for the SDIO header +*/ + err =skb_cow_head (skb,sizeof (*sdio_hdr)); +if (err <0 ) +return err;/* Prepend MediaTek SDIO Specific Header */ skb_push (skb,sizeof (*sdio_hdr));
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1096/1191 Bluetooth: btmtksdio: Fix out-of-bounds DMA read in the TX path
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Lu <[email protected]>
[ Upstream commit fa0ad2d277c7adead61d1c22411c55cea6990c2a ]
btmtksdio_tx_packet() rounds the transfer size up to the SDIO block size of 256 bytes, but hands the host controller the SKB buffer as is:
err = sdio_writesb(bdev->func, MTK_REG_CTDR, skb->data, round_up(skb->len, MTK_SDIO_BLOCK_SIZE));
Only skb->len bytes hold packet data, so the controller reads up to 255 bytes of uninitialised memory and sends it to the device over the SDIO bus. Depending on how much tailroom slack the SKB allocation happens to carry, that read can also extend past the end of the buffer.
Compute the padded length up front, ensure the SKB has tailroom for it, and zero-fill the padding with skb_put_zero(). skb->len then covers the padding, so sdio_writesb() no longer needs to round up. byte_tx keeps counting the header and the payload only, and the error path restores the SKB so that the caller can requeue it.
Writing behind skb->tail is only safe because the driver owns the buffer, which "Bluetooth: btmtksdio: Take exclusive ownership of the SKB before TX" ensures.
--- drivers/bluetooth/btmtksdio.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-)
drivers/bluetooth/btmtksdio.c +21 -5
@@ -257,6 +257,7 @@ static int btmtksdio_tx_packet(struct btmtksdio_dev *bdev, struct sk_buff *skb) {struct mtkbtsdio_hdr *sdio_hdr; +unsigned int len, pad_len;int err;/* Make sure that the data buffer is not shared with anyone else and
@@ -266,6 +267,18 @@ static int btmtksdio_tx_packet(struct btmtksdio_dev *bdev,if (err <0 )return err; +/* The transfer is rounded up to the SDIO block size, so the buffer +* has to provide tailroom for the padding as well +*/ + len = skb->len +sizeof (*sdio_hdr); + pad_len =round_up (len,MTK_SDIO_BLOCK_SIZE ) - len; + +if (unlikely (skb_tailroom (skb) < pad_len)) { + err =pskb_expand_head (skb,0 , pad_len,GFP_ATOMIC ); +if (err <0 ) +return err; + } +/* Prepend MediaTek SDIO Specific Header */ skb_push (skb,sizeof (*sdio_hdr));
@@ -274,19 +287,22 @@ static int btmtksdio_tx_packet(struct btmtksdio_dev *bdev, sdio_hdr->reserved =cpu_to_le16 (0 ); sdio_hdr->bt_type =hci_skb_pkt_type (skb); +/* Zero the padding so that no uninitialised memory is sent out */ +skb_put_zero (skb, pad_len); +clear_bit (BTMTKSDIO_HW_TX_READY , &bdev->tx_state); - err =sdio_writesb (bdev->func,MTK_REG_CTDR , skb->data, -round_up (skb->len,MTK_SDIO_BLOCK_SIZE )); + err =sdio_writesb (bdev->func,MTK_REG_CTDR , skb->data, skb->len);if (err <0 ) - goto err_skb_pull; + goto err_skb_restore; - bdev->hdev->stat.byte_tx += skb->len; + bdev->hdev->stat.byte_tx += len;kfree_skb (skb);return 0 ; -err_skb_pull: +err_skb_restore: +skb_trim (skb, len);skb_pull (skb,sizeof (*sdio_hdr));return err;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1097/1191 Bluetooth: RFCOMM: Validate MTU in rfcomm_apply_pn() to prevent infinite loop
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hyunwoo Kim <[email protected]>
[ Upstream commit 44c98fd082eafd49d55a8a4077ff488175b2fe24 ]
rfcomm_apply_pn() accepts the MTU value from a remote PN (Parameter Negotiation) frame without checking for zero. When the remote peer sends an MTU of zero, d->mtu is set to 0. This causes the sendmsg path to enter an infinite loop when fragmenting data, as each fragment has size == min_t(size_t, len, 0) == 0, so the remaining length never decreases. The infinite allocation of zero-length skbs exhausts all system memory.
Fix by clamping d->mtu to RFCOMM_DEFAULT_MTU when the negotiated value is zero, consistent with the initial value assigned in rfcomm_dlc_alloc().
--- net/bluetooth/rfcomm/core.c | 4 ++++ 1 file changed, 4 insertions(+)
net/bluetooth/rfcomm/core.c +4 -0
@@ -1454,6 +1454,10 @@ static int rfcomm_apply_pn(struct rfcomm_dlc *d, int cr, struct rfcomm_pn *pn) d->mtu =__le16_to_cpu (pn->mtu); +/* MTU 0 causes an infinite loop when fragmenting in sendmsg */ +if (!d->mtu) + d->mtu =RFCOMM_DEFAULT_MTU ; +if (cr && d->mtu > s->mtu) d->mtu = s->mtu;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1098/1191 gtp: add synchronize_net() in gtp_newlink() error path to prevent use-after-free
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cen Zhang (Microsoft) <[email protected]>
[ Upstream commit d989e22ae9802c52c56ad4284d0caf26696cf6ae ]
gtp_newlink()'s error path frees tid_hash and addr_hash without waiting for an RCU grace period after clearing sk_user_data. A concurrent gtp_encap_recv() in softirq may still hold the gtp_dev pointer obtained via rcu_dereference_sk_user_data() and access the freed memory.
BUG: KASAN: slab-use-after-free in gtp0_pdp_find+0x1f6/0x200 (gtp.c:152) Call Trace: <IRQ> gtp0_pdp_find+0x1f6/0x200 gtp_encap_recv+0x527/0x24b0 udp_queue_rcv_one_skb+0x75f/0xc10
Add synchronize_net() before the kfree calls in out_hashtable, which covers all error paths from both gtp_encap_enable() and gtp_create_sockets().
--- drivers/net/gtp.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/gtp.c +2 -0
@@ -1106,6 +1106,8 @@ static int gtp_newlink(struct net *src_net, struct net_device *dev, out_encap:gtp_encap_disable (gtp); out_hashtable: +/* Wait for RCU readers that may still reference this gtp_dev. */ +synchronize_net ();kfree (gtp->addr_hash);kfree (gtp->tid_hash);return err;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1099/1191 net: qualcomm: rmnet: restore skb->dev on deaggregated frames
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xiang Mei <[email protected]>
[ Upstream commit a66734a1c5e36525ea07e9f4547fddc51e916de3 ]
rmnet_map_deaggregate() allocates each sub-frame with alloc_skb() and leaves skb->dev NULL. __rmnet_map_ingress_handler() assigns skb->dev = ep->egress_dev only on the data path, but a MAP command frame is dispatched to rmnet_map_command() before that, so rmnet_map_send_ack() runs netif_tx_lock(skb->dev) on a NULL device. An unprivileged user reaches this by unsharing a user+net namespace, creating an rmnet link over a tap device with INGRESS_DEAGGREGATION and INGRESS_MAP_COMMANDS, and writing an aggregated frame carrying a flow-control command to the tap fd.
Restore the assignment dropped by 378e25357ac7, so every skb leaving rmnet_map_deaggregate() has a valid device.
BUG: KASAN: null-ptr-deref in _raw_spin_lock (kernel/locking/spinlock.c:158) Write of size 4 at addr 00000000000004b4 by task exploit/144 Call Trace: _raw_spin_lock (kernel/locking/spinlock.c:158) netif_tx_lock (net/sched/sch_generic.c:497) rmnet_map_command (drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c:67) rmnet_rx_handler (drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c:125) __netif_receive_skb_core.constprop.0 (net/core/dev.c:6103) ... __netif_receive_skb_one_core (net/core/dev.c:6214) netif_receive_skb (net/core/dev.c:6474) tun_get_user (drivers/net/tun.c:1966) tun_chr_write_iter (drivers/net/tun.c:2012) vfs_write (fs/read_write.c:687) ksys_write (fs/read_write.c:739) do_syscall_64 (arch/x86/entry/syscall_64.c:94) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121) Kernel panic - not syncing: Fatal exception in interrupt
--- drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c +1 -0
@@ -394,6 +394,7 @@ struct sk_buff *rmnet_map_deaggregate(struct sk_buff *skb,if (!skbn)return NULL ; + skbn->dev = skb->dev;skb_reserve (skbn,RMNET_MAP_DEAGGR_HEADROOM );skb_put (skbn, packet_len);memcpy (skbn->data, skb->data, packet_len);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1100/1191 octeontx2-af: Fix TL3/TL2 link config ENA clearing
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Naveen Mamindlapalli <[email protected]>
[ Upstream commit 9edf8d4876e8a2471e66f54d36208eaff2858392 ]
Clear and restore the ENA bit for each TL3/TL2 link entry during SMQ flush instead of repeatedly using the same link index.
--- drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +5 -6
@@ -2240,8 +2240,8 @@ static int nix_smq_flush(struct rvu *rvu, int blkaddr,int pf =rvu_get_pf (pcifunc);u8 cgx_id =0 , lmac_id =0 ;u16 tl2_tl3_link_schq; -u8 link, link_level;u64 cfg, bmap =0 ; +u8 link_level;/* enable cgx tx if disabled */ if (is_pf_cgxmapped (rvu, pf)) {
@@ -2266,7 +2266,6 @@ static int nix_smq_flush(struct rvu *rvu, int blkaddr, link_level =rvu_read64 (rvu, blkaddr,NIX_AF_PSE_CHANNEL_LEVEL ) &0x01 ?NIX_TXSCH_LVL_TL3 :NIX_TXSCH_LVL_TL2 ; tl2_tl3_link_schq = smq_flush_ctx->smq_tree_ctx[link_level].schq; - link = smq_flush_ctx->smq_tree_ctx[NIX_TXSCH_LVL_TL1 ].schq;/* SMQ set enqueue xoff */ cfg =rvu_read64 (rvu, blkaddr,NIX_AF_SMQX_CFG (smq));
@@ -2276,13 +2275,13 @@ static int nix_smq_flush(struct rvu *rvu, int blkaddr,/* Clear all NIX_AF_TL3_TL2_LINK_CFG[ENA] for the TL3/TL2 queue */ for (i =0 ; i < (rvu->hw->cgx_links + rvu->hw->lbk_links); i++) { cfg =rvu_read64 (rvu, blkaddr, -NIX_AF_TL3_TL2X_LINKX_CFG (tl2_tl3_link_schq, link)); +NIX_AF_TL3_TL2X_LINKX_CFG (tl2_tl3_link_schq, i));if (!(cfg &BIT_ULL (12 )))continue ; bmap |=BIT_ULL (i); cfg &= ~BIT_ULL (12 );rvu_write64 (rvu, blkaddr, -NIX_AF_TL3_TL2X_LINKX_CFG (tl2_tl3_link_schq, link), cfg); +NIX_AF_TL3_TL2X_LINKX_CFG (tl2_tl3_link_schq, i), cfg); }/* Do SMQ flush and set enqueue xoff */
@@ -2303,10 +2302,10 @@ static int nix_smq_flush(struct rvu *rvu, int blkaddr,if (!(bmap &BIT_ULL (i)))continue ; cfg =rvu_read64 (rvu, blkaddr, -NIX_AF_TL3_TL2X_LINKX_CFG (tl2_tl3_link_schq, link)); +NIX_AF_TL3_TL2X_LINKX_CFG (tl2_tl3_link_schq, i)); cfg |=BIT_ULL (12 );rvu_write64 (rvu, blkaddr, -NIX_AF_TL3_TL2X_LINKX_CFG (tl2_tl3_link_schq, link), cfg); +NIX_AF_TL3_TL2X_LINKX_CFG (tl2_tl3_link_schq, i), cfg); }/* clear XOFF on TL2s */
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1101/1191 net/rds: use wq_has_sleeper() in rds_cong_map_updated()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Allison Henderson <[email protected]>
[ Upstream commit d4f484661961636eb90d287050959e613795f73a ]
rds_cong_map_updated() runs after a peer's congestion map has been rewritten (by rds_tcp_cong_recv() and rds_ib_cong_recv(), or the clear-all in the loopback and IB send-completion paths). It bumps rds_cong_generation and then checks waitqueue_active() on map->m_waitq and on rds_poll_waitq to decide whether anyone needs waking. atomic_inc() carries no ordering and waitqueue_active() is a plain load, so nothing orders the map and generation stores before the wait queue reads. The waiters do the mirror image: rds_cong_wait() adds itself to m_waitq and then tests the port bit, and rds_poll() registers on rds_poll_waitq and then reads the generation. That is the store-buffering pattern described above waitqueue_active() in include/linux/wait.h - the updater can observe an empty wait queue while the waiter still observes the port as congested, and no wake-up is issued.
rds_cong_wait() is an interruptible sleep with no timeout, so a sender blocked on a congested port stays blocked until the next congestion update from that peer arrives or a signal is delivered. A poll() waiter misses the map-updated notification the same way.
Use wq_has_sleeper(), which is waitqueue_active() preceded by the required full barrier, as rds_tcp_state_change() already does for the same pattern.
--- net/rds/cong.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/rds/cong.c +2 -2
@@ -256,9 +256,9 @@ void rds_cong_map_updated(struct rds_cong_map *map, uint64_t portmask) map, &map->m_addr);rds_stats_inc (s_cong_update_received);atomic_inc (&rds_cong_generation); -if (waitqueue_active (&map->m_waitq)) +if (wq_has_sleeper (&map->m_waitq))wake_up (&map->m_waitq); -if (waitqueue_active (&rds_poll_waitq)) +if (wq_has_sleeper (&rds_poll_waitq))wake_up_all (&rds_poll_waitq);if (portmask && !list_empty (&rds_cong_monitor)) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1102/1191 cifs: fix clearing stats for fastest execution of each smb2 command
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Frank Sorenson <[email protected]>
[ Upstream commit 48cab1fd5720508148673f59d8ed52c7c7fffca2 ]
The code to clear the 'fastest_cmd' statistics has a typo that repeatedly clears the stat for cmd 0, rather than iterating through each cmd. Fix the typo (0->i).
--- fs/smb/client/cifs_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/smb/client/cifs_debug.c +1 -1
@@ -564,7 +564,7 @@ static ssize_t cifs_stats_proc_write(struct file *file,atomic_set (&server->smb2slowcmd[i],0 ); server->time_per_cmd[i] =0 ; server->slowest_cmd[i] =0 ; - server->fastest_cmd[0] = 0; + server->fastest_cmd[i] = 0; }#endif /* CONFIG_CIFS_STATS2 */ list_for_each_entry (ses, &server->smb_ses_list, smb_ses_list) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1103/1191 net_sched: act_skbmod: use RCU in tcf_skbmod_dump()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 53df77e7859042a92914d664c860f65d9689f88d ]
Also storing tcf_action into struct tcf_skbmod_params makes sure there is no discrepancy in tcf_skbmod_act().
No longer block BH in tcf_skbmod_init() when acquiring tcf_lock.
Stable-dep-of: 81d0d1e64f30 ("net/sched: act_skbmod: fix length calculations and avoid invalid header warnings")
--- include/net/tc_act/tc_skbmod.h | 1 + net/sched/act_skbmod.c | 26 ++++++++++++-------------- 2 files changed, 13 insertions(+), 14 deletions(-)
include/net/tc_act/tc_skbmod.h +1 -0
@@ -12,6 +12,7 @@struct tcf_skbmod_params {struct rcu_head rcu;u64 flags;/*up to 64 types of operations; extend if needed */ +int action;u8 eth_dst[ETH_ALEN ];u16 eth_type;u8 eth_src[ETH_ALEN ];
net/sched/act_skbmod.c +12 -14
@@ -25,19 +25,18 @@ static int tcf_skbmod_act(struct sk_buff *skb, const struct tc_action *a, struct tcf_result *res) {struct tcf_skbmod *d =to_skbmod (a); -int action, max_edit_len, err;struct tcf_skbmod_params *p; +int max_edit_len, err;u64 flags;tcf_lastuse_update (&d->tcf_tm);bstats_update (this_cpu_ptr (d->common.cpu_bstats), skb); - action =READ_ONCE (d->tcf_action); -if (unlikely (action ==TC_ACT_SHOT )) + p =rcu_dereference_bh (d->skbmod_p); +if (unlikely (p->action ==TC_ACT_SHOT )) goto drop; max_edit_len =skb_mac_header_len (skb); - p =rcu_dereference_bh (d->skbmod_p); flags = p->flags;/* tcf_skbmod_init() guarantees "flags" to be one of the following:
@@ -83,7 +82,7 @@ static int tcf_skbmod_act(struct sk_buff *skb, const struct tc_action *a,INET_ECN_set_ce (skb); out: -return action; +return p->action; drop:qstats_overlimit_inc (this_cpu_ptr (d->common.cpu_qstats));
@@ -191,9 +190,9 @@ static int tcf_skbmod_init(struct net *net, struct nlattr *nla, } p->flags = lflags; - + p->action = parm->action;if (ovr) -spin_lock_bh (&d->tcf_lock); +spin_lock (&d->tcf_lock);/* Protected by tcf_lock if overwriting existing action. */ goto_ch =tcf_action_set_ctrlact (*a, parm->action, goto_ch); p_old =rcu_dereference_protected (d->skbmod_p,1 );
@@ -207,7 +206,7 @@ static int tcf_skbmod_init(struct net *net, struct nlattr *nla,rcu_assign_pointer (d->skbmod_p, p);if (ovr) -spin_unlock_bh (&d->tcf_lock); +spin_unlock (&d->tcf_lock);if (p_old)kfree_rcu (p_old, rcu);
@@ -246,10 +245,9 @@ static int tcf_skbmod_dump(struct sk_buff *skb, struct tc_action *a, opt.index = d->tcf_index; opt.refcnt =refcount_read (&d->tcf_refcnt) - ref, opt.bindcnt =atomic_read (&d->tcf_bindcnt) - bind; -spin_lock_bh (&d->tcf_lock); - opt.action = d->tcf_action; - p =rcu_dereference_protected (d->skbmod_p, -lockdep_is_held (&d->tcf_lock)); +rcu_read_lock (); + p =rcu_dereference (d->skbmod_p); + opt.action = p->action; opt.flags = p->flags;if (nla_put (skb,TCA_SKBMOD_PARMS ,sizeof (opt), &opt)) goto nla_put_failure;
@@ -267,10 +265,10 @@ static int tcf_skbmod_dump(struct sk_buff *skb, struct tc_action *a,if (nla_put_64bit (skb,TCA_SKBMOD_TM ,sizeof (t), &t,TCA_SKBMOD_PAD )) goto nla_put_failure; -spin_unlock_bh (&d->tcf_lock); +rcu_read_unlock ();return skb->len; nla_put_failure: -spin_unlock_bh (&d->tcf_lock); +rcu_read_unlock ();nlmsg_trim (skb, b);return -1 ; }
Signature · 1 line
2.53.0
Re: [PATCH 6.1 1103/1191] net_sched: act_skbmod: use RCU in tcf_skbmod_dump()
Please hold this patch unless a 6.1 backport of upstream commit 3016024d7514 ("net_sched: add back BH safety to tcf_lock") can also be included.
This patch replaces spin_lock_bh() with spin_lock() in tcf_skbmod_init(). A rate estimator can take the same lock from timer softirq context, so the timer can interrupt action replacement while it holds the lock and deadlock on it.
I reproduced this on 6.1.188-rc1 in QEMU with lockdep: after the estimator timer ran, replacing an indexed skbmod action reported inconsistent softirq locking on tcfa_lock between est_timer() and tcf_skbmod_init().
With only the skbmod hunk from 3016024d7514 applied, restoring spin_lock_bh()/spin_unlock_bh(), the same test produced no lockdep warning.
Thanks,
Karl
Greg Kroah-Hartman
maintainerPATCH 1104/1191 net/sched: act_skbmod: fix length calculations and avoid invalid header warnings
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 81d0d1e64f30d9989c829c0953cd6e6c68d9c5fb ]
syzbot reported a warning in skb_network_header_len() triggered by tcf_skbmod_act():
!skb_transport_header_was_set(skb)
WARNING: CPU: 0 PID: 14949 at include/linux/skbuff.h:3243 skb_network_header_len include/linux/skbuff.h:3243 [inline] WARNING: CPU: 0 PID: 14949 at net/sched/act_skbmod.c:55 tcf_skbmod_act+0xfe8/0x1810 net/sched/act_skbmod.c:55
There are a few issues in tcf_skbmod_act():
1. Calling skb_network_header_len() assumes skb->transport_header is set, which is not guaranteed when tcf_skbmod_act() runs at TC ingress.
2. Unconditionally calling skb_mac_header_len() at the beginning of tcf_skbmod_act() triggers a warning on L3 devices (e.g. TUN) where the MAC header is unset, evaluating to an underflowed garbage length.
3. On TC ingress, skb->data points to the network header. Adding the MAC header length to the IP header length causes skb_ensure_writable() to request more bytes than the actual IP packet length, dropping valid short packets (e.g. 28-byte UDP/IPv4 packets).
Fix these by:
- Using skb_network_offset(skb) + sizeof(struct iphdr/ipv6hdr) for SKBMOD_F_ECN so that the required length is correctly calculated on both ingress (offset == 0) and egress (offset == mac_len).
- Setting max_edit_len to ETH_HLEN for Ethernet header modifications after validating ARPHRD_ETHER.
--- net/sched/act_skbmod.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
net/sched/act_skbmod.c +8 -4
@@ -36,7 +36,6 @@ static int tcf_skbmod_act(struct sk_buff *skb, const struct tc_action *a,if (unlikely (p->action ==TC_ACT_SHOT )) goto drop; - max_edit_len =skb_mac_header_len (skb); flags = p->flags;/* tcf_skbmod_init() guarantees "flags" to be one of the following:
@@ -49,14 +48,19 @@ static int tcf_skbmod_act(struct sk_buff *skb, const struct tc_action *a,if (flags ==SKBMOD_F_ECN ) {switch (skb_protocol (skb, true)) {case cpu_to_be16 (ETH_P_IP ): + max_edit_len =sizeof (struct iphdr ); +break ;case cpu_to_be16 (ETH_P_IPV6 ): - max_edit_len +=skb_network_header_len (skb); + max_edit_len =sizeof (struct ipv6hdr );break ;default : goto out; } - }else if (!skb->dev || skb->dev->type !=ARPHRD_ETHER ) { - goto out; + max_edit_len +=skb_network_offset (skb); + }else { +if (!skb->dev || skb->dev->type !=ARPHRD_ETHER ) + goto out; + max_edit_len =ETH_HLEN ; } err =skb_ensure_writable (skb, max_edit_len);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1105/1191 net/sched: fq_codel: clamp default quantum and mtu
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jamal Hadi Salim <[email protected]>
[ Upstream commit d9ebd8f9aa8b2773235889cb903fafd61f2d8585 ]
fq_codel_init() sets q->quantum = psched_mtu(qdisc_dev(sch)) without clamping. A device with a huge MTU (e.g. dummy with max_mtu == 0 accepting MTU 2147483634) makes psched_mtu() return 0x80000000, which overflows the signed flow->deficit to INT_MIN in fq_codel_dequeue(), causing an infinite loop and soft lockup. Emulate fq_codel_change() and constrain to [256, FQ_CODEL_QUANTUM_MAX].
The same unclamped psched_mtu() is assigned to q->cparams.mtu a bit below, and fq_codel_change() never updates it. codel_should_drop() tests "*backlog <= params->mtu"; with mtu == 0x80000000 (~2 GiB) and the default 32 MiB memory_limit, the test is always true, so CoDel is silently and completely disabled (no drops, no ECN). Declare a single clamped mtu and assign both q->quantum and q->cparams.mtu from it, which also removes the double psched_mtu() call.
Conditions to recreate the bug: a device whose MTU (plus hard_header_len) wraps psched_mtu() into the sign bit (e.g. a dummy device with max_mtu == 0 accepting MTU 2147483634). Requires CAP_NET_ADMIN in a user namespace.
--- net/sched/sch_fq_codel.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/sched/sch_fq_codel.c +4 -2
@@ -495,6 +495,7 @@ static int fq_codel_init(struct Qdisc *sch, struct nlattr *opt, struct netlink_ext_ack *extack) {struct fq_codel_sched_data *q =qdisc_priv (sch); +u32 mtu;int i;int err;
@@ -502,13 +503,14 @@ static int fq_codel_init(struct Qdisc *sch, struct nlattr *opt, q->flows_cnt =1024 ; q->memory_limit =32 <<20 ;/* 32 MBytes */ q->drop_batch_size =64 ; - q->quantum =psched_mtu (qdisc_dev (sch)); + mtu =clamp_t (u32,psched_mtu (qdisc_dev (sch)),256 ,FQ_CODEL_QUANTUM_MAX ); + q->quantum = mtu;INIT_LIST_HEAD (&q->new_flows);INIT_LIST_HEAD (&q->old_flows);codel_params_init (&q->cparams);codel_stats_init (&q->cstats); q->cparams.ecn = true; - q->cparams.mtu =psched_mtu (qdisc_dev (sch)); + q->cparams.mtu = mtu;if (opt) { err =fq_codel_change (sch, opt, extack);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1106/1191 net/sched: sch_codel: clamp default mtu to avoid disabling CoDel
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jamal Hadi Salim <[email protected]>
[ Upstream commit 6439461f1618ae176c048673ad28bdb6c68efbfc ]
codel_init() sets q->params.mtu = psched_mtu(qdisc_dev(sch)) without clamping. A device with a huge MTU (e.g. dummy with max_mtu == 0 accepting MTU 2147483634) makes psched_mtu() return 0x80000000. In codel_should_drop() the test "*backlog <= params->mtu" then compares the backlog against ~2 GiB; with the default sch->limit of DEFAULT_CODEL_LIMIT (1000) packets the backlog can never reach it, so the test is always true and CoDel is silently and completely disabled i.e no drops, no ECN marking, codel degrades to a tail-drop FIFO. codel_change() never updates params.mtu, so the init path is the only place to clamp it. Constrain to [256, 1 << 20], matching the fq_codel bound; 256 is a sane floor that only makes CoDel slightly more willing to act on very small queues, which is the safe direction.
Conditions to recreate the bug: a device whose MTU (plus hard_header_len) wraps psched_mtu() into the sign bit (e.g. a dummy device with max_mtu == 0 accepting MTU 2147483634). Requires CAP_NET_ADMIN in a user namespace.
--- net/sched/sch_codel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sched/sch_codel.c +1 -1
@@ -228,7 +228,7 @@ static int codel_init(struct Qdisc *sch, struct nlattr *opt,codel_params_init (&q->params);codel_vars_init (&q->vars);codel_stats_init (&q->stats); - q->params.mtu =psched_mtu (qdisc_dev (sch)); + q->params.mtu =clamp_t (u32,psched_mtu (qdisc_dev (sch)),256 ,1 <<20 );if (opt) {int err =codel_change (sch, opt, extack);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1107/1191 net/sched: fq_pie: clamp default quantum to avoid signed overflow
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jamal Hadi Salim <[email protected]>
[ Upstream commit c86cd7ed0b0e44779a3d1683f03e4353baf4bdc9 ]
fq_pie_init() sets q->quantum = psched_mtu(qdisc_dev(sch)) without clamping. A device with a huge MTU (e.g. dummy with max_mtu == 0 accepting MTU 2147483634) makes psched_mtu() return 0x80000000, which overflows the signed flow->deficit to INT_MIN in fq_pie_qdisc_dequeue(), causing an infinite loop and soft lockup. Emulate fq_pie_policy which is already bounded to [1, 1 << 20]; clamp the default to [256, 1 << 20]. 256 matches fq_codel's floor and is a sane minimum for a DRR quantum.
Conditions to recreate the bug: a device whose MTU (plus hard_header_len) wraps psched_mtu() into the sign bit (e.g. a dummy device with max_mtu == 0 accepting MTU 2147483634). Requires CAP_NET_ADMIN in a user namespace.
--- net/sched/sch_fq_pie.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/sched/sch_fq_pie.c +2 -1
@@ -416,7 +416,8 @@ static int fq_pie_init(struct Qdisc *sch, struct nlattr *opt,pie_params_init (&q->p_params); sch->limit =10 *1024 ; q->p_params.limit = sch->limit; - q->quantum =psched_mtu (qdisc_dev (sch)); + q->quantum =clamp_t (u32,psched_mtu (qdisc_dev (sch)), +256 ,1 <<20 ); q->sch = sch; q->ecn_prob =10 ; q->flows_cnt =1024 ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1108/1191 net/sched: hhf: clamp quantum before hhf_change() to avoid overflow
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jamal Hadi Salim <[email protected]>
[ Upstream commit 2164b512b97bb053e8ce4d6e95576f11bed6a005 ]
hhf_init() sets q->quantum = psched_mtu(qdisc_dev(sch)) with no overflow check. A device with a huge MTU (e.g. dummy with max_mtu == 0 accepting MTU 2147483634) makes weight * quantum overflow the signed deficit in hhf_dequeue(), spinning forever.
Clamp q->quantum before hhf_change() so both the opt and !opt paths see a sane quantum. Without this, bare "tc qdisc add ... hhf" succeeds with a clamped quantum but "tc qdisc add ... hhf limit 1000" (any option present) fails with -EINVAL because hhf_change() re-validates the unclamped default (sch_hhf.c:559). 256 matches fq_codel's floor and is a sane minimum for a DRR quantum.
Conditions to recreate the bug: a device whose MTU (plus hard_header_len) wraps psched_mtu() into the sign bit (e.g. a dummy device with max_mtu == 0 accepting MTU 2147483634). Requires CAP_NET_ADMIN in a user namespace.
--- net/sched/sch_hhf.c | 4 ++++ 1 file changed, 4 insertions(+)
net/sched/sch_hhf.c +4 -0
@@ -617,6 +617,10 @@ static int hhf_init(struct Qdisc *sch, struct nlattr *opt, q->hhf_evict_timeout =HZ ;/* 1 sec */ q->hhf_non_hh_weight =2 ; +if ((int )q->quantum <=0 || + (u64 )q->quantum * q->hhf_non_hh_weight >INT_MAX ) + q->quantum =256 ; +if (opt) {int err =hhf_change (sch, opt, extack);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1109/1191 net/sched: sfq: clamp quantum to avoid signed overflow soft lockup
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jamal Hadi Salim <[email protected]>
[ Upstream commit 816e90057ab1879562a5b7cc688e35bb9027ae97 ]
sfq_init() sets q->quantum = psched_mtu(qdisc_dev(sch)) (unsigned). A device with a huge MTU (e.g. dummy with max_mtu == 0 accepting MTU 2147483634) makes psched_mtu() return 0x80000000, so slot->allot = INT_MIN and INT_MIN + INT_MIN toggles between INT_MIN and 0 forever, spinning sfq_dequeue() under the qdisc lock.
Clamp the quantum to [256, 1 << 20] so the refill loop terminates. The lower bound also covers q->quantum == 0 (psched_mtu() returning 0), which spins sfq_dequeue() identically. sfq_change() already rejects a negative quantum, so only the init path was exposed.
Conditions to recreate the bug: a device whose MTU (plus hard_header_len) wraps psched_mtu() into the sign bit (e.g. a dummy device with max_mtu == 0 accepting MTU 2147483634). Requires CAP_NET_ADMIN in a user namespace.
--- net/sched/sch_sfq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/sched/sch_sfq.c +2 -1
@@ -796,7 +796,8 @@ static int sfq_init(struct Qdisc *sch, struct nlattr *opt, q->tail =NULL ; q->divisor =SFQ_DEFAULT_HASH_DIVISOR ; q->maxflows =SFQ_DEFAULT_FLOWS ; - q->quantum =psched_mtu (qdisc_dev (sch)); + q->quantum =clamp_t (u32,psched_mtu (qdisc_dev (sch)), +256 ,1 <<20 ); q->perturb_period =0 ;get_random_bytes (&q->perturbation,sizeof (q->perturbation));
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1110/1191 net/sched: sch_teql: restore skb->dev on the slave failure path
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Victor Nogueira <[email protected]>
[ Upstream commit dc4b95b8fee95113587e93ca116356032d271371 ]
teql_master_xmit() sets skb->dev = slave before calling the slave's ndo_start_xmit(), but never restores it when that transmit fails. The skb then walks on to the next slave still pointing at the previous one.
If a later slave has no resolved neighbour, teql_resolve() hands the skb to neigh_event_send(), which queues it on that neighbour's arp_queue with the stale skb->dev. skb->dev holds no reference, so deleting the previous slave frees the net_device while the skb is still queued. Whatever runs next on that skb - arp_error_report() on timeout, or neigh_direct_output() -> dev_queue_xmit() once the neighbour resolves - causes a UAF like the one below:
BUG: KASAN: slab-use-after-free in __icmp_send (net/ipv4/icmp.c:914 (discriminator 2)) Read of size 4 at addr ffff888106e100b0 by task flood_packet/527 CPU: 0 UID: 0 PID: 527 Comm: flood_packet Not tainted 7.2.0-rc6-g594d90519502 #1 PREEMPT(lazy) Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: <IRQ> dump_stack_lvl (lib/dump_stack.c:94 lib/dump_stack.c:120) print_report (mm/kasan/report.c:378 mm/kasan/report.c:482) ? __pfx__raw_spin_lock_irqsave (./include/asm-generic/qrwlock.h:122 (discriminator 4)) ? __icmp_send (net/ipv4/icmp.c:914 (discriminator 2)) kasan_report (mm/kasan/report.c:595) ? __icmp_send (net/ipv4/icmp.c:914 (discriminator 2)) __icmp_send (net/ipv4/icmp.c:914 (discriminator 2))
[...]ipv4_link_failure (net/ipv4/route.c:1251 net/ipv4/route.c:1258)
? __pfx_ipv4_link_failure (./include/linux/skbuff.h:4327)
? _raw_write_lock (./include/linux/instrumented.h:55 ./include/linux/atomic/atomic-instrumented.h:1301 ./include/asm-generic/qrwlock.h:98 ./include/linux/rwlock_api_smp.h:230 kernel/locking/spinlock.c:304) ? __pfx__raw_write_lock (kernel/locking/spinlock.c:175)arp_error_report (./include/net/dst.h:438 net/ipv4/arp.c:296)neigh_invalidate (net/core/neighbour.c:1077)neigh_timer_handler (net/core/neighbour.c:1169)
[...]
Allocated by task 505: kasan_save_stack (mm/kasan/common.c:57) kasan_save_track (mm/kasan/common.c:78) __kasan_kmalloc (mm/kasan/common.c:398 mm/kasan/common.c:415) __kvmalloc_node_noprof (./include/linux/kasan.h:263 mm/slub.c:5334 mm/slub.c:6905) alloc_netdev_mqs (net/core/dev.c:12055 (discriminator 2))
rtnl_create_link (net/core/rtnetlink.c:3721)rtnl_newlink (net/core/rtnetlink.c:3903 net/core/rtnetlink.c:4044 net/core/rtnetlink.c:4159) rtnetlink_rcv_msg (net/core/rtnetlink.c:7076)
[...]
Freed by task 536: kasan_save_stack (mm/kasan/common.c:57) kasan_save_track (mm/kasan/common.c:78) kasan_save_free_info (mm/kasan/generic.c:584) __kasan_slab_free (mm/kasan/common.c:253 mm/kasan/common.c:285) kfree (./include/linux/kasan.h:235 mm/slub.c:2677 mm/slub.c:6377 mm/slub.c:6692)
device_release (drivers/base/core.c:2636)kobject_put (lib/kobject.c:689 lib/kobject.c:720 ./include/linux/kref.h:65 lib/kobject.c:737) netdev_run_todo (net/core/dev.c:11756)rtnl_dellink (net/core/rtnetlink.c:157 ./include/linux/rtnetlink.h:135 net/core/rtnetlink.c:3651) rtnetlink_rcv_msg (net/core/rtnetlink.c:7076)
[...]
Fix this by restoring skb->dev to the master at the end of each slave's iteration.
--- net/sched/sch_teql.c | 1 + 1 file changed, 1 insertion(+)
net/sched/sch_teql.c +1 -0
@@ -377,6 +377,7 @@ static netdev_tx_t teql_master_xmit(struct sk_buff *skb, struct net_device *dev) nores =1 ;break ; } + skb->dev = dev;__skb_pull (skb,skb_network_offset (skb)); }while ((q =rcu_dereference (NEXT_SLAVE (q))) != start);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1111/1191 tpm: st33zp24: Return zero on status read failure
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ruoyu Wang <[email protected]>
[ Upstream commit 8b92687708f5ef980de01c2042dbd76d11f78547 ]
st33zp24_status() ignores the result of the transport read and returns data even when no byte was received. The I2C transport, for example, skips i2c_master_recv() when the register-select write is short or fails, leaving data uninitialized. The resulting stack value can be interpreted as TPM_STS flags and let status checks complete spuriously.
The status callback cannot propagate a transport error. Return zero unless recv() reports exactly one byte. With no status bits set, callers retry or take their existing timeout or error path instead of acting on an invalid status value.
This issue was found by a static analysis checker and confirmed by manual source review.
--- drivers/char/tpm/st33zp24/st33zp24.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/char/tpm/st33zp24/st33zp24.c +3 -1
@@ -92,7 +92,9 @@ static u8 st33zp24_status(struct tpm_chip *chip)struct st33zp24_dev *tpm_dev =dev_get_drvdata (&chip->dev);u8 data; - tpm_dev->ops->recv (tpm_dev->phy_id,TPM_STS , &data,1 ); +if (tpm_dev->ops->recv (tpm_dev->phy_id,TPM_STS , &data,1 ) !=1 ) +return 0 ; +return data; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1112/1191 tpm: st33zp24: Validate locality read result
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ruoyu Wang <[email protected]>
[ Upstream commit 264216889d39df509b9c8045df53529480b0b718 ]
check_locality() treats every nonzero transport return as success. SPI errors remain negative, while the I2C path can convert a negative write error through its byte-sized status variable. Either result is nonzero even though the TPM_ACCESS byte can remain unwritten, so indeterminate ACTIVE_LOCALITY and VALID bits can falsely report an active locality.
Require recv() to return exactly the requested byte before examining TPM_ACCESS. Transport errors and short reads now report an inactive locality, while successful reads retain the existing behavior.
This issue was found by a static analysis checker and confirmed by manual source review.
--- drivers/char/tpm/st33zp24/st33zp24.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/char/tpm/st33zp24/st33zp24.c +2 -2
@@ -105,10 +105,10 @@ static bool check_locality(struct tpm_chip *chip) {struct st33zp24_dev *tpm_dev =dev_get_drvdata (&chip->dev);u8 data; -u8 status; +int status; status = tpm_dev->ops->recv (tpm_dev->phy_id,TPM_ACCESS , &data,1 ); -if (status && (data & +if (status ==1 && (data & (TPM_ACCESS_ACTIVE_LOCALITY |TPM_ACCESS_VALID )) == (TPM_ACCESS_ACTIVE_LOCALITY |TPM_ACCESS_VALID ))return true;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1113/1191 apparmor: Replace sprintf/strcpy with scnprintf/strscpy in aa_policy_init
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thorsten Blum <[email protected]>
[ Upstream commit b31d3f7385fbb49681d44e7104cfa033cba4b1e8 ]
strcpy() is deprecated and sprintf() does not perform bounds checking either. Although an overflow is unlikely, it's better to proactively avoid it by using the safer strscpy() and scnprintf(), respectively.
Additionally, unify memory allocation for 'hname' to simplify and improve aa_policy_init().
Stable-dep-of: 3daad923a868 ("apparmor: policy_int make sure list heads are initialized before fail path")
--- security/apparmor/lib.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)
security/apparmor/lib.c +7 -9
@@ -506,19 +506,17 @@ bool aa_policy_init(struct aa_policy *policy, const char *prefix, const char *name, gfp_t gfp) { char *hname; +size_t hname_sz; + hname_sz = (prefix ?strlen (prefix) +2 :0 ) +strlen (name) +1 ;/* freed by policy_free */ -if (prefix) { - hname =aa_str_alloc (strlen (prefix) +strlen (name) +3 , gfp); -if (hname) -sprintf (hname,"%s//%s" , prefix, name); - }else { - hname =aa_str_alloc (strlen (name) +1 , gfp); -if (hname) -strcpy (hname, name); - } + hname =aa_str_alloc (hname_sz, gfp);if (!hname)return false; +if (prefix) +scnprintf (hname, hname_sz,"%s//%s" , prefix, name); +else +strscpy (hname, name, hname_sz); policy->hname = hname;/* base.name is a substring of fqname */ policy->name =basename (policy->hname);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1114/1191 apparmor: policy_int make sure list heads are initialized before fail path
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: John Johansen <[email protected]>
[ Upstream commit 3daad923a8685adb66087e0d819559b7eb6ba975 ]
If profile create fails before policy_init is complete the list heads are not properly initialized causing profile_free() sanity checks to trigger the following splat.
AppArmor WARN aa_policy_destroy: (((!list_empty(&policy->profiles) && (&policy->profiles)->prev != ((void *) 0x122 + (0xdead000000000000UL))))):
WARNING: security/apparmor/lib.c:509 at aa_policy_destroy+0x164/0x1b0 security/apparmor/lib.c:509, CPU#0: syz.0.17/5541 Modules linked in: CPU: 0 UID: 0 PID: 5541 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 RIP: 0010:aa_policy_destroy+0x16b/0x1b0 security/apparmor/lib.c:509 Code: 85 ed 7e 4d e8 96 bc 37 fd 5b 41 5c 41 5e 41 5f 5d e9 19 27 4e 07 cc e8 83 bc 37 fd 48 8d 3d 0c f0 d3 0b 48 c7 c6 a4 eb 38 8e <67> 48 0f b9 3a e9 04 ff ff ff e8 66 bc 37 fd 48 8d 3d ff ef d3 0b RSP: 0018:ffffc9000345eaa0 EFLAGS: 00010293 RAX: ffffffff848f530d RBX: ffff88803f734800 RCX: ffff88801af2a580 RDX: 0000000000000000 RSI: ffffffff8e38eba4 RDI: ffffffff90634320 RBP: 0000000000000000 R08: 0000000000000cc0 R09: 00000000ffffffff R10: dffffc0000000000 R11: fffffbfff1d95913 R12: dead000000000122 R13: ffff88803f734800 R14: ffff88803f734828 R15: dffffc0000000000 FS: 00007f5f6a1836c0(0000) GS:ffff88808c519000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055d02407b048 CR3: 0000000012aa9000 CR4: 0000000000352ef0 Call Trace: <TASK> aa_free_profile+0x9d/0x9f0 security/apparmor/policy.c:334 aa_alloc_profile+0x1e4/0x3e0 security/apparmor/policy.c:416 unpack_profile security/apparmor/policy_unpack.c:1153 [inline] aa_unpack+0x17db/0x7430 security/apparmor/policy_unpack.c:1748 aa_replace_profiles+0x226/0x2a20 security/apparmor/policy.c:1183 policy_update+0x234/0x4a0 security/apparmor/apparmorfs.c:505 profile_load+0x1cb/0x320 security/apparmor/apparmorfs.c:522 vfs_write+0x296/0xba0 fs/read_write.c:685 ksys_write+0x150/0x270 fs/read_write.c:739 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f5f6939e0d9 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f5f6a183028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f5f69625fa0 RCX: 00007f5f6939e0d9 RDX: 0000000000000041 RSI: 0000200000000400 RDI: 0000000000000003 RBP: 00007f5f6a183090 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007f5f69626038 R14: 00007f5f69625fa0 R15: 00007ffe23725c18
--- security/apparmor/lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
security/apparmor/lib.c +2 -2
@@ -508,6 +508,8 @@ bool aa_policy_init(struct aa_policy *policy, const char *prefix,char *hname;size_t hname_sz; +INIT_LIST_HEAD (&policy->list); +INIT_LIST_HEAD (&policy->profiles); hname_sz = (prefix ?strlen (prefix) +2 :0 ) +strlen (name) +1 ;/* freed by policy_free */ hname =aa_str_alloc (hname_sz, gfp);
@@ -520,8 +522,6 @@ bool aa_policy_init(struct aa_policy *policy, const char *prefix, policy->hname = hname;/* base.name is a substring of fqname */ policy->name =basename (policy->hname); -INIT_LIST_HEAD (&policy->list); -INIT_LIST_HEAD (&policy->profiles);return true; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1115/1191 ASoC: dapm: Fix off-by-one check on the second enum channel
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: HyeongJun An <[email protected]>
[ Upstream commit 14511c9b54ceeeef487409d73947c89ee8563590 ]
The snd_soc_dapm_put_enum_double() rejects item[0] once it reaches e->items, but it lets item[1] be equal to it. Both go on to snd_soc_enum_item_to_val(), which indexes e->values with no bound of its own, so an enum with a value table reads one element past the end.
The indexing arrived with the MUX consolidation, which relaxed the item[1] check in the same hunk. The value MUX handler it deleted used
Quoted 1 line
= there, and the
snd_soc_put_enum_double()insoc-ops.cstill does.
Only adav80x pairs a value table with two shifts, and its second channel looks accidental, but the control does report two values. Writing three into it reads off the end of adav80x_mux_values. The core catches that only under CONFIG_SND_CTL_INPUT_VALIDATION, which defaults off.
--- sound/soc/soc-dapm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/soc-dapm.c +1 -1
@@ -3525,7 +3525,7 @@ int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol, val =snd_soc_enum_item_to_val (e, item[0 ]) << e->shift_l; mask = e->mask << e->shift_l;if (e->shift_l != e->shift_r) { -if (item[1 ] > e->items) +if (item[1 ] >= e->items)return -EINVAL ; val |=snd_soc_enum_item_to_val (e, item[1 ]) << e->shift_r; mask |= e->mask << e->shift_r;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1116/1191 libceph: validate banner payload length
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aleksandr Nogikh <[email protected]>
[ Upstream commit f374967fcdf04001c9b66df1c19106fa83cd91f7 ]
When parsing the Ceph messenger v2 protocol banner, the payload_len field is decoded from the banner prefix. If a client sends a banner with a payload_len of 0, the kernel sets up a 0-length socket read. This violates an invariant in the state machine, triggering a warning in populate_in_iter():
------------[ cut here ]------------ !iov_iter_count(&con->v2.in_iter) WARNING: net/ceph/messenger_v2.c:3129 at populate_in_iter net/ceph/messenger_v2.c:3129 [inline], CPU#1: kworker/1:3/5070 WARNING: net/ceph/messenger_v2.c:3129 at ceph_con_v2_try_read+0x6634/0x6810 net/ceph/messenger_v2.c:3159, CPU#1: kworker/1:3/5070 ... Call Trace: <TASK> ceph_con_workfn+0x1f5/0x14a0 net/ceph/messenger.c:1575 process_one_work kernel/workqueue.c:3322 [inline] process_scheduled_works+0xa8e/0x14e0 kernel/workqueue.c:3405 worker_thread+0xa47/0xfb0 kernel/workqueue.c:3486 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>
According to the msgr2 protocol specification, the banner payload is expected to contain at least two 64-bit integers (server_feat and server_req_feat). Therefore, payload_len must be at least 16 bytes.
Fix this by adding a check in process_banner_prefix() to reject a payload_len smaller than 16 bytes. This prevents the 0-length read and correctly aborts the connection with a protocol error.
--- net/ceph/messenger_v2.c | 5 +++++ 1 file changed, 5 insertions(+)
net/ceph/messenger_v2.c +5 -0
@@ -1954,6 +1954,11 @@ static int process_banner_prefix(struct ceph_connection *con) payload_len =ceph_decode_16 (&p);dout ("%s con %p payload_len %d\n" , __func__, con, payload_len); +if (payload_len <sizeof (u64) +sizeof (u64)) { + con->error_msg ="protocol error, bad banner payload len" ; +return -EINVAL ; + } +return prepare_read_banner_payload (con, payload_len); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1117/1191 net: ethernet: sun4i-emac: Fix IRQ error handling
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <[email protected]>
[ Upstream commit 991c2be78257cba5bf53cf935fe70f8836964288 ]
irq_of_parse_and_map() returns 0 when parsing or mapping an IRQ fails. The current code checks for -ENXIO and therefore does not detect the failure.
Check for a zero return value and convert it to -ENXIO.
--- drivers/net/ethernet/allwinner/sun4i-emac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/allwinner/sun4i-emac.c +2 -2
@@ -996,9 +996,9 @@ static int emac_probe(struct platform_device *pdev)/* fill in parameters for net-dev structure */ ndev->base_addr = (unsigned long )db->membase; ndev->irq =irq_of_parse_and_map (np,0 ); -if (ndev->irq == -ENXIO ) { +if (!ndev->irq) {netdev_err (ndev,"No irq resource\n" ); - ret = ndev->irq; + ret = -ENXIO ; goto out_iounmap; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1118/1191 net: stmmac: selftests: Pass the IP proto mask in the TC selftest
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maxime Chevallier <[email protected]>
[ Upstream commit 9a56a27e6002e29a6707dc4238d469ec84c3a68e ]
The stmmac TC filtering rules have recently gained sanity checks to make sure the passed keys and their respective masks are aligned with the HW filtering abilities.
The stmmac selftests failed to pass the mask in the match data for L4 filtering tests, and are now failing consistently with -EINVAL :
$ ethtool -t eth1 [...] 23. L4 DA TCP Filtering -22 24. L4 SA TCP Filtering -22 25. L4 DA UDP Filtering -22 26. L4 SA UDP Filtering -22
Let's pass the ip_proto mask in the l4 filtering tests match data. Found on imx8mp, which now have passing L4 tests :
$ ethtool -t eth1 [...] 23. L4 DA TCP Filtering 0 24. L4 SA TCP Filtering 0 25. L4 DA UDP Filtering 0 26. L4 SA UDP Filtering 0
While at it, initialize the masks and keys to avoid re-using whatever was on the stack.
--- drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c +4 -2
@@ -1452,11 +1452,11 @@ static int __stmmac_test_l4filt(struct stmmac_priv *priv, u32 dst, u32 src,struct {struct flow_dissector_key_basic bkey;struct flow_dissector_key_ports key; - }__aligned(BITS_PER_LONG / 8) keys; + }__aligned(BITS_PER_LONG / 8) keys = { };struct {struct flow_dissector_key_basic bmask;struct flow_dissector_key_ports mask; - }__aligned(BITS_PER_LONG / 8) masks; + }__aligned(BITS_PER_LONG / 8) masks = { };unsigned long dummy_cookie =0xdeadbeef ;struct stmmac_packet_attrs attr = { };struct flow_dissector *dissector;
@@ -1509,6 +1509,8 @@ static int __stmmac_test_l4filt(struct stmmac_priv *priv, u32 dst, u32 src, keys.bkey.ip_proto = udp ?IPPROTO_UDP :IPPROTO_TCP ; keys.key.src =htons (src); keys.key.dst =htons (dst); +/* Match the full IP proto field */ + masks.bmask.ip_proto =0xff ; masks.mask.src = src_mask; masks.mask.dst = dst_mask;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1119/1191 virtio-net: Ensure that TCP packets dont overflow gso_segs
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alice Mikityanska <[email protected]>
[ Upstream commit c27c449d455aafd9018a3cbab150f1c42c87923f ]
The user can specify any gso_size in a packet crafted with an AF_PACKET PACKET_VNET_HDR socket, even smaller than TCP_MIN_GSO_SIZE = 8. At the same time, GSO_MAX_SIZE = 8 * GSO_MAX_SEGS = 8 * 65535. When the user crafts a packet with gso_size < 8, there is a risk for partial GSO to overflow the 16-bit gso_segs field when dividing the SKB length by gso_size.
Adjust gso_size of TCP packets to be at least TCP_MIN_GSO_SIZE = 8. Keep gso_size of UDP GSO packets, as gso_size=1 is valid and explicitly tested at tools/testing/selftests/net/tun.c:649.
--- include/linux/virtio_net.h | 4 ++++ 1 file changed, 4 insertions(+)
include/linux/virtio_net.h +4 -0
@@ -4,6 +4,7 @@#include <linux/if_vlan.h> #include <linux/udp.h> +#include <net/tcp.h> #include <uapi/linux/tcp.h> #include <uapi/linux/virtio_net.h>
@@ -164,6 +165,9 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb,if (skb->ip_summed ==CHECKSUM_PARTIAL && skb->csum_offset != offsetof(struct tcphdr , check))return -EINVAL ; + +BUILD_BUG_ON (TCP_MIN_GSO_SIZE *GSO_MAX_SEGS <GSO_MAX_SIZE ); + gso_size =max (gso_size,TCP_MIN_GSO_SIZE );break ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1120/1191 netfilter: nf_tables: move hardware offload step after building the chain blob
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <[email protected]>
[ Upstream commit b1881d362e1924b66f6016c3efd28807032b41bf ]
Allocate the chain blob before the ruleset offload to reduce chances of entering an inconsistent state where the offloaded ruleset in the nic and the software ruleset differ.
--- net/netfilter/nf_tables_api.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
net/netfilter/nf_tables_api.c +10 -4
@@ -9793,10 +9793,6 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb)if (nf_tables_validate (net) <0 )return -EAGAIN ; - err =nft_flow_rule_offload_commit (net); -if (err <0 ) -return err; -/* 1. Allocate space for next generation rules_gen_X[] */ list_for_each_entry_safe (trans, next, &nft_net->commit_list, list) {int ret;
@@ -9820,6 +9816,16 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb) } } +/* must be last, so audit and chain blob set up does not leave hardware +* in consistent state. +*/ + err =nft_flow_rule_offload_commit (net); +if (err <0 ) { +nf_tables_commit_chain_prepare_cancel (net); +nf_tables_commit_audit_free (&adl); +return err; + } +/* step 2. Make rules_gen_X visible to packet path */ list_for_each_entry (table, &nft_net->tables, list) {list_for_each_entry (chain, &table->chains, list)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1121/1191 netfilter: xt_cgroup: Make it independent from net_cls
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Koutný <[email protected]>
[ Upstream commit 3ba0032afea888d0edebf5ece3c6b36417189b63 ]
The xt_group matching supports the default hierarchy since commit c38c4597e4bf3 ("netfilter: implement xt_cgroup cgroup2 path match"). The cgroup v1 matching (based on clsid) and cgroup v2 matching (based on path) are rather independent. Downgrade the Kconfig dependency to mere CONFIG_SOCK_GROUP_DATA so that xt_group can be built even without CONFIG_NET_CLS_CGROUP for path matching.
Also add a message for users when they attempt to specify any clsid.
Stable-dep-of: 793d9eda4821 ("netfilter: x_tables: replace pr_{info,err}() by pr_info_ratelimited()")
--- net/netfilter/Kconfig | 2 +- net/netfilter/xt_cgroup.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-)
net/netfilter/Kconfig +1 -1
@@ -1178,7 +1178,7 @@ config NETFILTER_XT_MATCH_CGROUP tristate '"control group" match support' depends on NETFILTER_ADVANCED depends on CGROUPS - select CGROUP_NET_CLASSID + select SOCK_CGROUP_DATA help Socket/process control group matching allows you to match locally generated packets based on which net_cls control group processes
net/netfilter/xt_cgroup.c +17 -0
@@ -23,6 +23,8 @@ MODULE_DESCRIPTION("Xtables: process control group matching");MODULE_ALIAS ("ipt_cgroup" );MODULE_ALIAS ("ip6t_cgroup" ); +#define NET_CLS_CLASSID_INVALID_MSG "xt_cgroup: classid invalid without net_cls cgroups\n" +static int cgroup_mt_check_v0 (const struct xt_mtchk_param *par) {struct xt_cgroup_info_v0 *info = par->matchinfo;
@@ -30,6 +32,11 @@ static int cgroup_mt_check_v0(const struct xt_mtchk_param *par)if (info->invert & ~1 )return -EINVAL ; +if (!IS_ENABLED (CONFIG_CGROUP_NET_CLASSID )) { +pr_info (NET_CLS_CLASSID_INVALID_MSG ); +return -EINVAL ; + } +return 0 ; }
@@ -51,6 +58,11 @@ static int cgroup_mt_check_v1(const struct xt_mtchk_param *par)return -EINVAL ; } +if (info->has_classid && !IS_ENABLED (CONFIG_CGROUP_NET_CLASSID )) { +pr_info (NET_CLS_CLASSID_INVALID_MSG ); +return -EINVAL ; + } + info->priv =NULL ;if (info->has_path) {if (strnlen (info->path,sizeof (info->path)) >=sizeof (info->path))
@@ -86,6 +98,11 @@ static int cgroup_mt_check_v2(const struct xt_mtchk_param *par)return -EINVAL ; } +if (info->has_classid && !IS_ENABLED (CONFIG_CGROUP_NET_CLASSID )) { +pr_info (NET_CLS_CLASSID_INVALID_MSG ); +return -EINVAL ; + } + info->priv =NULL ;if (info->has_path) {if (strnlen (info->path,sizeof (info->path)) >=sizeof (info->path))
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1122/1191 netfilter: xt_HL: add pr_fmt and checkentry validation
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marino Dzalto <[email protected]>
[ Upstream commit 24bd5c2679caf8a228d90cafa221da4b47fd6642 ]
Add pr_fmt to prefix log messages with the module name for easier debugging in dmesg.
Add checkentry functions for IPv4 (ttl_mt_check) and IPv6 (hl_mt6_check) to validate the match mode at rule registration time, rejecting invalid modes with -EINVAL.
The evaluation function returns false in case the mode is unknown, so this is a cleanup, not a bug fix.
Stable-dep-of: 793d9eda4821 ("netfilter: x_tables: replace pr_{info,err}() by pr_info_ratelimited()")
--- net/netfilter/xt_hl.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
net/netfilter/xt_hl.c +27 -0
@@ -6,6 +6,7 @@* Hop Limit matching module * (C) 2001-2002 Maciej Soltysiak <[email protected]> */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt#include <linux/ip.h> #include <linux/ipv6.h>
@@ -22,6 +23,18 @@ MODULE_LICENSE("GPL");MODULE_ALIAS ("ipt_ttl" );MODULE_ALIAS ("ip6t_hl" ); +static int ttl_mt_check (const struct xt_mtchk_param *par) +{ +const struct ipt_ttl_info *info = par->matchinfo; + +if (info->mode >IPT_TTL_GT ) { +pr_err ("Unknown TTL match mode: %d\n" , info->mode); +return -EINVAL ; + } + +return 0 ; +} +static bool ttl_mt (const struct sk_buff *skb,struct xt_action_param *par) {const struct ipt_ttl_info *info = par->matchinfo;
@@ -41,6 +54,18 @@ static bool ttl_mt(const struct sk_buff *skb, struct xt_action_param *par)return false; } +static int hl_mt6_check (const struct xt_mtchk_param *par) +{ +const struct ip6t_hl_info *info = par->matchinfo; + +if (info->mode >IP6T_HL_GT ) { +pr_err ("Unknown Hop Limit match mode: %d\n" , info->mode); +return -EINVAL ; + } + +return 0 ; +} +static bool hl_mt6 (const struct sk_buff *skb,struct xt_action_param *par) {const struct ip6t_hl_info *info = par->matchinfo;
@@ -65,6 +90,7 @@ static struct xt_match hl_mt_reg[] __read_mostly = { .name = "ttl", .revision = 0, .family = NFPROTO_IPV4, + .checkentry = ttl_mt_check, .match = ttl_mt, .matchsize = sizeof(struct ipt_ttl_info), .me = THIS_MODULE,
@@ -73,6 +99,7 @@ static struct xt_match hl_mt_reg[] __read_mostly = { .name = "hl", .revision = 0, .family = NFPROTO_IPV6, + .checkentry = hl_mt6_check, .match = hl_mt6, .matchsize = sizeof(struct ip6t_hl_info), .me = THIS_MODULE,
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1123/1191 netfilter: x_tables: replace pr_{info,err}() by pr_info_ratelimited()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <[email protected]>
[ Upstream commit 793d9eda4821f75b5f7cc9e6a870b72a58b44c2b ]
Several xtables extension still use pr_err() or pr_info() without ratelimit.
For xt_cgroup, while at this, remove redundant "xt_cgroup:" prefix since pr_fmt is already set on.
--- net/netfilter/xt_cgroup.c | 12 ++++++------ net/netfilter/xt_hl.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-)
net/netfilter/xt_cgroup.c +6 -6
@@ -23,7 +23,7 @@ MODULE_DESCRIPTION("Xtables: process control group matching");MODULE_ALIAS ("ipt_cgroup" );MODULE_ALIAS ("ip6t_cgroup" ); -#define NET_CLS_CLASSID_INVALID_MSG "xt_cgroup: classid invalid without net_cls cgroups\n" +#define NET_CLS_CLASSID_INVALID_MSG "classid invalid without net_cls cgroups\n"static int cgroup_mt_check_v0 (const struct xt_mtchk_param *par) {
@@ -33,7 +33,7 @@ static int cgroup_mt_check_v0(const struct xt_mtchk_param *par)return -EINVAL ;if (!IS_ENABLED (CONFIG_CGROUP_NET_CLASSID )) { -pr_info (NET_CLS_CLASSID_INVALID_MSG ); +pr_info_ratelimited (NET_CLS_CLASSID_INVALID_MSG );return -EINVAL ; }
@@ -49,7 +49,7 @@ static int cgroup_mt_check_v1(const struct xt_mtchk_param *par)return -EINVAL ;if (!info->has_path && !info->has_classid) { -pr_info ("xt_cgroup: no path or classid specified\n" ); +pr_info_ratelimited ("no path or classid specified\n" );return -EINVAL ; }
@@ -59,7 +59,7 @@ static int cgroup_mt_check_v1(const struct xt_mtchk_param *par) }if (info->has_classid && !IS_ENABLED (CONFIG_CGROUP_NET_CLASSID )) { -pr_info (NET_CLS_CLASSID_INVALID_MSG ); +pr_info_ratelimited (NET_CLS_CLASSID_INVALID_MSG );return -EINVAL ; }
@@ -89,7 +89,7 @@ static int cgroup_mt_check_v2(const struct xt_mtchk_param *par)return -EINVAL ;if (!info->has_path && !info->has_classid) { -pr_info ("xt_cgroup: no path or classid specified\n" ); +pr_info_ratelimited ("no path or classid specified\n" );return -EINVAL ; }
@@ -99,7 +99,7 @@ static int cgroup_mt_check_v2(const struct xt_mtchk_param *par) }if (info->has_classid && !IS_ENABLED (CONFIG_CGROUP_NET_CLASSID )) { -pr_info (NET_CLS_CLASSID_INVALID_MSG ); +pr_info_ratelimited (NET_CLS_CLASSID_INVALID_MSG );return -EINVAL ; }
net/netfilter/xt_hl.c +2 -2
@@ -28,7 +28,7 @@ static int ttl_mt_check(const struct xt_mtchk_param *par)const struct ipt_ttl_info *info = par->matchinfo;if (info->mode >IPT_TTL_GT ) { -pr_err ("Unknown TTL match mode: %d\n" , info->mode); +pr_info_ratelimited ("Unknown TTL match mode: %d\n" , info->mode);return -EINVAL ; }
@@ -59,7 +59,7 @@ static int hl_mt6_check(const struct xt_mtchk_param *par)const struct ip6t_hl_info *info = par->matchinfo;if (info->mode >IP6T_HL_GT ) { -pr_err ("Unknown Hop Limit match mode: %d\n" , info->mode); +pr_info_ratelimited ("Unknown Hop Limit match mode: %d\n" , info->mode);return -EINVAL ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1124/1191 ALSA: control: Make snd_ctl_find_id() argument const
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
[ Upstream commit 6723670a483501497dc339ae37676525245a913a ]
The id object passed to snd_ctl_find_id() is only read, and we can mark it with const gracefully.
Stable-dep-of: 74e3b979ce8b ("ALSA: control: Don't add invalid kcontrols to LED layer")
--- include/sound/control.h | 2 +- sound/core/control.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
include/sound/control.h +1 -1
@@ -141,7 +141,7 @@ int snd_ctl_rename_id(struct snd_card * card, struct snd_ctl_elem_id *src_id, stvoid snd_ctl_rename (struct snd_card *card,struct snd_kcontrol *kctl,const char *name);int snd_ctl_activate_id (struct snd_card *card,struct snd_ctl_elem_id *id,int active);struct snd_kcontrol *snd_ctl_find_numid (struct snd_card * card,unsigned int numid); -struct snd_kcontrol *snd_ctl_find_id (struct snd_card * card,struct snd_ctl_elem_id *id); +struct snd_kcontrol *snd_ctl_find_id (struct snd_card *card,const struct snd_ctl_elem_id *id);int snd_ctl_create (struct snd_card *card);
sound/core/control.c +1 -1
@@ -829,7 +829,7 @@ EXPORT_SYMBOL(snd_ctl_find_numid);* */ struct snd_kcontrol *snd_ctl_find_id (struct snd_card *card, -struct snd_ctl_elem_id *id) +const struct snd_ctl_elem_id *id) {struct snd_kcontrol *kctl;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1125/1191 ALSA: control: Introduce unlocked version for snd_ctl_find_*() helpers
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
[ Upstream commit b1e055f67611daf098e27e8731386eeb5257bde3 ]
For reducing the unnecessary use of controls_rwsem in the drivers, this patch adds a new variant for snd_ctl_find_*() helpers:snd_ctl_find_id_locked() and snd_ctl_find_numid_locked() look for a kctl element inside the card->controls_rwsem -- that is, doing the very same as what snd_ctl_find_id() and snd_ctl_find_numid() did until now. snd_ctl_find_id() and snd_ctl_find_numid() remain same, i.e. still unlocked version, but they will be switched to locked version once after all callers are replaced.
The patch also replaces the calls of snd_ctl_find_id() and snd_ctl_find_numid() in a few places; all of those are places where we know that the functions are called properly with controls_rwsem held. All others are without rwsem (although they should have been).
After this patch, we'll turn on the locking in snd_ctl_find_id() and snd_ctl_find_numid() to be more race-free.
Stable-dep-of: 74e3b979ce8b ("ALSA: control: Don't add invalid kcontrols to LED layer")
--- include/sound/control.h | 4 ++- sound/core/control.c | 69 +++++++++++++++++++++++++++---------- sound/core/control_compat.c | 2 +- sound/core/control_led.c | 2 +- sound/core/oss/mixer_oss.c | 10 +++--- sound/pci/emu10k1/emufx.c | 2 +- 6 files changed, 61 insertions(+), 28 deletions(-)
include/sound/control.h +3 -1
@@ -140,7 +140,9 @@ int snd_ctl_remove_id(struct snd_card * card, struct snd_ctl_elem_id *id);int snd_ctl_rename_id (struct snd_card * card,struct snd_ctl_elem_id *src_id,struct snd_ctl_elem_id *dst_id);void snd_ctl_rename (struct snd_card *card,struct snd_kcontrol *kctl,const char *name);int snd_ctl_activate_id (struct snd_card *card,struct snd_ctl_elem_id *id,int active); -struct snd_kcontrol *snd_ctl_find_numid (struct snd_card * card,unsigned int numid); +struct snd_kcontrol *snd_ctl_find_numid_locked (struct snd_card *card,unsigned int numid); +struct snd_kcontrol *snd_ctl_find_numid (struct snd_card *card,unsigned int numid); +struct snd_kcontrol *snd_ctl_find_id_locked (struct snd_card *card,const struct snd_ctl_elem_id *id);struct snd_kcontrol *snd_ctl_find_id (struct snd_card *card,const struct snd_ctl_elem_id *id);int snd_ctl_create (struct snd_card *card);
sound/core/control.c +50 -19
176 lines not on this page · raw message
sound/core/control_compat.c +1 -1
@@ -173,7 +173,7 @@ static int get_ctl_type(struct snd_card *card, struct snd_ctl_elem_id *id,int err;down_read (&card->controls_rwsem); - kctl =snd_ctl_find_id (card, id); + kctl =snd_ctl_find_id_locked (card, id);if (! kctl) {up_read (&card->controls_rwsem);return -ENOENT ;
sound/core/control_led.c +1 -1
@@ -251,7 +251,7 @@ static int snd_ctl_led_set_id(int card_number, struct snd_ctl_elem_id *id, card =snd_card_ref (card_number);if (card) {down_write (&card->controls_rwsem); - kctl =snd_ctl_find_id (card, id); + kctl =snd_ctl_find_id_locked (card, id);if (kctl) { ioff =snd_ctl_get_ioff (kctl, id); vd = &kctl->vd[ioff];
sound/core/oss/mixer_oss.c +5 -5
@@ -524,7 +524,7 @@ static struct snd_kcontrol *snd_mixer_oss_test_id(struct snd_mixer_oss *mixer, c id.iface =SNDRV_CTL_ELEM_IFACE_MIXER ;strscpy (id.name, name,sizeof (id.name)); id.index = index; -return snd_ctl_find_id (card, &id); +return snd_ctl_find_id_locked (card, &id); } static void snd_mixer_oss_get_volume1_vol(struct snd_mixer_oss_file *fmixer,
@@ -540,7 +540,7 @@ static void snd_mixer_oss_get_volume1_vol(struct snd_mixer_oss_file *fmixer,if (numid ==ID_UNKNOWN )return ;down_read (&card->controls_rwsem); - kctl =snd_ctl_find_numid (card, numid); + kctl =snd_ctl_find_numid_locked (card, numid);if (!kctl) {up_read (&card->controls_rwsem);return ;
@@ -579,7 +579,7 @@ static void snd_mixer_oss_get_volume1_sw(struct snd_mixer_oss_file *fmixer,if (numid ==ID_UNKNOWN )return ;down_read (&card->controls_rwsem); - kctl =snd_ctl_find_numid (card, numid); + kctl =snd_ctl_find_numid_locked (card, numid);if (!kctl) {up_read (&card->controls_rwsem);return ;
@@ -645,7 +645,7 @@ static void snd_mixer_oss_put_volume1_vol(struct snd_mixer_oss_file *fmixer,if (numid ==ID_UNKNOWN )return ;down_read (&card->controls_rwsem); - kctl =snd_ctl_find_numid (card, numid); + kctl =snd_ctl_find_numid_locked (card, numid);if (!kctl) {up_read (&card->controls_rwsem);return ;
@@ -688,7 +688,7 @@ static void snd_mixer_oss_put_volume1_sw(struct snd_mixer_oss_file *fmixer,if (numid ==ID_UNKNOWN )return ;down_read (&card->controls_rwsem); - kctl =snd_ctl_find_numid (card, numid); + kctl =snd_ctl_find_numid_locked (card, numid);if (!kctl) {up_read (&card->controls_rwsem);return ;
sound/pci/emu10k1/emufx.c +1 -1
@@ -765,7 +765,7 @@ static int snd_emu10k1_verify_controls(struct snd_emu10k1 *emu,continue ; gctl_id = (struct snd_ctl_elem_id *)&gctl->id;down_read (&emu->card->controls_rwsem); -if (snd_ctl_find_id (emu->card, gctl_id)) { +if (snd_ctl_find_id_locked (emu->card, gctl_id)) {up_read (&emu->card->controls_rwsem); err = -EEXIST ; goto __error;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1126/1191 ALSA: control_led: Use guard() for locking
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
[ Upstream commit 7dba48a474e68dcdda2b212cea131b4c9ddc7d89 ]
We can simplify the code gracefully with new guard() macro and co for automatic cleanup of locks.
A couple of functions that use snd_card_ref() and *_unref() are also cleaned up with a defined class, too.
Only the code refactoring, and no functional changes.
Stable-dep-of: 74e3b979ce8b ("ALSA: control: Don't add invalid kcontrols to LED layer")
--- sound/core/control_led.c | 150 +++++++++++++++++---------------------- 1 file changed, 65 insertions(+), 85 deletions(-)
sound/core/control_led.c +65 -85
@@ -147,29 +147,27 @@ static void snd_ctl_led_set_state(struct snd_card *card, unsigned int access,return ; route =-1 ; found = false; -mutex_lock (&snd_ctl_led_mutex); -/* the card may not be registered (active) at this point */ -if (card && !snd_ctl_led_card_valid[card->number]) { -mutex_unlock (&snd_ctl_led_mutex); -return ; - } -list_for_each_entry (lctl, &led->controls, list) { -if (lctl->kctl == kctl && lctl->index_offset == ioff) - found = true; -UPDATE_ROUTE (route,snd_ctl_led_get (lctl)); - } -if (!found && kctl && card) { - lctl =kzalloc (sizeof (*lctl),GFP_KERNEL ); -if (lctl) { - lctl->card = card; - lctl->access = access; - lctl->kctl = kctl; - lctl->index_offset = ioff; -list_add (&lctl->list, &led->controls); + scoped_guard(mutex, &snd_ctl_led_mutex) { +/* the card may not be registered (active) at this point */ +if (card && !snd_ctl_led_card_valid[card->number]) +return ; +list_for_each_entry (lctl, &led->controls, list) { +if (lctl->kctl == kctl && lctl->index_offset == ioff) + found = true;UPDATE_ROUTE (route,snd_ctl_led_get (lctl)); } +if (!found && kctl && card) { + lctl =kzalloc (sizeof (*lctl),GFP_KERNEL ); +if (lctl) { + lctl->card = card; + lctl->access = access; + lctl->kctl = kctl; + lctl->index_offset = ioff; +list_add (&lctl->list, &led->controls); +UPDATE_ROUTE (route,snd_ctl_led_get (lctl)); + } + } } -mutex_unlock (&snd_ctl_led_mutex);switch (led->mode) {case MODE_OFF : route =1 ;break ;case MODE_ON : route =0 ;break ;
@@ -201,14 +199,13 @@ static unsigned int snd_ctl_led_remove(struct snd_kcontrol *kctl, unsigned int istruct snd_ctl_led_ctl *lctl;unsigned int ret =0 ; -mutex_lock (&snd_ctl_led_mutex); +guard (mutex)(&snd_ctl_led_mutex); lctl =snd_ctl_led_find (kctl, ioff);if (lctl && (access ==0 || access != lctl->access)) { ret = lctl->access;list_del (&lctl->list);kfree (lctl); } -mutex_unlock (&snd_ctl_led_mutex);return ret; }
@@ -239,44 +236,36 @@ static void snd_ctl_led_notify(struct snd_card *card, unsigned int mask, } } +DEFINE_FREE(snd_card_unref, struct snd_card *, if (_T) snd_card_unref(_T)) +static int snd_ctl_led_set_id (int card_number,struct snd_ctl_elem_id *id,unsigned int group,bool set) { -struct snd_card *card; + struct snd_card *card __free(snd_card_unref) = NULL;struct snd_kcontrol *kctl;struct snd_kcontrol_volatile *vd;unsigned int ioff, access, new_access; -int err =0 ; card =snd_card_ref (card_number); -if (card) { -down_write (&card->controls_rwsem); - kctl =snd_ctl_find_id_locked (card, id); -if (kctl) { - ioff =snd_ctl_get_ioff (kctl, id); - vd = &kctl->vd[ioff]; - access = vd->access &SNDRV_CTL_ELEM_ACCESS_LED_MASK ; -if (access !=0 && access !=group_to_access (group)) { - err = -EXDEV ; - goto unlock; - } - new_access = vd->access & ~SNDRV_CTL_ELEM_ACCESS_LED_MASK ; -if (set) - new_access |=group_to_access (group); -if (new_access != vd->access) { - vd->access = new_access; -snd_ctl_led_notify (card,SNDRV_CTL_EVENT_MASK_INFO , kctl, ioff); - } - }else { - err = -ENOENT ; - } -unlock: -up_write (&card->controls_rwsem); -snd_card_unref (card); - }else { - err = -ENXIO ; +if (!card) +return -ENXIO ; +guard (rwsem_write)(&card->controls_rwsem); + kctl =snd_ctl_find_id_locked (card, id); +if (!kctl) +return -ENOENT ; + ioff =snd_ctl_get_ioff (kctl, id); + vd = &kctl->vd[ioff]; + access = vd->access &SNDRV_CTL_ELEM_ACCESS_LED_MASK ; +if (access !=0 && access !=group_to_access (group)) +return -EXDEV ; + new_access = vd->access & ~SNDRV_CTL_ELEM_ACCESS_LED_MASK ; +if (set) + new_access |=group_to_access (group); +if (new_access != vd->access) { + vd->access = new_access; +snd_ctl_led_notify (card,SNDRV_CTL_EVENT_MASK_INFO , kctl, ioff); } -return err; +return 0 ; }static void snd_ctl_led_refresh (void )
@@ -312,7 +301,7 @@ static void snd_ctl_led_clean(struct snd_card *card)static int snd_ctl_led_reset (int card_number,unsigned int group) { -struct snd_card *card; + struct snd_card *card __free(snd_card_unref) = NULL;struct snd_ctl_led *led;struct snd_ctl_led_ctl *lctl;struct snd_kcontrol_volatile *vd;
@@ -322,26 +311,22 @@ static int snd_ctl_led_reset(int card_number, unsigned int group)if (!card)return -ENXIO ; -mutex_lock (&snd_ctl_led_mutex); -if (!snd_ctl_led_card_valid[card_number]) { -mutex_unlock (&snd_ctl_led_mutex); -snd_card_unref (card); -return -ENXIO ; - } - led = &snd_ctl_leds[group]; + scoped_guard(mutex, &snd_ctl_led_mutex) { +if (!snd_ctl_led_card_valid[card_number]) +return -ENXIO ; + led = &snd_ctl_leds[group]; repeat: -list_for_each_entry (lctl, &led->controls, list) -if (lctl->card == card) { - vd = &lctl->kctl->vd[lctl->index_offset]; - vd->access &= ~group_to_access (group); -snd_ctl_led_ctl_destroy (lctl); - change = true; - goto repeat; - } -mutex_unlock (&snd_ctl_led_mutex); +list_for_each_entry (lctl, &led->controls, list) +if (lctl->card == card) { + vd = &lctl->kctl->vd[lctl->index_offset]; + vd->access &= ~group_to_access (group); +snd_ctl_led_ctl_destroy (lctl); + change = true; + goto repeat; + } + }if (change)snd_ctl_led_set_state (NULL ,group_to_access (group),NULL ,0 ); -snd_card_unref (card);return 0 ; }
@@ -353,9 +338,8 @@ static void snd_ctl_led_register(struct snd_card *card)if (snd_BUG_ON (card->number <0 || card->number >=ARRAY_SIZE (snd_ctl_led_card_valid)))return ; -mutex_lock (&snd_ctl_led_mutex); - snd_ctl_led_card_valid[card->number] = true; -mutex_unlock (&snd_ctl_led_mutex); + scoped_guard(mutex, &snd_ctl_led_mutex) + snd_ctl_led_card_valid[card->number] = true;/* the register callback is already called with held card->controls_rwsem */ list_for_each_entry (kctl, &card->controls, list)for (ioff =0 ; ioff < kctl->count; ioff++)
@@ -367,10 +351,10 @@ static void snd_ctl_led_register(struct snd_card *card)static void snd_ctl_led_disconnect (struct snd_card *card) {snd_ctl_led_sysfs_remove (card); -mutex_lock (&snd_ctl_led_mutex); - snd_ctl_led_card_valid[card->number] = false; -snd_ctl_led_clean (card); -mutex_unlock (&snd_ctl_led_mutex); + scoped_guard(mutex, &snd_ctl_led_mutex) { + snd_ctl_led_card_valid[card->number] = false; +snd_ctl_led_clean (card); + }snd_ctl_led_refresh (); }
@@ -430,9 +414,8 @@ static ssize_t mode_store(struct device *dev,else return count; -mutex_lock (&snd_ctl_led_mutex); - led->mode = mode; -mutex_unlock (&snd_ctl_led_mutex); +scoped_guard (mutex, &snd_ctl_led_mutex) + led->mode = mode;snd_ctl_led_set_state (NULL ,group_to_access (led->group),NULL ,0 );return count;
@@ -615,15 +598,15 @@ static ssize_t list_show(struct device *dev, struct device_attribute *attr, char *buf) { struct snd_ctl_led_card *led_card = container_of(dev, struct snd_ctl_led_card, dev); -struct snd_card *card; + struct snd_card *card __free(snd_card_unref) = NULL;struct snd_ctl_led_ctl *lctl;size_t l =0 ; card =snd_card_ref (led_card->number);if (!card)return -ENXIO ; -down_read (&card->controls_rwsem); -mutex_lock (&snd_ctl_led_mutex); +guard (rwsem_read)(&card->controls_rwsem); +guard (mutex)(&snd_ctl_led_mutex);if (snd_ctl_led_card_valid[led_card->number]) {list_for_each_entry (lctl, &led_card->led->controls, list) {if (lctl->card != card)
@@ -634,9 +617,6 @@ static ssize_t list_show(struct device *dev, lctl->kctl->id.numid + lctl->index_offset); } } -mutex_unlock (&snd_ctl_led_mutex); -up_read (&card->controls_rwsem); -snd_card_unref (card);return l; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1127/1191 ALSA: control: Dont add invalid kcontrols to LED layer
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
[ Upstream commit 74e3b979ce8b78a690f8b94ccf2e2c965f7f5c11 ]
The kcontrol LED state layer tries to track the all associated kcontrol elements with naive assumptions that they are readable. But one can create a write-only element that has no get callback (even a user element can do it), and this may lead to a NULL dereference at the call chain of snd_ctl_led_notify(), as found by syzkaller.
For avoiding the Oops, add a sanity check of the kcontrol's info and get callbacks, and just skip the invalid kcontrols before assigning the kctl to the LED layer.
--- sound/core/control_led.c | 2 ++ 1 file changed, 2 insertions(+)
sound/core/control_led.c +2 -0
@@ -253,6 +253,8 @@ static int snd_ctl_led_set_id(int card_number, struct snd_ctl_elem_id *id, kctl =snd_ctl_find_id_locked (card, id);if (!kctl)return -ENOENT ; +if (!kctl->info || !kctl->get) +return -EINVAL ; ioff =snd_ctl_get_ioff (kctl, id); vd = &kctl->vd[ioff]; access = vd->access &SNDRV_CTL_ELEM_ACCESS_LED_MASK ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1128/1191 selftests: arm64: add hugetlb mte tests
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yang Shi <[email protected]>
[ Upstream commit 27879e8cb6b0fdb5cdcd76685f290729309711c6 ]
The tests cover mmap, mprotect hugetlb with MTE prot and COW.
Stable-dep-of: 8d2237e9d690 ("selftests/arm64: Print missing MTE TAP headers")
--- .../arm64/mte/check_hugetlb_options.c | 285 ++++++++++++++++++ 1 file changed, 285 insertions(+) create mode 100644 tools/testing/selftests/arm64/mte/check_hugetlb_options.c
tools/testing/selftests/arm64/mte/check_hugetlb_options.c new file +285 -0
@@ -0,0 +1,285 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (C) 2024 Ampere Computing LLC + +#define _GNU_SOURCE + +#include <errno.h> +#include <fcntl.h> +#include <signal.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <ucontext.h> +#include <sys/mman.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <sys/wait.h> + +#include "kselftest.h" +#include "mte_common_util.h" +#include "mte_def.h" + +#define TAG_CHECK_ON 0 +#define TAG_CHECK_OFF 1 + +static unsigned long default_huge_page_size (void ) +{ +unsigned long hps =0 ; +char *line =NULL ; +size_t linelen =0 ; +FILE *f =fopen ("/proc/meminfo" ,"r" ); + +if (!f) +return 0 ; +while (getline (&line, &linelen, f) >0 ) { +if (sscanf (line,"Hugepagesize: %lu kB" , &hps) ==1 ) { + hps <<=10 ; +break ; + } + } + +free (line); +fclose (f); +return hps; +} + +static bool is_hugetlb_allocated (void ) +{ +unsigned long hps =0 ; +char *line =NULL ; +size_t linelen =0 ; +FILE *f =fopen ("/proc/meminfo" ,"r" ); + +if (!f) +return false; +while (getline (&line, &linelen, f) >0 ) { +if (sscanf (line,"Hugetlb: %lu kB" , &hps) ==1 ) { + hps <<=10 ; +break ; + } + } + +free (line); +fclose (f); + +if (hps >0 ) +return true; + +return false; +} + +static void write_sysfs (char *str,unsigned long val) +{ +FILE *f; + + f =fopen (str,"w" ); +if (!f) { +ksft_print_msg ("ERR: missing %s\n" , str); +return ; + } +fprintf (f,"%lu" , val); +fclose (f); +} + +static void allocate_hugetlb () +{ +write_sysfs ("/proc/sys/vm/nr_hugepages" ,2 ); +} + +static void free_hugetlb () +{ +write_sysfs ("/proc/sys/vm/nr_hugepages" ,0 ); +} + +static int check_child_tag_inheritance (char *ptr,int size,int mode) +{ +int i, parent_tag, child_tag, fault, child_status; +pid_t child; + + parent_tag =MT_FETCH_TAG ((uintptr_t )ptr); + fault =0 ; + + child =fork (); +if (child ==-1 ) { +ksft_print_msg ("FAIL: child process creation\n" ); +return KSFT_FAIL ; + }else if (child ==0 ) { +mte_initialize_current_context (mode, (uintptr_t )ptr, size); +/* Do copy on write */ +memset (ptr,'1' , size); +mte_wait_after_trig (); +if (cur_mte_cxt.fault_valid == true) { + fault =1 ; + goto check_child_tag_inheritance_err; + } +for (i =0 ; i < size; i +=MT_GRANULE_SIZE ) { + child_tag =MT_FETCH_TAG ((uintptr_t )(mte_get_tag_address (ptr + i))); +if (parent_tag != child_tag) { +ksft_print_msg ("FAIL: child mte tag (%d) mismatch\n" , i); + fault =1 ; + goto check_child_tag_inheritance_err; + } + } +check_child_tag_inheritance_err: +_exit (fault); + } +/* Wait for child process to terminate */ +wait (&child_status); +if (WIFEXITED (child_status)) + fault =WEXITSTATUS (child_status); +else + fault =1 ; +return (fault) ?KSFT_FAIL :KSFT_PASS ; +} + +static int check_mte_memory (char *ptr,int size,int mode,int tag_check) +{ +mte_initialize_current_context (mode, (uintptr_t )ptr, size); +memset (ptr,'1' , size); +mte_wait_after_trig (); +if (cur_mte_cxt.fault_valid == true) +return KSFT_FAIL ; + +return KSFT_PASS ; +} + +static int check_hugetlb_memory_mapping (int mem_type,int mode,int mapping,int tag_check) +{ +char *ptr, *map_ptr; +int result; +unsigned long map_size; + + map_size =default_huge_page_size (); + +mte_switch_mode (mode,MTE_ALLOW_NON_ZERO_TAG ); + map_ptr = (char *)mte_allocate_memory (map_size, mem_type, mapping, false); +if (check_allocated_memory (map_ptr, map_size, mem_type, false) !=KSFT_PASS ) +return KSFT_FAIL ; + +mte_initialize_current_context (mode, (uintptr_t )map_ptr, map_size); +/* Only mte enabled memory will allow tag insertion */ + ptr =mte_insert_tags ((void *)map_ptr, map_size); +if (!ptr || cur_mte_cxt.fault_valid == true) { +ksft_print_msg ("FAIL: Insert tags on anonymous mmap memory\n" ); +munmap ((void *)map_ptr, map_size); +return KSFT_FAIL ; + } + result =check_mte_memory (ptr, map_size, mode, tag_check); +mte_clear_tags ((void *)ptr, map_size); +mte_free_memory ((void *)map_ptr, map_size, mem_type, false); +if (result ==KSFT_FAIL ) +return KSFT_FAIL ; + +return KSFT_PASS ; +} + +static int check_clear_prot_mte_flag (int mem_type,int mode,int mapping) +{ +char *map_ptr; +int prot_flag, result; +unsigned long map_size; + + prot_flag =PROT_READ |PROT_WRITE ; +mte_switch_mode (mode,MTE_ALLOW_NON_ZERO_TAG ); + map_size =default_huge_page_size (); + map_ptr = (char *)mte_allocate_memory_tag_range (map_size, mem_type, mapping, +0 ,0 ); +if (check_allocated_memory_range (map_ptr, map_size, mem_type, +0 ,0 ) !=KSFT_PASS ) +return KSFT_FAIL ; +/* Try to clear PROT_MTE property and verify it by tag checking */ +if (mprotect (map_ptr, map_size, prot_flag)) { +mte_free_memory_tag_range ((void *)map_ptr, map_size, mem_type, +0 ,0 ); +ksft_print_msg ("FAIL: mprotect not ignoring clear PROT_MTE property\n" ); +return KSFT_FAIL ; + } + result =check_mte_memory (map_ptr, map_size, mode,TAG_CHECK_ON ); +mte_free_memory_tag_range ((void *)map_ptr, map_size, mem_type,0 ,0 ); +if (result !=KSFT_PASS ) +return KSFT_FAIL ; + +return KSFT_PASS ; +} + +static int check_child_hugetlb_memory_mapping (int mem_type,int mode,int mapping) +{ +char *ptr; +int result; +unsigned long map_size; + + map_size =default_huge_page_size (); + +mte_switch_mode (mode,MTE_ALLOW_NON_ZERO_TAG ); + ptr = (char *)mte_allocate_memory_tag_range (map_size, mem_type, mapping, +0 ,0 ); +if (check_allocated_memory_range (ptr, map_size, mem_type, +0 ,0 ) !=KSFT_PASS ) +return KSFT_FAIL ; + result =check_child_tag_inheritance (ptr, map_size, mode); +mte_free_memory_tag_range ((void *)ptr, map_size, mem_type,0 ,0 ); +if (result ==KSFT_FAIL ) +return result; + +return KSFT_PASS ; +} + +int main (int argc,char *argv[]) +{ +int err; + + err =mte_default_setup (); +if (err) +return err; + +/* Register signal handlers */ +mte_register_signal (SIGBUS , mte_default_handler); +mte_register_signal (SIGSEGV , mte_default_handler); + +allocate_hugetlb (); + +if (!is_hugetlb_allocated ()) { +ksft_print_msg ("ERR: Unable allocate hugetlb pages\n" ); +return KSFT_FAIL ; + } + +/* Set test plan */ +ksft_set_plan (12 ); + +mte_enable_pstate_tco (); + +evaluate_test (check_hugetlb_memory_mapping (USE_MMAP ,MTE_SYNC_ERR ,MAP_PRIVATE |MAP_HUGETLB ,TAG_CHECK_OFF ), +"Check hugetlb memory with private mapping, sync error mode, mmap memory and tag check off\n" ); + +mte_disable_pstate_tco (); +evaluate_test (check_hugetlb_memory_mapping (USE_MMAP ,MTE_NONE_ERR ,MAP_PRIVATE |MAP_HUGETLB ,TAG_CHECK_OFF ), +"Check hugetlb memory with private mapping, no error mode, mmap memory and tag check off\n" ); + +evaluate_test (check_hugetlb_memory_mapping (USE_MMAP ,MTE_SYNC_ERR ,MAP_PRIVATE |MAP_HUGETLB ,TAG_CHECK_ON ), +"Check hugetlb memory with private mapping, sync error mode, mmap memory and tag check on\n" ); +evaluate_test (check_hugetlb_memory_mapping (USE_MPROTECT ,MTE_SYNC_ERR ,MAP_PRIVATE |MAP_HUGETLB ,TAG_CHECK_ON ), +"Check hugetlb memory with private mapping, sync error mode, mmap/mprotect memory and tag check on\n" ); +evaluate_test (check_hugetlb_memory_mapping (USE_MMAP ,MTE_ASYNC_ERR ,MAP_PRIVATE |MAP_HUGETLB ,TAG_CHECK_ON ), +"Check hugetlb memory with private mapping, async error mode, mmap memory and tag check on\n" ); +evaluate_test (check_hugetlb_memory_mapping (USE_MPROTECT ,MTE_ASYNC_ERR ,MAP_PRIVATE |MAP_HUGETLB ,TAG_CHECK_ON ), +"Check hugetlb memory with private mapping, async error mode, mmap/mprotect memory and tag check on\n" ); + +evaluate_test (check_clear_prot_mte_flag (USE_MMAP ,MTE_SYNC_ERR ,MAP_PRIVATE |MAP_HUGETLB ), +"Check clear PROT_MTE flags with private mapping, sync error mode and mmap memory\n" ); +evaluate_test (check_clear_prot_mte_flag (USE_MPROTECT ,MTE_SYNC_ERR ,MAP_PRIVATE |MAP_HUGETLB ), +"Check clear PROT_MTE flags with private mapping and sync error mode and mmap/mprotect memory\n" ); + +evaluate_test (check_child_hugetlb_memory_mapping (USE_MMAP ,MTE_SYNC_ERR ,MAP_PRIVATE |MAP_HUGETLB ), +"Check child hugetlb memory with private mapping, precise mode and mmap memory\n" ); +evaluate_test (check_child_hugetlb_memory_mapping (USE_MMAP ,MTE_ASYNC_ERR ,MAP_PRIVATE |MAP_HUGETLB ), +"Check child hugetlb memory with private mapping, precise mode and mmap memory\n" ); +evaluate_test (check_child_hugetlb_memory_mapping (USE_MPROTECT ,MTE_SYNC_ERR ,MAP_PRIVATE |MAP_HUGETLB ), +"Check child hugetlb memory with private mapping, precise mode and mmap/mprotect memory\n" ); +evaluate_test (check_child_hugetlb_memory_mapping (USE_MPROTECT ,MTE_ASYNC_ERR ,MAP_PRIVATE |MAP_HUGETLB ), +"Check child hugetlb memory with private mapping, precise mode and mmap/mprotect memory\n" ); + +mte_restore_setup (); +free_hugetlb (); +ksft_print_cnts (); +return ksft_get_fail_cnt () ==0 ?KSFT_PASS :KSFT_FAIL ; +}
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1129/1191 selftests/arm64: Print missing MTE TAP headers
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Muhammad Usama Anjum <[email protected]>
[ Upstream commit 8d2237e9d6902e234bb89aabb9cd6a9e91357223 ]
Most MTE tests set a TAP plan and emit results without first printing the TAP version header. Direct execution therefore starts with a plan such as "1..20" instead of "TAP version 13".
The problem is particularly visible in the GCR_EL1 context-switch test. It prints its plan before forking 1,024 child processes. When stdout is fully buffered, the plan remains in the stdio buffer. Each child inherits the pending "1..1" line and flushes its copy from exit(), producing repeated plan lines.
ksft_print_header() prints the TAP header and enables line buffering. Call it in every MTE test that is missing it. In the GCR_EL1 test, call it before the plan so the plan is flushed before the children are forked. In the remaining tests, call it before setup and prerequisite checks so early failures and whole-test skips also retain the header.
--- tools/testing/selftests/arm64/mte/check_buffer_fill.c | 2 ++ tools/testing/selftests/arm64/mte/check_child_memory.c | 2 ++ tools/testing/selftests/arm64/mte/check_gcr_el1_cswitch.c | 1 + tools/testing/selftests/arm64/mte/check_hugetlb_options.c | 2 ++ tools/testing/selftests/arm64/mte/check_ksm_options.c | 2 ++ tools/testing/selftests/arm64/mte/check_mmap_options.c | 2 ++ tools/testing/selftests/arm64/mte/check_tags_inclusion.c | 2 ++ tools/testing/selftests/arm64/mte/check_user_mem.c | 2 ++ 8 files changed, 15 insertions(+)
tools/testing/selftests/arm64/mte/check_buffer_fill.c +2 -0
@@ -406,6 +406,8 @@ int main(int argc, char *argv[])size_t page_size =getpagesize ();int item =sizeof (sizes)/sizeof (int ); +ksft_print_header (); + sizes[item -3 ] = page_size -1 ; sizes[item -2 ] = page_size; sizes[item -1 ] = page_size +1 ;
tools/testing/selftests/arm64/mte/check_child_memory.c +2 -0
@@ -146,6 +146,8 @@ int main(int argc, char *argv[])int err;int item =ARRAY_SIZE (sizes); +ksft_print_header (); + page_size =getpagesize ();if (!page_size) {ksft_print_msg ("ERR: Unable to get page size\n" );
tools/testing/selftests/arm64/mte/check_gcr_el1_cswitch.c +1 -0
@@ -131,6 +131,7 @@ int main(int argc, char *argv[])if (err)return err; +ksft_print_header ();ksft_set_plan (1 ); evaluate_test(mte_gcr_fork_test(),
tools/testing/selftests/arm64/mte/check_hugetlb_options.c +2 -0
@@ -228,6 +228,8 @@ int main(int argc, char *argv[]) {int err; +ksft_print_header (); + err =mte_default_setup ();if (err)return err;
tools/testing/selftests/arm64/mte/check_ksm_options.c +2 -0
@@ -132,6 +132,8 @@ int main(int argc, char *argv[]) {int err; +ksft_print_header (); + err =mte_default_setup ();if (err)return err;
tools/testing/selftests/arm64/mte/check_mmap_options.c +2 -0
@@ -189,6 +189,8 @@ int main(int argc, char *argv[])int err;int item =sizeof (sizes)/sizeof (int ); +ksft_print_header (); + err =mte_default_setup ();if (err)return err;
tools/testing/selftests/arm64/mte/check_tags_inclusion.c +2 -0
@@ -175,6 +175,8 @@ int main(int argc, char *argv[]) {int err; +ksft_print_header (); + err =mte_default_setup ();if (err)return err;
tools/testing/selftests/arm64/mte/check_user_mem.c +2 -0
@@ -201,6 +201,8 @@ int main(int argc, char *argv[])int tag_offsets[] = {page_sz,MT_GRANULE_SIZE };char test_name[TEST_NAME_MAX ]; +ksft_print_header (); + page_sz =getpagesize ();if (!page_sz) {ksft_print_msg ("ERR: Unable to get page size\n" );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1130/1191 selftests/arm64: Treat KSM merge_across_nodes as optional
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Muhammad Usama Anjum <[email protected]>
[ Upstream commit 1a0dba077f34a2f8faa98308d30d4b546d073145 ]
The MTE KSM test requires write access to KSM sysfs but does not check that it is running as root. It also unconditionally saves, enables and restores the merge_across_nodes attribute. The kernel only creates this attribute when CONFIG_NUMA=y, so a non-NUMA kernel prints the following message three times even though every KSM subtest passes:
# ERR: missing /sys/kernel/mm/ksm/merge_across_nodes
Skip the test when it is not running as root. Check that the optional attribute is readable and writable, treating ENOENT as its expected absence on non-NUMA kernels and skipping the test for other access failures. Only save, enable and restore the attribute when it is available.
Check MTE availability before the privilege and sysfs checks so systems without MTE retain the existing feature-unavailable skip result.
This preserves the existing behavior on NUMA kernels without requiring NUMA or reducing KSM coverage on single-node systems.
--- .../selftests/arm64/mte/check_ksm_options.c | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-)
tools/testing/selftests/arm64/mte/check_ksm_options.c +26 -3
@@ -6,6 +6,7 @@#include <errno.h> #include <fcntl.h> #include <signal.h> +#include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h>
@@ -22,6 +23,20 @@static size_t page_sz;static unsigned long ksm_sysfs[5 ]; +static bool has_merge_across_nodes; + +static bool merge_across_nodes_available (void ) +{ +const char *path =PATH_KSM "merge_across_nodes" ; + +if (!access (path,R_OK |W_OK )) +return true; +if (errno ==ENOENT ) +return false; + +ksft_exit_skip ("Unable to read and write %s: %s\n" , path, +strerror (errno)); +}static unsigned long read_sysfs (char *str) {
@@ -56,8 +71,10 @@ static void write_sysfs(char *str, unsigned long val)static void mte_ksm_setup (void ) { - ksm_sysfs[0 ] =read_sysfs (PATH_KSM "merge_across_nodes" ); -write_sysfs (PATH_KSM "merge_across_nodes" ,1 ); +if (has_merge_across_nodes) { + ksm_sysfs[0 ] =read_sysfs (PATH_KSM "merge_across_nodes" ); +write_sysfs (PATH_KSM "merge_across_nodes" ,1 ); + } ksm_sysfs[1 ] =read_sysfs (PATH_KSM "sleep_millisecs" );write_sysfs (PATH_KSM "sleep_millisecs" ,0 ); ksm_sysfs[2 ] =read_sysfs (PATH_KSM "run" );
@@ -70,7 +87,8 @@ static void mte_ksm_setup(void)static void mte_ksm_restore (void ) { -write_sysfs (PATH_KSM "merge_across_nodes" , ksm_sysfs[0 ]); +if (has_merge_across_nodes) +write_sysfs (PATH_KSM "merge_across_nodes" , ksm_sysfs[0 ]);write_sysfs (PATH_KSM "sleep_millisecs" , ksm_sysfs[1 ]);write_sysfs (PATH_KSM "run" , ksm_sysfs[2 ]);write_sysfs (PATH_KSM "max_page_sharing" , ksm_sysfs[3 ]);
@@ -137,6 +155,11 @@ int main(int argc, char *argv[]) err =mte_default_setup ();if (err)return err; + +if (geteuid () !=0 ) +ksft_exit_skip ("Please run the test as root\n" ); + + has_merge_across_nodes =merge_across_nodes_available (); page_sz =getpagesize ();if (!page_sz) {ksft_print_msg ("ERR: Unable to get page size\n" );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1131/1191 net: stmmac: selftests: Check multiple MMC counters
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maxime Chevallier <[email protected]>
[ Upstream commit d29b399150b07796dfa81d8778d4804c08c2a41d ]
The MMC counters report MAC statistics. Multiple counters can be enabled when the IP is integrated, however there's no way to know exactly which ones. Un-implemented counters seem to report 0.
It was found that on StarFive JH7110 and Amlogic SM1, the counter that's used by the selftest (mmc_tx_framecount_g) isn't implemented, triggering an MMC selftest failure.
Both the above SoCs seem to implement mmc_rx_framecount_gb, let's use this counter as well for MMC counter validation.
Note that this doesn't guarantee that we won't encounter the same issue again if another IP implements yet another set of counters that don't include that new one.
If the game of whack-a-mole with implemented counters becomes too hard to maintain, we may simply consider removing the MMC selftest entirely.
--- .../net/ethernet/stmicro/stmmac/stmmac_selftests.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c +10 -4
@@ -415,11 +415,17 @@ static int stmmac_test_mmc(struct stmmac_priv *priv)stmmac_mmc_read (priv, priv->mmcaddr, &final);/* -* The number of MMC counters available depends on HW configuration -* so we just use this one to validate the feature. I hope there is -* not a version without this counter. +* The number of MMC counters available depends on HW configuration, +* and there doesn't seem to be a way to enumerate the implemented +* counters. +* +* Let's check a hand-picked set of counters, knowing that : +* - Starfive JH7110 doesn't implement mmc_tx_framecount_g +* - Amlogic SM1 doesn't implement any mmc_tx_* +* */ -if (final.mmc_tx_framecount_g <= initial.mmc_tx_framecount_g) +if (final.mmc_tx_framecount_g <= initial.mmc_tx_framecount_g && + final.mmc_rx_framecount_gb <= initial.mmc_rx_framecount_gb)return -EINVAL ;return 0 ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1132/1191 net: stmmac: dwmac1000: Account for the primary MAC address for UC filtering
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maxime Chevallier <[email protected]>
[ Upstream commit 9698b6da3714fd2ef47846cb63098d2b2d252e25 ]
The same filter slots are used to store the main MAC address as well as the address for the unicast filter. Let's account for that when deciding whether or not to use promisc when programming the UC list in hardware.
--- drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c +1 -1
@@ -185,7 +185,7 @@ static void dwmac1000_set_filter(struct mac_device_info *hw,dwmac1000_set_mchash (ioaddr, mc_filter, mcbitslog2);/* Handle multiple unicast addresses (perfect filtering) */ -if (netdev_uc_count (dev) > perfect_addr_number) +if (netdev_uc_count (dev) +1 > perfect_addr_number)/* Switch to promiscuous mode if more than unicast * addresses are requested than supported by hardware. */
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1133/1191 net: stmmac: dwmac4: Account for the primary MAC address for UC filtering
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maxime Chevallier <[email protected]>
[ Upstream commit 82187f42c014d22520b9c3c4e2cfb519223fb29b ]
The same filter slots are used to store the main MAC address as well as the address for the unicast filter. Let's account for that when deciding whether or not to use promisc when programming the UC list in hardware.
--- drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +1 -1
@@ -685,7 +685,7 @@ static void dwmac4_set_filter(struct mac_device_info *hw, value |=GMAC_PACKET_FILTER_HPF ;/* Handle multiple unicast addresses */ -if (netdev_uc_count (dev) > hw->unicast_filter_entries) { +if (netdev_uc_count (dev) +1 > hw->unicast_filter_entries) {/* Switch to promiscuous mode if more than 128 addrs * are required */
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1134/1191 net: stmmac: dwxgmac: Account for the primary MAC address for UC filtering
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maxime Chevallier <[email protected]>
[ Upstream commit 2739d6f9a2b8729b0d85cbe0dc93e1d68670b6f2 ]
The same filter slots are used to store the main MAC address as well as the address for the unicast filter. Let's account for that when deciding whether or not to use promisc when programming the UC list in hardware.
--- drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c +1 -1
@@ -502,7 +502,7 @@ static void dwxgmac2_set_filter(struct mac_device_info *hw,dwxgmac2_set_mchash (ioaddr, mc_filter, mcbitslog2);/* Handle multiple unicast addresses */ -if (netdev_uc_count (dev) > hw->unicast_filter_entries) { +if (netdev_uc_count (dev) +1 > hw->unicast_filter_entries) { value |=XGMAC_FILTER_PR ; }else {struct netdev_hw_addr *ha;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1135/1191 net: stmmac: selftests: Account for the UC filter list for filtering tests
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maxime Chevallier <[email protected]>
[ Upstream commit cd8c3b2752c684141eab2282e294cae2971a9759 ]
On dwmac, one of the Unicast filter entries is used to store the local HW addr. This means that we have to use promisc mode for any kind of unicast filtering if we only have one slot in our unicast filter.
The number of slots available depends on how the IP is integrated, and we can't autodiscover how many of these slots we have available, so the DT property snps,perfect-filter-entries can be used to specify how many are available.
Most IP variants default to 1 if this isn't specified, which is the case for the amlogic variants (in this case, S905X3).
The stmmac selftests for UC filtering look if we have enough slots in the filter to store the dev->uc list, but doesn't account for the device's own MAC address. The dev->uc list's size we get with netdev_uc_count() also doesn't account for the HW addr.
As the selftest only requires one available slot, in the case of single-slot platforms, that means we erroneously consider we have enough room for the test, when we actually don't, and the filtering test fails.
--- .../stmicro/stmmac/stmmac_selftests.c | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c +18 -3
@@ -499,6 +499,21 @@ static int stmmac_filter_check(struct stmmac_priv *priv)return -EOPNOTSUPP ; } +static int stmmac_uc_filter_check (struct stmmac_priv *priv) +{ +/* For tests involving the UC filter, we need at least one empty +* slot in the UC filter. The UC filters contains netdev_uc_count() + 1 +* entries: The dev->uc list + one entry for the HW address. +* +* Having an empty slot therefore means netdev_uc_count() + 2 entries +* can fit in the filter +*/ +if (netdev_uc_count (priv->dev) +2 > priv->hw->unicast_filter_entries) +return -EOPNOTSUPP ; + +return 0 ; +} +static bool stmmac_hash_check (struct stmmac_priv *priv,unsigned char *addr) {int mc_offset =32 - priv->hw->mcast_bits_log2;
@@ -590,7 +605,7 @@ static int stmmac_test_pfilt(struct stmmac_priv *priv)if (stmmac_filter_check (priv))return -EOPNOTSUPP ; -if (netdev_uc_count (priv->dev) >= priv->hw->unicast_filter_entries) +if (stmmac_uc_filter_check (priv))return -EOPNOTSUPP ;while (--tries) {
@@ -634,7 +649,7 @@ static int stmmac_test_mcfilt(struct stmmac_priv *priv)if (stmmac_filter_check (priv))return -EOPNOTSUPP ; -if (netdev_uc_count (priv->dev) >= priv->hw->unicast_filter_entries) +if (stmmac_uc_filter_check (priv))return -EOPNOTSUPP ;if (netdev_mc_count (priv->dev) >= priv->hw->multicast_filter_bins)return -EOPNOTSUPP ;
@@ -680,7 +695,7 @@ static int stmmac_test_ucfilt(struct stmmac_priv *priv)if (stmmac_filter_check (priv))return -EOPNOTSUPP ; -if (netdev_uc_count (priv->dev) >= priv->hw->unicast_filter_entries) +if (stmmac_uc_filter_check (priv))return -EOPNOTSUPP ;if (netdev_mc_count (priv->dev) >= priv->hw->multicast_filter_bins)return -EOPNOTSUPP ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1136/1191 net/sched: bound qdisc_pkt_len to prevent qdisc soft lockup
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jamal Hadi Salim <[email protected]>
[ Upstream commit 8f735d64382dcf162f4276d6699d03ad2f859c0b ]
qdisc_get_stab() accepts a user-supplied size table, and __qdisc_calculate_pkt_len() amplifies qdisc_pkt_len() through the overhead, the size-table data (u16), and size_log (up to STAB_SIZE_LOG_MAX). A crafted stab can therefore set qdisc_pkt_len() to ~1 GiB for an ordinary skb. Per-flow deficit schedulers such as DRR and ETS replenish one quantum per loop iteration; with a tiny quantum (1) they spin billions of times under the qdisc lock, producing a soft lockup / RCU stall as illustrated by [email protected].
Cap the final qdisc_pkt_len() to QDISC_PKT_LEN_MAX so the size-table amplification cannot drive deficit schedulers into an unbounded loop. A legitimate size table (e.g. qfq's overhead 999999999, which is handled by dropping) is still accepted.
Introduce cap QDISC_PKT_LEN_MAX (1 << 20) = 1 MiB which is well above any legitimate single-skb wire length: the largest current skb->len is GSO_MAX_SIZE (524280), and an ATM-style size table (53/48 cell tax) amplifies that to ~578 KB, both comfortably below 1 MiB. At the same time, 1 MiB bounds the deficit refill loop to ~1M iterations per packet with quantum=1, which completes in a few milliseconds well under the demonstrated softlockup threshold (~10^9 iterations).
Conditions to recreate the bug:
- CONFIG_NET_SCHED=y, CONFIG_NET_SCH_DRR=y (or CONFIG_NET_SCH_ETS=y).
- Attach a DRR (or ETS) root qdisc with a crafted TCA_STAB that amplifies qdisc_pkt_len to ~1 GiB (e.g. size_log=15, data=[32768]).
- Add a class with a tiny quantum of 1 and send one small packet; the deficit loop spins billions of times under the qdisc lock and trips the softlockup detector (panic with kernel.softlockup_panic=1).
- Reachable as root or from an unprivileged user in a fresh user+net namespace (unshare -Urn) with namespace-local CAP_NET_ADMIN.
--- include/net/pkt_sched.h | 1 + net/sched/sch_api.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-)
include/net/pkt_sched.h +1 -0
@@ -12,6 +12,7 @@#define DEFAULT_TX_QUEUE_LEN 1000#define STAB_SIZE_LOG_MAX 30 +#define QDISC_PKT_LEN_MAX (1 << 20)/* 1 MiB */ struct qdisc_walker {int stop;
net/sched/sch_api.c +5 -2
@@ -607,8 +607,11 @@ void __qdisc_calculate_pkt_len(struct sk_buff *skb, pkt_len <<= stab->szopts.size_log; out: -if (unlikely (pkt_len <1 )) - pkt_len =1 ; +/* A size table can inflate qdisc_pkt_len() beyond any real packet +* (via overhead, the data table, or size_log); cap it so deficit +* schedulers such as DRR/ETS terminate their refill loops. +*/ + pkt_len =clamp_t (int, pkt_len,1 ,QDISC_PKT_LEN_MAX );qdisc_skb_cb (skb)->pkt_len = pkt_len; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1137/1191 slip: remove slip_hangup() to fix use-after-free in slip_receive_buf()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 23c53269f2baaedf2d92784290cb9ef6db2a3bce ]
Jaeyoung Chung and Eulgyu Kim reported a slab-use-after-free read in slip_receive_buf() when racing against tty hangup.
tty_ldisc_hangup() calls ld->ops->hangup() while holding only a read lock on tty->ldisc_sem (via tty_ldisc_ref()). Because slip_hangup() simply called slip_close(), it ran concurrently with reader functions such as slip_receive_buf().
slip_close() unregisters and frees the net device and its private struct slip, causing concurrent reader threads in slip_receive_buf() to dereference freed memory.
Line discipline close() is already guaranteed to be called under the write lock of tty->ldisc_sem during hangup processing (in tty_ldisc_reinit() or tty_ldisc_kill()).
Remove slip_hangup() so teardown is serialized cleanly by slip_close().
--- drivers/net/slip/slip.c | 8 -------- 1 file changed, 8 deletions(-)
drivers/net/slip/slip.c +0 -8
@@ -886,8 +886,6 @@ static int slip_open(struct tty_struct *tty)* Close down a SLIP channel. * This means flushing out any pending queues, and then returning. This * call is serialized against other ldisc functions. -* -* We also use this method fo a hangup event */ static void slip_close (struct tty_struct *tty)
@@ -915,11 +913,6 @@ static void slip_close(struct tty_struct *tty)unregister_netdev (sl->dev);/* sl_uninit() has dropped the slip_devs[] entry by now */ } - -static void slip_hangup (struct tty_struct *tty) -{ -slip_close (tty); -}/************************************************************************ * STANDARD SLIP ENCAPSULATION * ************************************************************************/
@@ -1280,7 +1273,6 @@ static struct tty_ldisc_ops sl_ldisc = { .name = "slip", .open = slip_open, .close = slip_close, - .hangup = slip_hangup, .ioctl = slip_ioctl, .receive_buf = slip_receive_buf, .write_wakeup = slip_write_wakeup,
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1138/1191 net: fec: only stop PTP if it was initialized
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <[email protected]>
[ Upstream commit dd890ae29299636fb037276fc1b5238698d08b03 ]
fec_ptp_init() is only called when fep->bufdesc_ex is available. However, fec_probe() unconditionally calls fec_ptp_stop() on the failed_init path, and fec_drv_remove() unconditionally calls fec_ptp_stop() during device removal.
Check fep->bufdesc_ex before calling fec_ptp_stop() in both paths to avoid stopping PTP when it was not initialized.
--- drivers/net/ethernet/freescale/fec_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/freescale/fec_main.c +4 -2
@@ -4184,7 +4184,8 @@ fec_probe(struct platform_device *pdev) failed_irq:fec_enet_deinit (ndev); failed_init: -fec_ptp_stop (pdev); +if (fep->bufdesc_ex) +fec_ptp_stop (pdev); failed_reset:pm_runtime_put_noidle (&pdev->dev);pm_runtime_disable (&pdev->dev);
@@ -4226,7 +4227,8 @@ fec_drv_remove(struct platform_device *pdev) ERR_PTR(ret));cancel_work_sync (&fep->tx_timeout_work); -fec_ptp_stop (pdev); +if (fep->bufdesc_ex) +fec_ptp_stop (pdev);unregister_netdev (ndev);fec_enet_mii_remove (fep);if (fep->reg_phy)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1139/1191 usb: atm: usbatm: fix invalid ci_range initialization
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Deepanshu Kartikey <[email protected]>
[ Upstream commit a60fd8c6dbaa76da4163cf225ed2b9e982540f39 ]
syzbot reported a shift-out-of-bounds in __vcc_connect():
UBSAN: shift-out-of-bounds in net/atm/common.c:382:32 shift exponent -1 is negative CPU: 0 UID: 0 PID: 5987 Comm: syz.0.18 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Compute Engine/Google Compute Engine, BIOS Google 08/05/2026 Call Trace: <TASK> dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 ubsan_epilogue+0xa/0x30 lib/ubsan.c:233 __ubsan_handle_shift_out_of_bounds+0x36d/0x400 lib/ubsan.c:494 __vcc_connect+0x14b4/0x19c0 net/atm/common.c:382 vcc_connect+0x328/0x8f0 net/atm/common.c:498 pvc_bind+0x272/0x380 net/atm/pvc.c:52 __sys_bind+0x2e3/0x410 net/socket.c:1976 __x64_sys_bind+0x7a/0x90 net/socket.c:1979 ...
ATM device ci_range fields (vpi_bits and vci_bits) represent the number of bits supported for VPI and VCI addressing on the device. net/atm/common.c directly uses these fields as bit shift counts:
vpi >> dev->ci_range.vpi_bits
vci >> dev->ci_range.vci_bits
1 << vcc->dev->ci_range.vpi_bits
1 << vcc->dev->ci_range.vci_bits
usbatm_atm_init() sets ci_range.vpi_bits and ci_range.vci_bits to ATM_CI_MAX (-1), which is defined in <uapi/linux/atmdev.h> as a sentinel value for userspace ATM_SETCIRANGE requests, not a valid bit count. Shifting by -1 is undefined behavior and triggers UBSAN warnings.
ATM UNI cell headers allow up to 8 bits for VPI (0..255) and 16 bits for VCI (0..65535). Initialize vpi_bits to 8 and vci_bits to 16, as done by solos-pci.
--- drivers/usb/atm/usbatm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/atm/usbatm.c +2 -2
@@ -917,8 +917,8 @@ static int usbatm_atm_init(struct usbatm_data *instance) instance->atm_dev = atm_dev; - atm_dev->ci_range.vpi_bits =ATM_CI_MAX ; - atm_dev->ci_range.vci_bits =ATM_CI_MAX ; + atm_dev->ci_range.vpi_bits =8 ; + atm_dev->ci_range.vci_bits =16 ; atm_dev->signal =ATM_PHY_SIG_UNKNOWN ;/* temp init ATM device, set to 128kbit */
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1140/1191 tcp: fix corruption of urgent data on multi-segment retransmit
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiayuan Chen <[email protected]>
[ Upstream commit ce2b807f42ed5e55567b8864ab72963f90779270 ]
On the normal xmit path, while in urgent mode we refuse to build a multi-segment TSO packet, so every segment gets its own urg_ptr:
/* tcp_write_xmit() */ limit = mss_now; if (tso_segs > 1 && !tcp_urg_mode(tp)) limit = tcp_mss_split_point(...);
The retransmit path has no such guard. __tcp_retransmit_skb() builds a segs > 1 skb and hands it to the GSO layer, which only advances th->seq per segment and copies urg_ptr verbatim:
/* __tcp_retransmit_skb() */ len = cur_mss * segs; /* segs > 1, no urg_mode check */ ... /* tcp_gso_segment(): bumps seq only, urg_ptr is copied */
urg_ptr is an offset from the segment's own seq, so a copied value points at a different place on each segment. The receiver rebuilds the absolute urgent seq as seg.seq + urg_ptr, so it walks a moving urgent point instead of the one OOB byte:
seg1 seq 1 urg_ptr 5001 -> urgent @ 5001 (ok) seg2 seq 1001 urg_ptr 5001 -> urgent @ 6001 (wrong, +MSS) seg3 seq 2001 urg_ptr 5001 -> urgent @ 7001 (wrong, +2*MSS)
The real OOB byte is never pointed at, so the receiver stops splicing it out and delivers it as normal in-band data, corrupting the stream.
Guard the retransmit length like the xmit path: keep segs = 1 while in urgent mode.
--- net/ipv4/tcp_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/tcp_output.c +1 -1
@@ -3255,7 +3255,7 @@ int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb, int segs) avail_wnd = cur_mss; } - len = cur_mss * segs; + len = cur_mss * (tcp_urg_mode (tp) ?1 : segs);if (len > avail_wnd) { len =rounddown (avail_wnd, cur_mss);if (!len)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1141/1191 net/sched: sch_htb: limit htb_classify inner-class filter hops
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jamal Hadi Salim <[email protected]>
[ Upstream commit 729c4896ab829169f95915d65edd530325910b37 ]
htb_classify() follows each filter-selected inner class by switching to cl->filter_list, but never bounds the number of hops. A filter on an inner class can point back to itself or to another inner class that points back, creating an infinite loop in the packet classification path with the qdisc lock held and BH disabled — a soft lockup / panic from a single packet.
Bound the traversal with a hop counter and drop the packet with a rate-limited warning once the bound is exceeded. The counter is incremented at the point the inner filter chain is picked up, after the TC_ACT_* switch has consumed the classifier verdict, so a terminal TC_ACT_QUEUED/STOLEN/TRAP on the last permitted chain still sets *qerr to __NET_XMIT_STOLEN and the packet is not charged as a drop by this qdisc or its parent.
The bound is TC_HTB_MAXDEPTH, taken from HTB's own parameters rather than from the qdisc hierarchy depth limit. Class levels run from 0 to TC_HTB_MAXDEPTH - 1, so a traversal that strictly descends in level can take at most TC_HTB_MAXDEPTH hops. That descent is what a sane configuration does, but it is assumed here rather than enforced:htb_find() resolves a classid against every class in the qdisc, so a filter may equally select a sibling or an ancestor. The normal root -> inner -> leaf path takes a single hop, so the bound does not affect legitimate classification.
htb_classify() can now return NULL irrespective of CONFIG_NET_CLS_ACT, whereas previously every NULL return sat inside that ifdef. The NULL handler in htb_enqueue() therefore cannot stay conditional either, so drop the ifdef around it. This matches hfsc_enqueue(), which has always handled a NULL class unconditionally. Without it, a kernel built without actions would dereference a NULL class instead of dropping.
Conditions to recreate the bug:
- CONFIG_NET_SCHED, CONFIG_NET_SCH_HTB, CONFIG_NET_CLS_U32, CONFIG_LOCKUP_DETECTOR.
- Create an HTB qdisc on a device (e.g. lo), add an inner class 1:1 with a leaf child 1:10, install a root u32 filter selecting 1:1, and an inner-class u32 filter on 1:1 also selecting 1:1.
- Send one packet (ping). On the unfixed kernel the classify loop spins with the qdisc lock held; with softlockup_panic=1 it panics.
- Reachable from unprivileged user via unshare -Urn (CAP_NET_ADMIN).
--- net/sched/sch_htb.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
net/sched/sch_htb.c +5 -2
@@ -220,6 +220,7 @@ static struct htb_class *htb_classify(struct sk_buff *skb, struct Qdisc *sch,struct htb_class *cl;struct tcf_result res;struct tcf_proto *tcf; +unsigned int hops =0 ;int result;/* allow to select class by setting skb->priority to valid classid;
@@ -262,6 +263,10 @@ static struct htb_class *htb_classify(struct sk_buff *skb, struct Qdisc *sch,if (!cl->level)return cl;/* we hit leaf; return it */ +if (++hops >TC_HTB_MAXDEPTH ) { +pr_warn_ratelimited ("htb: classify loop detected, dropping packet\n" ); +return NULL ; + }/* we have got inner class; apply inner filter chain */ tcf =rcu_dereference_bh (cl->filter_list); }
@@ -629,13 +634,11 @@ static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch, }else {return qdisc_drop (skb, sch, to_free); } -#ifdef CONFIG_NET_CLS_ACT }else if (!cl) {if (ret & __NET_XMIT_BYPASS)qdisc_qstats_drop (sch);__qdisc_drop (skb, to_free);return ret; -#endif }else if ((ret =qdisc_enqueue (skb, cl->leaf.q, to_free)) !=NET_XMIT_SUCCESS ) {if (net_xmit_drop_count (ret)) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1142/1191 perf/x86/amd/uncore: Fix the return value of amd_uncore_df_event_init() on error
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sandipan Das <[email protected]>
[ Upstream commit 01439286514ce9d13b8123f8ec3717d7135ff1d6 ]
If amd_uncore_event_init() fails, return an error irrespective of the pmu_version. Setting hwc->config should be safe even if there is an error so use this opportunity to simplify the code.
--- arch/x86/events/amd/uncore.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
arch/x86/events/amd/uncore.c +1 -4
@@ -546,14 +546,11 @@ static int amd_uncore_df_event_init(struct perf_event *event)struct hw_perf_event *hwc = &event->hw;int ret =amd_uncore_event_init (event); -if (ret || pmu_version <2 ) -return ret; - hwc->config = event->attr.config & (pmu_version >=2 ?AMD64_PERFMON_V2_RAW_EVENT_MASK_NB :AMD64_RAW_EVENT_MASK_NB ); -return 0 ; +return ret; }static int amd_uncore_df_add (struct perf_event *event,int flags)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1143/1191 nvme: target: rdma: fix ndev refcount leak on queue connect
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wentao Liang <[email protected]>
[ Upstream commit badc53620fe813b3a9f727ef9526f98567c2c898 ]
nvmet_rdma_queue_connect() calls nvmet_rdma_find_get_device() which acquires a reference on the returned ndev via kref_get(). On the path where the host queue backlog is exceeded and the function returns NVME_SC_CONNECT_CTRL_BUSY, reference of ndev is not released, leaking the kref.
Fix this by adding a goto to the existing put_device label before the early return.
--- drivers/nvme/target/rdma.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/nvme/target/rdma.c +4 -2
@@ -1626,8 +1626,10 @@ static int nvmet_rdma_queue_connect(struct rdma_cm_id *cm_id, pending++; }mutex_unlock (&nvmet_rdma_queue_mutex); -if (pending >NVMET_RDMA_BACKLOG ) -return NVME_SC_CONNECT_CTRL_BUSY ; +if (pending >NVMET_RDMA_BACKLOG ) { + ret =NVME_SC_CONNECT_CTRL_BUSY ; + goto put_device; + } } ret =nvmet_rdma_cm_accept (cm_id, queue, &event->param.conn);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1144/1191 Bluetooth: coredump: fix building with coredump disabled
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
[ Upstream commit 6910e2eb39254d279bce5bc0f8eb6af45b59357c ]
The btmtk driver uses an IS_ENABLED() check to conditionally compile the coredump support, but this fails to build because the hdev->dump member is in an #ifdef:
drivers/bluetooth/btmtk.c: In function 'btmtk_process_coredump':drivers/bluetooth/btmtk.c:386:30: error: 'struct hci_dev' has no member named 'dump'
386 | schedule_delayed_work(&hdev->dump.dump_timeout,
| ^~
The struct member doesn't really make a huge difference in the total size, so just remove the #ifdef around it to avoid adding similar checks around each user.
--- include/net/bluetooth/hci_core.h | 2 -- 1 file changed, 2 deletions(-)
include/net/bluetooth/hci_core.h +0 -2
@@ -570,9 +570,7 @@ struct hci_dev {const char *fw_info;struct dentry *debugfs; -#ifdef CONFIG_DEV_COREDUMP struct hci_devcoredump dump; -#endif struct device dev;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1145/1191 s390/con3270: move condev definition
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heiko Carstens <[email protected]>
[ Upstream commit 9cab4f7d98eee90b762ffbc87055c9499d51a635 ]
Fix this for allmodconfig:
drivers/s390/char/con3270.c:43:24: error: 'condev' defined but not used [-Werror=unused-variable]
static struct tty3270 *condev;
^~~~~~--- drivers/s390/char/tty3270.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/s390/char/tty3270.c +3 -1
@@ -38,7 +38,6 @@static struct tty_driver *tty3270_driver;static int tty3270_max_index; -static struct tty3270 *condev;static struct raw3270_fn tty3270_fn;struct tty3270_cell {
@@ -1910,6 +1909,9 @@ static void __exit tty3270_exit(void) }#if IS_ENABLED (CONFIG_TN3270_CONSOLE ) + +static struct tty3270 *condev; +static void con3270_write (struct console *co,const char *str,unsigned int count) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1146/1191 pinctrl: mediatek: eint: Drop base from mtk_eint_chip_write_mask()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen-Yu Tsai <[email protected]>
[ Upstream commit 3ca99eed042620d12315e9272ed3ef260ca29877 ]
When support for multiple EINT base addresses was added in commit 3ef9f710efcb ("pinctrl: mediatek: Add EINT support for multiple addresses"), mtk_eint_chip_write_mask() was changed to write interrupt masks for all base addresses in one call. However the "base" parameter was left around and now causes sparse warnings:
mtk-eint.c:428:44: warning: incorrect type in argument 2 (different address spaces)
mtk-eint.c:428:44: expected void [noderef] __iomem *base
mtk-eint.c:428:44: got void [noderef] __iomem **base
mtk-eint.c:436:44: warning: incorrect type in argument 2 (different address spaces)
mtk-eint.c:436:44: expected void [noderef] __iomem *base
mtk-eint.c:436:44: got void [noderef] __iomem **baseSince the "base" parameter is no longer needed, just drop it.
--- drivers/pinctrl/mediatek/mtk-eint.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/pinctrl/mediatek/mtk-eint.c +3 -3
@@ -243,7 +243,7 @@ static int mtk_eint_irq_set_wake(struct irq_data *d, unsigned int on) }static void mtk_eint_chip_write_mask (const struct mtk_eint *eint, -void __iomem *base,unsigned int **buf) +unsigned int **buf) {int inst, port, port_num;void __iomem *reg;
@@ -422,7 +422,7 @@ static void mtk_eint_irq_handler(struct irq_desc *desc)int mtk_eint_do_suspend (struct mtk_eint *eint) { -mtk_eint_chip_write_mask (eint, eint->base, eint->wake_mask); +mtk_eint_chip_write_mask (eint, eint->wake_mask);return 0 ; }
@@ -430,7 +430,7 @@ EXPORT_SYMBOL_GPL(mtk_eint_do_suspend);int mtk_eint_do_resume (struct mtk_eint *eint) { -mtk_eint_chip_write_mask (eint, eint->base, eint->cur_mask); +mtk_eint_chip_write_mask (eint, eint->cur_mask);return 0 ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1147/1191 pinctrl: mediatek: Fix new design debounce issue
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hao Chang <[email protected]>
[ Upstream commit 34024cf69c51b11c2b608f5d578626b9b1c484f5 ]
Calculate the true offset of eint according to index.
--- drivers/pinctrl/mediatek/mtk-eint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/mediatek/mtk-eint.c +1 -1
@@ -450,7 +450,7 @@ int mtk_eint_set_debounce(struct mtk_eint *eint, unsigned long eint_num,return -EOPNOTSUPP ; virq =irq_find_mapping (eint->domain, eint_num); - eint_offset = (eint_num %4 ) *8 ; + eint_offset = (idx %4 ) *8 ; d =irq_get_irq_data (virq); set_offset = (idx /4 ) *4 + eint->regs->dbnc_set;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1148/1191 pinctrl: mediatek: common-v1: Fix EINT breakage on older controllers
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen-Yu Tsai <[email protected]>
[ Upstream commit fe412e3a6c97cfe49ecf4564a278122f7d78e3f0 ]
When EINT support for multiple addresses was introduced, the driver library for the older generations (pinctrl-mtk-common) was not fixed together. This resulted in invalid pointer accesses.
Fix up the filled in |struct mtk_eint| in pinctrl-mtk-common to match what is now expected by the mtk-eint library.
--- drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/pinctrl/mediatek/pinctrl-mtk-common.c +7 -1
@@ -1012,7 +1012,13 @@ static int mtk_eint_init(struct mtk_pinctrl *pctl, struct platform_device *pdev)if (!pctl->eint)return -ENOMEM ; - pctl->eint->base =devm_platform_ioremap_resource (pdev,0 ); + pctl->eint->nbase =1 ; +/* mtk-eint expects an array */ + pctl->eint->base =devm_kzalloc (pctl->dev,sizeof (pctl->eint->base),GFP_KERNEL ); +if (IS_ERR (pctl->eint->base)) +return -ENOMEM ; + + pctl->eint->base[0 ] =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (pctl->eint->base))return PTR_ERR (pctl->eint->base);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1149/1191 arm64: dts: qcom: pm8998: dont use GIC_SPI for SPMI interrupts
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit d9ef7a805a709a0b07341857d97a25598a7f92da ]
Unlike typical GIC interrupts, first cell for SPMI interrupts is the USID rather than GIC_SPI/GIC_PPI/GIC_LPI qualifier. Fix the resin interrupt to use USID value 0x0 rather than GIC_SPI define.
--- arch/arm64/boot/dts/qcom/pm8998.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/pm8998.dtsi +1 -1
@@ -55,7 +55,7 @@ pm8998_pwrkey: pwrkey { pm8998_resin: resin { compatible = "qcom,pm8941-resin"; - interrupts = <GIC_SPI 0x8 1 IRQ_TYPE_EDGE_BOTH>; + interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>; debounce = <15625>; bias-pull-up; status = "disabled";
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1150/1191 arm64: dts: qcom: Re-enable resin on MSM8998 and SDM845 boards
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dzmitry Sankouski <[email protected]>
[ Upstream commit 4c881ab73a64cdbf8691e258ef17b740d27040a0 ]
resin node declaration was moved to pm8998.dtsi file (in disabled state). MSM8998 and SDM845 boards defining resin node did not previously have status="okay" and ended up disabled.
Re-enable it by using resin node link from pm8998.dtsi with status="okay".
--- arch/arm64/boot/dts/qcom/msm8998-fxtec-pro1.dts | 11 +++-------- .../boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi | 11 +++-------- arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 11 +++-------- arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi | 11 +++-------- arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts | 11 +++-------- arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium.dts | 11 +++-------- arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts | 11 +++-------- 7 files changed, 21 insertions(+), 56 deletions(-)
arch/arm64/boot/dts/qcom/msm8998-fxtec-pro1.dts +3 -8
@@ -368,14 +368,9 @@ cam_snapshot_pin_a: cam-snapshot-btn-active-state { }; }; -&pm8998_pon { - resin { - compatible = "qcom,pm8941-resin"; - interrupts = <GIC_SPI 0x8 1 IRQ_TYPE_EDGE_BOTH>; - bias-pull-up; - debounce = <15625>; - linux,code = <KEY_VOLUMEDOWN>; - }; +&pm8998_resin { + linux,code = <KEY_VOLUMEDOWN>; + status = "okay"; }; &qusb2phy {
arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi +3 -8
@@ -353,14 +353,9 @@ vib_default: vib-en-state { }; }; -&pm8998_pon { - resin { - compatible = "qcom,pm8941-resin"; - interrupts = <GIC_SPI 0x8 1 IRQ_TYPE_EDGE_BOTH>; - debounce = <15625>; - bias-pull-up; - linux,code = <KEY_VOLUMEUP>; - }; +&pm8998_resin { + linux,code = <KEY_VOLUMEUP>; + status = "okay"; }; &qusb2phy {
arch/arm64/boot/dts/qcom/sdm845-db845c.dts +3 -8
@@ -624,14 +624,9 @@ vol_up_pin_a: vol-up-active-state { }; }; -&pm8998_pon { - resin { - compatible = "qcom,pm8941-resin"; - interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>; - debounce = <15625>; - bias-pull-up; - linux,code = <KEY_VOLUMEDOWN>; - }; +&pm8998_resin { + linux,code = <KEY_VOLUMEDOWN>; + status = "okay"; }; &pmi8998_lpg {
arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi +3 -8
@@ -482,14 +482,9 @@ &mss_pil { status = "okay"; }; -&pm8998_pon { - resin { - compatible = "qcom,pm8941-resin"; - interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>; - debounce = <15625>; - bias-pull-up; - linux,code = <KEY_VOLUMEDOWN>; - }; +&pm8998_resin { + linux,code = <KEY_VOLUMEDOWN>; + status = "okay"; }; &sdhc_2 {
arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts +3 -8
@@ -521,14 +521,9 @@ pinconf { }; }; -&pm8998_pon { - volume_down_resin: resin { - compatible = "qcom,pm8941-resin"; - interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>; - debounce = <15625>; - bias-pull-up; - linux,code = <KEY_VOLUMEDOWN>; - }; +&pm8998_resin { + linux,code = <KEY_VOLUMEDOWN>; + status = "okay"; }; &pmi8998_lpg {
arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium.dts +3 -8
@@ -327,14 +327,9 @@ &pmi8998_wled { qcom,cabc; }; -&pm8998_pon { - resin { - compatible = "qcom,pm8941-resin"; - interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>; - debounce = <15625>; - bias-pull-up; - linux,code = <KEY_VOLUMEDOWN>; - }; +&pm8998_resin { + linux,code = <KEY_VOLUMEDOWN>; + status = "okay"; }; /* QUAT I2S Uses 1 I2S SD Line for audio on TAS2559/60 amplifiers */
arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts +3 -8
@@ -534,14 +534,9 @@ pinconf { }; }; -&pm8998_pon { - resin { - interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>; - compatible = "qcom,pm8941-resin"; - linux,code = <KEY_VOLUMEDOWN>; - debounce = <15625>; - bias-pull-up; - }; +&pm8998_resin { + linux,code = <KEY_VOLUMEDOWN>; + status = "okay"; }; &q6afedai {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1151/1191 clk: qcom: rcg2: add clk_rcg2_shared_floor_ops
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit aec8c0e28ce4a1f89fd82fcc06a5cc73147e9817 ]
Generally SDCC clocks use clk_rcg2_floor_ops, however on SAR2130P platform it's recommended to use rcg2_shared_ops for all Root Clock Generators to park them instead of disabling. Implement a mix of those, clk_rcg2_shared_floor_ops.
Stable-dep-of: 1c06e3956054 ("clk: qcom: gcc-sm8550: Use floor ops for SDCC RCGs")
--- drivers/clk/qcom/clk-rcg.h | 1 + drivers/clk/qcom/clk-rcg2.c | 48 +++++++++++++++++++++++++++++++++---- 2 files changed, 44 insertions(+), 5 deletions(-)
drivers/clk/qcom/clk-rcg.h +1 -0
@@ -174,6 +174,7 @@ extern const struct clk_ops clk_byte2_ops;extern const struct clk_ops clk_pixel_ops;extern const struct clk_ops clk_gfx3d_ops;extern const struct clk_ops clk_rcg2_shared_ops; +extern const struct clk_ops clk_rcg2_shared_floor_ops;extern const struct clk_ops clk_rcg2_shared_no_init_park_ops;extern const struct clk_ops clk_dp_ops;
drivers/clk/qcom/clk-rcg2.c +43 -5
74 lines not on this page · raw message
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1152/1191 clk: qcom: gcc-sm8550: Use floor ops for SDCC RCGs
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vladimir Zapolskiy <[email protected]>
[ Upstream commit 1c06e3956054fb5a0930f07b02726b1774b6c700 ]
In line with commit a27ac3806b0a ("clk: qcom: gcc-sm8450: Use floor ops for SDCC RCGs") done to fix issues with overclocked SD cards on SM8450 powered boards set floor clock operations for SDCC RCGs on SM8550.
This change fixes initialization of some SD cards, where the problem is manifested by the SDHC driver:
mmc0: Card appears overclocked; req 50000000 Hz, actual 100000000 Hz
mmc0: error -110 whilst initialising SD card
--- drivers/clk/qcom/gcc-sm8550.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/qcom/gcc-sm8550.c +2 -2
@@ -1024,7 +1024,7 @@ static struct clk_rcg2 gcc_sdcc2_apps_clk_src = { .parent_data = gcc_parent_data_9, .num_parents = ARRAY_SIZE(gcc_parent_data_9), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_shared_floor_ops, }, };
@@ -1047,7 +1047,7 @@ static struct clk_rcg2 gcc_sdcc4_apps_clk_src = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_shared_floor_ops, }, };
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1153/1191 clk: qcom: gcc-sm8550: Add the missing RETAIN_FF_ENABLE GDSC flag
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Dybcio <[email protected]>
[ Upstream commit 1fe8273c8d4088dd68faaab8640ec95f381cbf1e ]
All of the 8550's GCC GDSCs can and should use the retain registers so as not to lose their state when entering lower power modes.
Stable-dep-of: 967e011013ed ("clk: qcom: gcc-sm8550: Do not turn off PCIe GDSCs during gdsc_disable()")
--- drivers/clk/qcom/gcc-sm8550.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/clk/qcom/gcc-sm8550.c +8 -8
@@ -3001,7 +3001,7 @@ static struct gdsc pcie_0_gdsc = { .name = "pcie_0_gdsc", }, .pwrsts = PWRSTS_OFF_ON, - .flags = POLL_CFG_GDSCR, + .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, }; static struct gdsc pcie_0_phy_gdsc = {
@@ -3010,7 +3010,7 @@ static struct gdsc pcie_0_phy_gdsc = { .name = "pcie_0_phy_gdsc", }, .pwrsts = PWRSTS_OFF_ON, - .flags = POLL_CFG_GDSCR, + .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, }; static struct gdsc pcie_1_gdsc = {
@@ -3019,7 +3019,7 @@ static struct gdsc pcie_1_gdsc = { .name = "pcie_1_gdsc", }, .pwrsts = PWRSTS_OFF_ON, - .flags = POLL_CFG_GDSCR, + .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, }; static struct gdsc pcie_1_phy_gdsc = {
@@ -3028,7 +3028,7 @@ static struct gdsc pcie_1_phy_gdsc = { .name = "pcie_1_phy_gdsc", }, .pwrsts = PWRSTS_OFF_ON, - .flags = POLL_CFG_GDSCR, + .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, }; static struct gdsc ufs_phy_gdsc = {
@@ -3037,7 +3037,7 @@ static struct gdsc ufs_phy_gdsc = { .name = "ufs_phy_gdsc", }, .pwrsts = PWRSTS_OFF_ON, - .flags = POLL_CFG_GDSCR, + .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, }; static struct gdsc ufs_mem_phy_gdsc = {
@@ -3046,7 +3046,7 @@ static struct gdsc ufs_mem_phy_gdsc = { .name = "ufs_mem_phy_gdsc", }, .pwrsts = PWRSTS_OFF_ON, - .flags = POLL_CFG_GDSCR, + .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, }; static struct gdsc usb30_prim_gdsc = {
@@ -3055,7 +3055,7 @@ static struct gdsc usb30_prim_gdsc = { .name = "usb30_prim_gdsc", }, .pwrsts = PWRSTS_OFF_ON, - .flags = POLL_CFG_GDSCR, + .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, }; static struct gdsc usb3_phy_gdsc = {
@@ -3064,7 +3064,7 @@ static struct gdsc usb3_phy_gdsc = { .name = "usb3_phy_gdsc", }, .pwrsts = PWRSTS_OFF_ON, - .flags = POLL_CFG_GDSCR, + .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, }; static struct clk_regmap *gcc_sm8550_clocks[] = {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1154/1191 clk: qcom: gcc-sm8550: Mark the PCIe GDSCs votable
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Dybcio <[email protected]>
[ Upstream commit e7fe73fc6b68ee97b1e8f124a66a5ee50d8d5e5b ]
The PCIe GDSCs on most Qualcomm platforms expect the OS to always consider collapse requests as successful. This also concerns SM8550.
Add the VOTABLE flag to the GDSCs in question to comply with these expectations.
Stable-dep-of: 967e011013ed ("clk: qcom: gcc-sm8550: Do not turn off PCIe GDSCs during gdsc_disable()")
--- drivers/clk/qcom/gcc-sm8550.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/clk/qcom/gcc-sm8550.c +4 -4
@@ -3001,7 +3001,7 @@ static struct gdsc pcie_0_gdsc = { .name = "pcie_0_gdsc", }, .pwrsts = PWRSTS_OFF_ON, - .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, + .flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE, }; static struct gdsc pcie_0_phy_gdsc = {
@@ -3010,7 +3010,7 @@ static struct gdsc pcie_0_phy_gdsc = { .name = "pcie_0_phy_gdsc", }, .pwrsts = PWRSTS_OFF_ON, - .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, + .flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE, }; static struct gdsc pcie_1_gdsc = {
@@ -3019,7 +3019,7 @@ static struct gdsc pcie_1_gdsc = { .name = "pcie_1_gdsc", }, .pwrsts = PWRSTS_OFF_ON, - .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, + .flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE, }; static struct gdsc pcie_1_phy_gdsc = {
@@ -3028,7 +3028,7 @@ static struct gdsc pcie_1_phy_gdsc = { .name = "pcie_1_phy_gdsc", }, .pwrsts = PWRSTS_OFF_ON, - .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, + .flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE, }; static struct gdsc ufs_phy_gdsc = {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1155/1191 clk: qcom: gcc-sm8550: Do not turn off PCIe GDSCs during gdsc_disable()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Manivannan Sadhasivam <[email protected]>
[ Upstream commit 967e011013eda287dbec9e8bd3a19ebe730b8a08 ]
With PWRSTS_OFF_ON, PCIe GDSCs are turned off during gdsc_disable(). This can happen during scenarios such as system suspend and breaks the resume of PCIe controllers from suspend.
So use PWRSTS_RET_ON to indicate the GDSC driver to not turn off the GDSCs during gdsc_disable() and allow the hardware to transition the GDSCs to retention when the parent domain enters low power state during system suspend.
--- drivers/clk/qcom/gcc-sm8550.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/clk/qcom/gcc-sm8550.c +4 -4
@@ -3000,7 +3000,7 @@ static struct gdsc pcie_0_gdsc = { .pd = { .name = "pcie_0_gdsc", }, - .pwrsts = PWRSTS_OFF_ON, + .pwrsts = PWRSTS_RET_ON, .flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE, };
@@ -3009,7 +3009,7 @@ static struct gdsc pcie_0_phy_gdsc = { .pd = { .name = "pcie_0_phy_gdsc", }, - .pwrsts = PWRSTS_OFF_ON, + .pwrsts = PWRSTS_RET_ON, .flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE, };
@@ -3018,7 +3018,7 @@ static struct gdsc pcie_1_gdsc = { .pd = { .name = "pcie_1_gdsc", }, - .pwrsts = PWRSTS_OFF_ON, + .pwrsts = PWRSTS_RET_ON, .flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE, };
@@ -3027,7 +3027,7 @@ static struct gdsc pcie_1_phy_gdsc = { .pd = { .name = "pcie_1_phy_gdsc", }, - .pwrsts = PWRSTS_OFF_ON, + .pwrsts = PWRSTS_RET_ON, .flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE, };
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1156/1191 clk: qcom: gcc-sm8550: use collapse-voting for PCIe GDSCs
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Dybcio <[email protected]>
[ Upstream commit 7e77a39265293ea4f05e20fff180755503c49918 ]
The PCIe GDSCs can be shared with other masters and should use the APCS collapse-vote register when updating the power state.
This is specifically also needed to be able to disable power domains that have been enabled by boot firmware using the vote register.
Following other recent Qualcomm platforms, describe this register and the corresponding mask for the PCIe (and _phy) GDSCs.
--- drivers/clk/qcom/gcc-sm8550.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/clk/qcom/gcc-sm8550.c +8 -0
@@ -2997,6 +2997,8 @@ static struct clk_branch gcc_video_axi1_clk = {static struct gdsc pcie_0_gdsc = { .gdscr =0x6b004 , + .collapse_ctrl =0x52020 , + .collapse_mask =BIT (0 ), .pd = { .name ="pcie_0_gdsc" , },
@@ -3006,6 +3008,8 @@ static struct gdsc pcie_0_gdsc = {static struct gdsc pcie_0_phy_gdsc = { .gdscr =0x6c000 , + .collapse_ctrl =0x52020 , + .collapse_mask =BIT (3 ), .pd = { .name ="pcie_0_phy_gdsc" , },
@@ -3015,6 +3019,8 @@ static struct gdsc pcie_0_phy_gdsc = {static struct gdsc pcie_1_gdsc = { .gdscr =0x8d004 , + .collapse_ctrl =0x52020 , + .collapse_mask =BIT (1 ), .pd = { .name ="pcie_1_gdsc" , },
@@ -3024,6 +3030,8 @@ static struct gdsc pcie_1_gdsc = {static struct gdsc pcie_1_phy_gdsc = { .gdscr =0x8e000 , + .collapse_ctrl =0x52020 , + .collapse_mask =BIT (4 ), .pd = { .name ="pcie_1_phy_gdsc" , },
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1157/1191 clk: qcom: gcc-sm8550: Dont use parking clk_ops for QUPs
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Boyd <[email protected]>
[ Upstream commit d10eeb75168b84ed9559c58efe2756c2e0bc052a ]
The QUPs aren't shared in a way that requires parking the RCG at an always on parent in case some other entity turns on the clk. The hardware is capable of setting a new frequency itself with the DFS mode, so parking is unnecessary. Furthermore, there aren't any GDSCs for these devices, so there isn't a possibility of the GDSC turning on the clks for housekeeping purposes.
This wasn't a problem to mark these clks shared until we started parking shared RCGs at clk registration time in commit 01a0a6cc8cfd ("clk: qcom:
Park shared RCGs upon registration"). Parking at init is actually harmful to the UART when earlycon is used. If the device is pumping out data while the frequency changes you'll see garbage on the serial console until the driver can probe and actually set a proper frequency.
Revert the QUP part of commit 929c75d57566 ("clk: qcom: gcc-sm8550: Mark RCGs shared where applicable") so that the QUPs don't get parked during clk registration and break UART operations.
--- drivers/clk/qcom/gcc-sm8550.c | 52 +++++++++++++++++------------------ 1 file changed, 26 insertions(+), 26 deletions(-)
drivers/clk/qcom/gcc-sm8550.c +26 -26
@@ -535,7 +535,7 @@ static struct clk_rcg2 gcc_qupv3_i2c_s0_clk_src = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }, };
@@ -550,7 +550,7 @@ static struct clk_rcg2 gcc_qupv3_i2c_s1_clk_src = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }, };
@@ -565,7 +565,7 @@ static struct clk_rcg2 gcc_qupv3_i2c_s2_clk_src = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }, };
@@ -580,7 +580,7 @@ static struct clk_rcg2 gcc_qupv3_i2c_s3_clk_src = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }, };
@@ -595,7 +595,7 @@ static struct clk_rcg2 gcc_qupv3_i2c_s4_clk_src = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }, };
@@ -610,7 +610,7 @@ static struct clk_rcg2 gcc_qupv3_i2c_s5_clk_src = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }, };
@@ -625,7 +625,7 @@ static struct clk_rcg2 gcc_qupv3_i2c_s6_clk_src = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }, };
@@ -640,7 +640,7 @@ static struct clk_rcg2 gcc_qupv3_i2c_s7_clk_src = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }, };
@@ -655,7 +655,7 @@ static struct clk_rcg2 gcc_qupv3_i2c_s8_clk_src = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }, };
@@ -670,7 +670,7 @@ static struct clk_rcg2 gcc_qupv3_i2c_s9_clk_src = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }, };
@@ -699,7 +699,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s0_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap1_s0_clk_src = {
@@ -716,7 +716,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s1_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap1_s1_clk_src = {
@@ -749,7 +749,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s2_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap1_s2_clk_src = {
@@ -766,7 +766,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s3_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap1_s3_clk_src = {
@@ -783,7 +783,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s4_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap1_s4_clk_src = {
@@ -800,7 +800,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s5_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap1_s5_clk_src = {
@@ -817,7 +817,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s6_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap1_s6_clk_src = {
@@ -834,7 +834,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s7_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap1_s7_clk_src = {
@@ -851,7 +851,7 @@ static struct clk_init_data gcc_qupv3_wrap2_s0_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap2_s0_clk_src = {
@@ -868,7 +868,7 @@ static struct clk_init_data gcc_qupv3_wrap2_s1_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap2_s1_clk_src = {
@@ -885,7 +885,7 @@ static struct clk_init_data gcc_qupv3_wrap2_s2_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap2_s2_clk_src = {
@@ -902,7 +902,7 @@ static struct clk_init_data gcc_qupv3_wrap2_s3_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap2_s3_clk_src = {
@@ -919,7 +919,7 @@ static struct clk_init_data gcc_qupv3_wrap2_s4_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap2_s4_clk_src = {
@@ -936,7 +936,7 @@ static struct clk_init_data gcc_qupv3_wrap2_s5_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap2_s5_clk_src = {
@@ -974,7 +974,7 @@ static struct clk_init_data gcc_qupv3_wrap2_s6_clk_src_init = { .parent_data = gcc_parent_data_8, .num_parents = ARRAY_SIZE(gcc_parent_data_8), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap2_s6_clk_src = {
@@ -991,7 +991,7 @@ static struct clk_init_data gcc_qupv3_wrap2_s7_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap2_s7_clk_src = {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1158/1191 arm64: dts: qcom: sm8550: Add missing properties for cryptobam
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephan Gerhold <[email protected]>
[ Upstream commit 663cd2cad36da23cf1a3db7868fce9f1a19b2d61 ]
num-channels and qcom,num-ees are required for BAM nodes without clock, because the driver cannot ensure the hardware is powered on when trying to obtain the information from the hardware registers. Specifying the node without these properties is unsafe and has caused early boot crashes for other SoCs before [1, 2].
Add the missing information from the hardware registers to ensure the driver can probe successfully without causing crashes.
[1]: https://lore.kernel.org/r/[email protected]/
[2]: https://lore.kernel.org/r/[email protected]/
--- arch/arm64/boot/dts/qcom/sm8550.dtsi | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/qcom/sm8550.dtsi +2 -0
@@ -1581,6 +1581,8 @@ cryptobam: dma-controller@1dc4000 { interrupts = <GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>; #dma-cells = <1>; qcom,ee = <0>; + qcom,num-ees = <4>; + num-channels = <20>; qcom,controlled-remotely; iommus = <&apps_smmu 0x480 0x0>, <&apps_smmu 0x481 0x0>;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1159/1191 arm64: dts: qcom: sm8550: remove invalid interconnect property from cryptobam
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Neil Armstrong <[email protected]>
[ Upstream commit 26e95ff8a912fd787a65ae1ae4cc4684f5f84fce ]
The interconnect property is already present in the qce node, which is the consumer of the cryptobam, so no need for an interconnect property as documented by the bindings.
--- arch/arm64/boot/dts/qcom/sm8550.dtsi | 2 -- 1 file changed, 2 deletions(-)
arch/arm64/boot/dts/qcom/sm8550.dtsi +0 -2
@@ -1586,8 +1586,6 @@ cryptobam: dma-controller@1dc4000 { qcom,controlled-remotely; iommus = <&apps_smmu 0x480 0x0>, <&apps_smmu 0x481 0x0>; - interconnects = <&aggre2_noc MASTER_CRYPTO 0 &mc_virt SLAVE_EBI1 0>; - interconnect-names = "memory"; }; crypto: crypto@1de0000 {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1160/1191 arm64: dts: qcom: sm8550: Fix UFS PHY clocks
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Manivannan Sadhasivam <[email protected]>
[ Upstream commit 746ae23ad02004fe283e2edb45b7a060bbc36d46 ]
QMP PHY used in SM8550 requires 3 clocks:
* ref - 19.2MHz reference clock from RPMh
* ref_aux - Auxiliary reference clock from GCC
* qref - QREF clock from TCSR
--- arch/arm64/boot/dts/qcom/sm8550.dtsi | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/qcom/sm8550.dtsi +6 -3
@@ -1602,9 +1602,12 @@ crypto: crypto@1de0000 { ufs_mem_phy: phy@1d80000 { compatible = "qcom,sm8550-qmp-ufs-phy"; reg = <0x0 0x01d80000 0x0 0x2000>; - clocks = <&tcsr TCSR_UFS_CLKREF_EN>, - <&gcc GCC_UFS_PHY_PHY_AUX_CLK>; - clock-names = "ref", "ref_aux"; + clocks = <&rpmhcc RPMH_CXO_CLK>, + <&gcc GCC_UFS_PHY_PHY_AUX_CLK>, + <&tcsr TCSR_UFS_CLKREF_EN>; + clock-names = "ref", + "ref_aux", + "qref"; power-domains = <&gcc UFS_MEM_PHY_GDSC>;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1161/1191 arm64: dts: qcom: sm8550: Enable UHS-I SDR50 and SDR104 SD card modes
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vladimir Zapolskiy <[email protected]>
[ Upstream commit 66b0f024fba0728ddce6916dce173bb1bdd4eab0 ]
The restriction on UHS-I speed modes was added to all SM8550 platforms by copying it from SM8450 dtsi file, and due to the overclocking of SD cards it was an actually reproducible problem. Since the latter issue has been fixed, UHS-I speed modes are working fine on SM8550 boards, below is the test performed on SM8550-HDK:
SDR50 speed mode:
mmc0: new UHS-I speed SDR50 SDHC card at address 0001
mmcblk0: mmc0:0001 00000 14.6 GiB
mmcblk0: p1
% dd if=/dev/mmcblk0p1 of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 23.5468 s, 45.6 MB/sSDR104 speed mode:
mmc0: new UHS-I speed SDR104 SDHC card at address 59b4
mmcblk0: mmc0:59b4 USDU1 28.3 GiB
mmcblk0: p1
% dd if=/dev/mmcblk0p1 of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 11.9819 s, 89.6 MB/sUnset the UHS-I speed mode restrictions from the SM8550 platform dtsi file, there is no indication that the SDHC controller is broken.
--- arch/arm64/boot/dts/qcom/sm8550.dtsi | 3 --- 1 file changed, 3 deletions(-)
arch/arm64/boot/dts/qcom/sm8550.dtsi +0 -3
@@ -1728,9 +1728,6 @@ sdhc_2: mmc@8804000 { bus-width = <4>; dma-coherent; - /* Forbid SDR104/SDR50 - broken hw! */ - sdhci-caps-mask = <0x3 0>; - status = "disabled"; sdhc2_opp_table: opp-table {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1162/1191 arm64: dts: qcom: sm8550: Mark UFS controller as cache coherent
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Manivannan Sadhasivam <[email protected]>
[ Upstream commit ee1d5100c37e7a95af506c7addf018f652545ce6 ]
The UFS controller on SM8550 supports cache coherency, hence add the "dma-coherent" property to mark it as such.
--- arch/arm64/boot/dts/qcom/sm8550.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/qcom/sm8550.dtsi +1 -0
@@ -1636,6 +1636,7 @@ ufs_mem_hc: ufs@1d84000 { required-opps = <&rpmhpd_opp_nom>; iommus = <&apps_smmu 0x60 0x0>; + dma-coherent; interconnects = <&aggre1_noc MASTER_UFS_MEM 0 &mc_virt SLAVE_EBI1 0>, <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_UFS_MEM_CFG 0>;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1163/1191 arm64: dts: qcom: sm8550: Fix xo clock supply of platform SD host controller
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vladimir Zapolskiy <[email protected]>
[ Upstream commit 30ac651c69bddbc83cab6d52fc5d2e03bed83282 ]
The expected frequency of SD host controller core supply clock is 19.2MHz, while RPMH_CXO_CLK clock frequency on SM8650 platform is 38.4MHz.
Apparently the overclocked supply clock could be good enough on some boards and even with the most of SD cards, however some low-end UHS-I SD cards in SDR104 mode of the host controller produce I/O errors in runtime, fortunately this problem is gone, if the "xo" clock frequency matches the expected 19.2MHz clock rate.
--- arch/arm64/boot/dts/qcom/sm8550.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm8550.dtsi +1 -1
@@ -1715,7 +1715,7 @@ sdhc_2: mmc@8804000 { clocks = <&gcc GCC_SDCC2_AHB_CLK>, <&gcc GCC_SDCC2_APPS_CLK>, - <&rpmhcc RPMH_CXO_CLK>; + <&bi_tcxo_div2>; clock-names = "iface", "core", "xo"; iommus = <&apps_smmu 0x540 0>; qcom,dll-config = <0x0007642c>;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1164/1191 arm64: dts: qcom: sm8550: Fix GIC_ITS range length
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Dybcio <[email protected]>
[ Upstream commit 357c559e386705609b6b9dc0544c420e3f91f3a0 ]
Currently, the GITS_SGIR register is cut off. Fix it up.
--- arch/arm64/boot/dts/qcom/sm8550.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm8550.dtsi +1 -1
@@ -2470,7 +2470,7 @@ intc: interrupt-controller@17100000 { gic_its: msi-controller@17140000 { compatible = "arm,gic-v3-its"; - reg = <0 0x17140000 0 0x20000>; + reg = <0 0x17140000 0 0x40000>; msi-controller; #msi-cells = <1>; };
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1165/1191 arm64: dts: qcom: sm8550: Fix the PCI I/O port range
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Manivannan Sadhasivam <[email protected]>
[ Upstream commit 565c633940312b4eea7785a0a58e1944258c47e9 ]
For 1MiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x100000. Hence, fix the bogus PCI addresses (0x60200000, 0x40200000) specified in the ranges property for I/O region.
While at it, let's use the missing 0x prefix for the addresses.
--- arch/arm64/boot/dts/qcom/sm8550.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/sm8550.dtsi +4 -4
@@ -1377,8 +1377,8 @@ pcie0: pci@1c00000 { reg-names = "parf", "dbi", "elbi", "atu", "config"; #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x60200000 0 0x60200000 0x0 0x100000>, - <0x02000000 0x0 0x60300000 0 0x60300000 0x0 0x3d00000>; + ranges = <0x01000000 0x0 0x00000000 0x0 0x60200000 0x0 0x100000>, + <0x02000000 0x0 0x60300000 0x0 0x60300000 0x0 0x3d00000>; bus-range = <0x00 0xff>; dma-coherent;
@@ -1477,8 +1477,8 @@ pcie1: pci@1c08000 { reg-names = "parf", "dbi", "elbi", "atu", "config"; #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x40200000 0 0x40200000 0x0 0x100000>, - <0x02000000 0x0 0x40300000 0 0x40300000 0x0 0x1fd00000>; + ranges = <0x01000000 0x0 0x00000000 0x0 0x40200000 0x0 0x100000>, + <0x02000000 0x0 0x40300000 0x0 0x40300000 0x0 0x1fd00000>; bus-range = <0x00 0xff>; dma-coherent;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1166/1191 arm64: dts: qcom: sm8550: Mark QUPs and GPI dma-coherent
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Dybcio <[email protected]>
[ Upstream commit 91fc74458d833dbc999aa04ca34c2a197711a0b6 ]
These peripherals are DMA-coherent on 8550. Mark them as such.
Interestingly enough, the I2C master hubs are not.
--- arch/arm64/boot/dts/qcom/sm8550.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/qcom/sm8550.dtsi +4 -0
@@ -683,6 +683,7 @@ gpi_dma2: dma-controller@800000 { dma-channels = <12>; dma-channel-mask = <0x3e>; iommus = <&apps_smmu 0x436 0>; + dma-coherent; status = "disabled"; };
@@ -694,6 +695,7 @@ qupv3_id_1: geniqup@8c0000 { clocks = <&gcc GCC_QUPV3_WRAP_2_M_AHB_CLK>, <&gcc GCC_QUPV3_WRAP_2_S_AHB_CLK>; iommus = <&apps_smmu 0x423 0>; + dma-coherent; #address-cells = <2>; #size-cells = <2>; status = "disabled";
@@ -998,6 +1000,7 @@ gpi_dma1: dma-controller@a00000 { dma-channels = <12>; dma-channel-mask = <0x1e>; iommus = <&apps_smmu 0xb6 0>; + dma-coherent; status = "disabled"; };
@@ -1011,6 +1014,7 @@ qupv3_id_0: geniqup@ac0000 { iommus = <&apps_smmu 0xa3 0>; interconnects = <&clk_virt MASTER_QUP_CORE_1 0 &clk_virt SLAVE_QUP_CORE_1 0>; interconnect-names = "qup-core"; + dma-coherent; #address-cells = <2>; #size-cells = <2>; status = "disabled";
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1167/1191 arm64: dts: qcom: sm8550: Fix SPMI channels size
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abel Vesa <[email protected]>
[ Upstream commit 77dd1e50ffcba33c3195ae4fc78f354368ddacb2 ]
The actual size of the channels registers region is 4MB, according to the documentation. This issue was not caught until now because the driver was supposed to allow same regions being mapped multiple times for supporting multiple buses. Thie driver is using platform_get_resource_byname() and devm_ioremap() towards that purpose, which intentionally avoids devm_request_mem_region() altogether.
--- arch/arm64/boot/dts/qcom/sm8550.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm8550.dtsi +1 -1
@@ -1823,7 +1823,7 @@ sram@c3f0000 { spmi_bus: spmi@c400000 { compatible = "qcom,spmi-pmic-arb"; reg = <0 0x0c400000 0 0x3000>, - <0 0x0c500000 0 0x4000000>, + <0 0x0c500000 0 0x400000>, <0 0x0c440000 0 0x80000>, <0 0x0c4c0000 0 0x20000>, <0 0x0c42d000 0 0x4000>;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1168/1191 arm64: dts: qcom: sm8550: Update idle state time requirements
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Dybcio <[email protected]>
[ Upstream commit ad6556fb45d4ab91ad786a2025cbe2b0f2e6cf77 ]
The idle state entry/exit/residency times differ from what shipped on production devices, mostly being overly optimistic in entry times and overly pessimistic in minimal residency times. Align them with downstream sources.
--- arch/arm64/boot/dts/qcom/sm8550.dtsi | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
arch/arm64/boot/dts/qcom/sm8550.dtsi +10 -10
@@ -259,9 +259,9 @@ LITTLE_CPU_SLEEP_0: cpu-sleep-0-0 { compatible = "arm,idle-state"; idle-state-name = "silver-rail-power-collapse"; arm,psci-suspend-param = <0x40000004>; - entry-latency-us = <800>; + entry-latency-us = <550>; exit-latency-us = <750>; - min-residency-us = <4090>; + min-residency-us = <6700>; local-timer-stop; };
@@ -270,8 +270,8 @@ BIG_CPU_SLEEP_0: cpu-sleep-1-0 { idle-state-name = "gold-rail-power-collapse"; arm,psci-suspend-param = <0x40000004>; entry-latency-us = <600>; - exit-latency-us = <1550>; - min-residency-us = <4791>; + exit-latency-us = <1300>; + min-residency-us = <8136>; local-timer-stop; }; };
@@ -280,17 +280,17 @@ domain-idle-states { CLUSTER_SLEEP_0: cluster-sleep-0 { compatible = "domain-idle-state"; arm,psci-suspend-param = <0x41000044>; - entry-latency-us = <1050>; - exit-latency-us = <2500>; - min-residency-us = <5309>; + entry-latency-us = <750>; + exit-latency-us = <2350>; + min-residency-us = <9144>; }; CLUSTER_SLEEP_1: cluster-sleep-1 { compatible = "domain-idle-state"; arm,psci-suspend-param = <0x4100c344>; - entry-latency-us = <2700>; - exit-latency-us = <3500>; - min-residency-us = <13959>; + entry-latency-us = <2800>; + exit-latency-us = <4400>; + min-residency-us = <10150>; }; }; };
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1169/1191 arm64: dts: qcom: sm8550: Separate out X3 idle state
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Dybcio <[email protected]>
[ Upstream commit 28b735232d5e16a34f98dbac1e7b5401c1c16d89 ]
The X3 core has different entry/exit/residency time requirements than the big cluster. Denote them to stop confusing the scheduler.
--- arch/arm64/boot/dts/qcom/sm8550.dtsi | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm8550.dtsi +11 -1
@@ -274,6 +274,16 @@ BIG_CPU_SLEEP_0: cpu-sleep-1-0 { min-residency-us = <8136>; local-timer-stop; }; + + PRIME_CPU_SLEEP_0: cpu-sleep-2-0 { + compatible = "arm,idle-state"; + idle-state-name = "goldplus-rail-power-collapse"; + arm,psci-suspend-param = <0x40000004>; + entry-latency-us = <500>; + exit-latency-us = <1350>; + min-residency-us = <7480>; + local-timer-stop; + }; }; domain-idle-states {
@@ -373,7 +383,7 @@ CPU_PD6: power-domain-cpu6 { CPU_PD7: power-domain-cpu7 { #power-domain-cells = <0>; power-domains = <&CLUSTER_PD>; - domain-idle-states = <&BIG_CPU_SLEEP_0>; + domain-idle-states = <&PRIME_CPU_SLEEP_0>; }; CLUSTER_PD: power-domain-cluster {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1170/1191 arm64: dts: qcom: sm8550: Flush RSC sleep & wake votes
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Dybcio <[email protected]>
[ Upstream commit 4b2c7ac8e469ab7f92e50c34ad4012a77e79d078 ]
The rpmh driver will cache sleep and wake votes until the cluster power-domain is about to enter idle, to avoid unnecessary writes. So associate the apps_rsc with the cluster pd, so that it can be notified about this event.
Without this, only AMC votes are being commited.
--- arch/arm64/boot/dts/qcom/sm8550.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/qcom/sm8550.dtsi +1 -0
@@ -2563,6 +2563,7 @@ apps_rsc: rsc@17a00000 { qcom,drv-id = <2>; qcom,tcs-config = <ACTIVE_TCS 3>, <SLEEP_TCS 2>, <WAKE_TCS 2>, <CONTROL_TCS 0>; + power-domains = <&CLUSTER_PD>; apps_bcm_voter: bcm-voter { compatible = "qcom,bcm-voter";
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1171/1191 arm64: dts: qcom: sm8550: correct pinctrl unit address
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 950a4fe6ec8498799d1c7bd31a489a718f94a87e ]
Match unit-address to reg entry to fix dtbs W=1 warnings:
Warning (simple_bus_reg): /soc@0/pinctrl@f000000: simple-bus unit address format error, expected "f100000"
--- arch/arm64/boot/dts/qcom/sm8550.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm8550.dtsi +1 -1
@@ -1849,7 +1849,7 @@ spmi_bus: spmi@c400000 { #interrupt-cells = <4>; }; - tlmm: pinctrl@f000000 { + tlmm: pinctrl@f100000 { compatible = "qcom,sm8550-tlmm"; reg = <0 0x0f100000 0 0x300000>; interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1172/1191 arm64: dts: qcom: sm8550: fix qup_spi0_cs node
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Neil Armstrong <[email protected]>
[ Upstream commit 7629c7a525d163f2a3a08e260a69ff25163ab357 ]
The node is incomplete and doesn't need a subnode, add the missing properties and move everything to the root of qup-spi0-cs-state node.
--- arch/arm64/boot/dts/qcom/sm8550.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/sm8550.dtsi +4 -4
@@ -2107,10 +2107,10 @@ qup_i2c15_data_clk: qup-i2c15-data-clk-state { }; qup_spi0_cs: qup-spi0-cs-state { - cs-pins { - pins = "gpio31"; - function = "qup1_se0"; - }; + pins = "gpio31"; + function = "qup1_se0"; + drive-strength = <6>; + bias-disable; }; qup_spi0_data_clk: qup-spi0-data-clk-state {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1173/1191 arm64: dts: qcom: sm8550: Fix the aoss_qmp node name
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abel Vesa <[email protected]>
[ Upstream commit 3a63e478b3c01b7c0eddba1121200b089bf1df12 ]
The proper name for it is power-management. Currently, with the node name being power-controller, the bindings check fails due to the property #power-domain-cells missing.
--- arch/arm64/boot/dts/qcom/sm8550.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm8550.dtsi +1 -1
@@ -1814,7 +1814,7 @@ tsens2: thermal-sensor@c273000 { #thermal-sensor-cells = <1>; }; - aoss_qmp: power-controller@c300000 { + aoss_qmp: power-management@c300000 { compatible = "qcom,sm8550-aoss-qmp", "qcom,aoss-qmp"; reg = <0 0x0c300000 0 0x400>; interrupt-parent = <&ipcc>;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1174/1191 arm64: dts: qcom: sm8350: correct PCI phy unit address
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
[ Upstream commit ab98c21bc9246f421a6ae70e69f1b73cea6f85e3 ]
Match unit-address to reg entry to fix dtbs W=1 warnings:
Warning (simple_bus_reg): /soc@0/phy@1c0f000: simple-bus unit address format error, expected "1c0e000"
--- arch/arm64/boot/dts/qcom/sm8350.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm8350.dtsi +1 -1
@@ -1732,7 +1732,7 @@ pcie1: pci@1c08000 { status = "disabled"; }; - pcie1_phy: phy@1c0f000 { + pcie1_phy: phy@1c0e000 { compatible = "qcom,sm8350-qmp-gen3x2-pcie-phy"; reg = <0 0x01c0e000 0 0x2000>; clocks = <&gcc GCC_PCIE_1_AUX_CLK>,
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1175/1191 arm64: dts: qcom: sm8350: Fix the PCI I/O port range
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Manivannan Sadhasivam <[email protected]>
[ Upstream commit cf4e716e9a38b32a922a88ac3c5b701137a663dd ]
For 1MiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x100000. Hence, fix the bogus PCI addresses (0x60200000, 0x40200000) specified in the ranges property for I/O region.
While at it, let's use the missing 0x prefix for the addresses.
--- arch/arm64/boot/dts/qcom/sm8350.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/sm8350.dtsi +4 -4
@@ -1596,8 +1596,8 @@ pcie0: pci@1c00000 { #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x60200000 0 0x60200000 0x0 0x100000>, - <0x02000000 0x0 0x60300000 0 0x60300000 0x0 0x3d00000>; + ranges = <0x01000000 0x0 0x00000000 0x0 0x60200000 0x0 0x100000>, + <0x02000000 0x0 0x60300000 0x0 0x60300000 0x0 0x3d00000>; interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>,
@@ -1689,8 +1689,8 @@ pcie1: pci@1c08000 { #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x40200000 0 0x40200000 0x0 0x100000>, - <0x02000000 0x0 0x40300000 0 0x40300000 0x0 0x1fd00000>; + ranges = <0x01000000 0x0 0x00000000 0x0 0x40200000 0x0 0x100000>, + <0x02000000 0x0 0x40300000 0x0 0x40300000 0x0 0x1fd00000>; interrupts = <GIC_SPI 307 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "msi";
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1176/1191 wifi: mt76: mt7915: fallback to non-wed mode if platform_get_resource fails in mt7915_mmio_wed_init()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Bianconi <[email protected]>
[ Upstream commit 5f9d5d4fc561e7bd3a18742f1fdb96cab98f1870 ]
mt76 assumes mt7915_mmio_wed_init can fail just after wed driver has been attached running mtk_wed_device_attach().
Fall back to non-wed mode if platform_get_resource fails in mt7915_mmio_wed_init routines.
--- drivers/net/wireless/mediatek/mt76/mt7915/mmio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7915/mmio.c +1 -1
@@ -618,7 +618,7 @@ int mt7915_mmio_wed_init(struct mt7915_dev *dev, void *pdev_ptr, res =platform_get_resource (plat_dev,IORESOURCE_MEM ,0 );if (!res) -return -ENOMEM ; +return 0 ; wed->wlan.platform_dev = plat_dev; wed->wlan.bus_type =MTK_WED_BUS_AXI ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1177/1191 wifi: mt76: mt7915: fix use-after-free bugs in mt7915_mac_dump_work()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Duoming Zhou <[email protected]>
[ Upstream commit 1146d0946b5358fad24812bd39d68f31cd40cc34 ]
When the mt7915 pci chip is detaching, the mt7915_crash_data is released in mt7915_coredump_unregister(). However, the work item dump_work may still be running or pending, leading to UAF bugs when the already freed crash_data is dereferenced again in mt7915_mac_dump_work().
The race condition can occur as follows:
CPU 0 (removal path) | CPU 1 (workqueue)
mt7915_pci_remove() | mt7915_sys_recovery_set()
mt7915_unregister_device() | mt7915_reset()
mt7915_coredump_unregister() | queue_work()
vfree(dev->coredump.crash_data) | mt7915_mac_dump_work()
| crash_data-> // UAFFix this by ensuring dump_work is properly canceled before the crash_data is deallocated. Add cancel_work_sync() in mt7915_unregister_device() to synchronize with any pending or executing dump work.
--- drivers/net/wireless/mediatek/mt76/mt7915/init.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/mediatek/mt76/mt7915/init.c +1 -0
@@ -1150,6 +1150,7 @@ int mt7915_register_device(struct mt7915_dev *dev)void mt7915_unregister_device (struct mt7915_dev *dev) { +cancel_work_sync (&dev->dump_work);mt7915_unregister_ext_phy (dev);mt7915_coredump_unregister (dev);mt7915_unregister_thermal (&dev->phy);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1178/1191 HID: fix an error code in hid_check_device_match()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
[ Upstream commit 89e756e3cc8d9c1ebc0f2b2f6912227073d93118 ]
The hid_check_device_match() returns true if we find a match and false if we don't. But here it returns -ENODEV which becomes true instead of false.
--- drivers/hid/hid-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid-core.c +1 -1
@@ -2645,7 +2645,7 @@ static bool hid_check_device_match(struct hid_device *hdev, { *id =hid_match_device (hdev, hdrv);if (!*id) -return -ENODEV ; +return false;if (hdrv->match)return hdrv->match (hdev, hid_ignore_special_drivers);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1179/1191 Bluetooth: hci_event: Fix connection regression between LE and non-LE adapters
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arkadiusz Bokowy <[email protected]>
[ Upstream commit f6685a96c8c8a07e260e39bac86d4163cfb38a4d ]
Due to a typo during defining HCI errors it is not possible to connect LE-capable device with BR/EDR only adapter. The connection is terminated by the LE adapter because the invalid LL params error code is treated as unsupported remote feature.
--- include/net/bluetooth/hci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/net/bluetooth/hci.h +1 -1
@@ -632,7 +632,7 @@ enum {#define HCI_ERROR_REMOTE_POWER_OFF 0x15#define HCI_ERROR_LOCAL_HOST_TERM 0x16#define HCI_ERROR_PAIRING_NOT_ALLOWED 0x18 -#define HCI_ERROR_UNSUPPORTED_REMOTE_FEATURE 0x1e +#define HCI_ERROR_UNSUPPORTED_REMOTE_FEATURE 0x1a#define HCI_ERROR_INVALID_LL_PARAMS 0x1e#define HCI_ERROR_UNSPECIFIED 0x1f#define HCI_ERROR_ADVERTISING_TIMEOUT 0x3c
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1180/1191 nvme-apple: Prevent shared tags across queues on Apple A11
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nick Chan <[email protected]>
[ Upstream commit 6fe0687245e8406bf26143bd45eb16441bbe5280 ]
On Apple A11, tags of pending commands must be unique across the admin and IO queues, else the firmware crashes with
"duplicate tag error for tag N", with N being the tag.
Apply the existing workaround for M1 of reserving two tags for the admin queue to A11.
--- drivers/nvme/host/apple.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/nvme/host/apple.c +4 -8
@@ -239,7 +239,7 @@ static unsigned int apple_nvme_queue_depth(struct apple_nvme_queue *q) {struct apple_nvme *anv =queue_to_apple_nvme (q); -if (q->is_adminq && anv->hw->has_lsq_nvmmu) +if (q->is_adminq)return APPLE_NVME_AQ_DEPTH ;return anv->hw->max_queue_depth;
@@ -317,7 +317,7 @@ static void apple_nvme_submit_cmd_t8015(struct apple_nvme_queue *q,memcpy ((void *)q->sqes + (q->sq_tail <<APPLE_NVME_IOSQES ), cmd,sizeof (*cmd)); -if (++q->sq_tail == anv->hw->max_queue_depth) +if (++q->sq_tail ==apple_nvme_queue_depth (q)) q->sq_tail =0 ;writel (q->sq_tail, q->sq_db);
@@ -1114,10 +1114,7 @@ static void apple_nvme_reset_work(struct work_struct *work) }/* Setup the admin queue */ -if (anv->hw->has_lsq_nvmmu) - aqa =APPLE_NVME_AQ_DEPTH -1 ; -else - aqa = anv->hw->max_queue_depth -1 ; + aqa =APPLE_NVME_AQ_DEPTH -1 ; aqa |= aqa <<16 ;writel (aqa, anv->mmio_nvme +NVME_REG_AQA );writeq (anv->adminq.sq_dma_addr, anv->mmio_nvme +NVME_REG_ASQ );
@@ -1300,8 +1297,7 @@ static int apple_nvme_alloc_tagsets(struct apple_nvme *anv)* both queues. The admin queue gets the first APPLE_NVME_AQ_DEPTH which * must be marked as reserved in the IO queue. */ -if (anv->hw->has_lsq_nvmmu) - anv->tagset.reserved_tags =APPLE_NVME_AQ_DEPTH ; + anv->tagset.reserved_tags =APPLE_NVME_AQ_DEPTH ; anv->tagset.queue_depth = anv->hw->max_queue_depth -1 ; anv->tagset.timeout =NVME_IO_TIMEOUT ; anv->tagset.numa_node =NUMA_NO_NODE ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1181/1191 nvme-apple: Reset q->sq_tail during queue init
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nick Chan <[email protected]>
[ Upstream commit a6ab75639e23169a741b0b2e12191fd8acb32c73 ]
Fixes a "duplicate tag error for tag 0" firmware crash during controller reset while setting up a queue on Apple A11 / T8015 caused by stale entries in the submission queue due to an invalid sq_tail offset after reset.
--- drivers/nvme/host/apple.c | 1 + 1 file changed, 1 insertion(+)
drivers/nvme/host/apple.c +1 -0
@@ -1009,6 +1009,7 @@ static void apple_nvme_init_queue(struct apple_nvme_queue *q)unsigned int depth =apple_nvme_queue_depth (q);struct apple_nvme *anv =queue_to_apple_nvme (q); + q->sq_tail =0 ; q->cq_head =0 ; q->cq_phase =1 ;if (anv->hw->has_lsq_nvmmu)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1182/1191 net: hsr: enable promiscuous mode on interlink port with fwd offload
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: MD Danish Anwar <[email protected]>
[ Upstream commit a2dc179481d18f6df7274522571b64dd50f31e81 ]
hsr_portdev_setup() skips promiscuous mode on non-master ports when hsr->fwd_offloaded is set. fwd_offloaded is derived only from the ring slaves' NETIF_F_HW_HSR_FWD bit, so this also skips it for the interlink port, which never gets forwarding offload. Without promiscuous mode, the interlink NIC drops unicast frames addressed to hsr_dev's MAC (e.g. SAN traffic to the RedBox), breaking RedBox whenever the ring is HW-offloaded.
--- net/hsr/hsr_slave.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
net/hsr/hsr_slave.c +7 -4
@@ -139,9 +139,12 @@ static int hsr_portdev_setup(struct hsr_priv *hsr, struct net_device *dev,int res;/* Don't use promiscuous mode for offload since L2 frame forward -* happens at the offloaded hardware. +* happens at the offloaded hardware. The interlink port never +* gets forwarding offload (RedBox forwarding to/from it is done +* by this driver), so it still needs promiscuous mode to receive +* frames addressed to hsr_dev's MAC rather than its own. */ -if (!port->hsr->fwd_offloaded) { +if (!port->hsr->fwd_offloaded || port->type ==HSR_PT_INTERLINK ) { res =dev_set_promiscuity (dev,1 );if (res)return res;
@@ -164,7 +167,7 @@ static int hsr_portdev_setup(struct hsr_priv *hsr, struct net_device *dev, fail_rx_handler:netdev_upper_dev_unlink (dev, hsr_dev); fail_upper_dev_link: -if (!port->hsr->fwd_offloaded) +if (!port->hsr->fwd_offloaded || port->type ==HSR_PT_INTERLINK )dev_set_promiscuity (dev,-1 );return res;
@@ -227,7 +230,7 @@ void hsr_del_port(struct hsr_port *port)netdev_update_features (master->dev);dev_set_mtu (master->dev,hsr_get_max_mtu (hsr));netdev_rx_handler_unregister (port->dev); -if (!port->hsr->fwd_offloaded) +if (!port->hsr->fwd_offloaded || port->type ==HSR_PT_INTERLINK )dev_set_promiscuity (port->dev,-1 );if (port->type ==HSR_PT_SLAVE_A || port->type ==HSR_PT_SLAVE_B )vlan_vids_del_by_dev (port->dev, master->dev);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1183/1191 net: hsr: Use the seqnr lock for frames received via interlink port.
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <[email protected]>
[ Upstream commit 430d67bdcb04ee8502c2b10dcbaced4253649189 ]
syzbot reported that the seqnr_lock is not acquire for frames received over the interlink port. In the interlink case a new seqnr is generated and assigned to the frame.
Frames, which are received over the slave port have already a sequence number assigned so the lock is not required.
Acquire the hsr_priv::seqnr_lock during in the invocation of hsr_forward_skb() if a packet has been received from the interlink port.
--- net/hsr/hsr_slave.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
net/hsr/hsr_slave.c +10 -1
@@ -73,7 +73,16 @@ static rx_handler_result_t hsr_handle_frame(struct sk_buff **pskb) }skb_reset_mac_len (skb); -hsr_forward_skb (skb, port); +/* Only the frames received over the interlink port will assign a +* sequence number and require synchronisation vs other sender. +*/ +if (port->type ==HSR_PT_INTERLINK ) { +spin_lock_bh (&hsr->seqnr_lock); +hsr_forward_skb (skb, port); +spin_unlock_bh (&hsr->seqnr_lock); + }else { +hsr_forward_skb (skb, port); + } finish_consume:return RX_HANDLER_CONSUMED ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1184/1191 net: hsr: init prune_proxy_timer sooner
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 3c668cef61adde9ddfb1b79708c9a08d9ac01bae ]
We must initialize prune_proxy_timer before we attempt a del_timer_sync() on it.
syzbot reported the following splat:
INFO: trying to register non-static key.
The code is fine but needs lockdep annotation, or maybe you didn't initialize this object before use? turning off the locking correctness validator.
CPU: 1 PID: 11 Comm: kworker/u8:1 Not tainted 6.9.0-rc5-syzkaller-01199-gfc48de77d69d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Workqueue: netns cleanup_net Call Trace: <TASK> __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 assign_lock_key+0x238/0x270 kernel/locking/lockdep.c:976 register_lock_class+0x1cf/0x980 kernel/locking/lockdep.c:1289 __lock_acquire+0xda/0x1fd0 kernel/locking/lockdep.c:5014 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __timer_delete_sync+0x148/0x310 kernel/time/timer.c:1648 del_timer_sync include/linux/timer.h:185 [inline] hsr_dellink+0x33/0x80 net/hsr/hsr_netlink.c:132 default_device_exit_batch+0x956/0xa90 net/core/dev.c:11737 ops_exit_list net/core/net_namespace.c:175 [inline] cleanup_net+0x89d/0xcc0 net/core/net_namespace.c:637 process_one_work kernel/workqueue.c:3254 [inline] process_scheduled_works+0xa10/0x17c0 kernel/workqueue.c:3335 worker_thread+0x86d/0xd70 kernel/workqueue.c:3416 kthread+0x2f0/0x390 kernel/kthread.c:388 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 </TASK> ODEBUG: assert_init not available (active state 0) object: ffff88806d3fcd88 object type: timer_list hint: 0x0 WARNING: CPU: 1 PID: 11 at lib/debugobjects.c:517 debug_print_object+0x17a/0x1f0 lib/debugobjects.c:514
--- net/hsr/hsr_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/hsr/hsr_device.c +1 -1
@@ -681,6 +681,7 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2],timer_setup (&hsr->announce_timer, hsr_announce,0 );timer_setup (&hsr->prune_timer, hsr_prune_nodes,0 ); +timer_setup (&hsr->prune_proxy_timer, hsr_prune_proxy_nodes,0 );ether_addr_copy (hsr->sup_multicast_addr, def_multicast_addr); hsr->sup_multicast_addr[ETH_ALEN -1 ] = multicast_spec;
@@ -724,7 +725,6 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2], hsr->redbox = true;ether_addr_copy (hsr->macaddress_redbox, interlink->dev_addr); -timer_setup (&hsr->prune_proxy_timer, hsr_prune_proxy_nodes,0 );mod_timer (&hsr->prune_proxy_timer, jiffies +msecs_to_jiffies (PRUNE_PROXY_PERIOD )); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1185/1191 kselftest/arm64: mte: Skip the hugetlb tests if MTE not supported on such mappings
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Catalin Marinas <[email protected]>
[ Upstream commit 306219d59b72cfca4005229b2c6ad43a16479e3b ]
While the kselftest was added at the same time with the kernel support for MTE on hugetlb mappings, the tests may be run on older kernels. Skip the tests if PROT_MTE is not supported on MAP_HUGETLB mappings.
--- .../selftests/arm64/mte/check_hugetlb_options.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
tools/testing/selftests/arm64/mte/check_hugetlb_options.c +11 -0
@@ -227,6 +227,8 @@ static int check_child_hugetlb_memory_mapping(int mem_type, int mode, int mappinint main (int argc,char *argv[]) {int err; +void *map_ptr; +unsigned long map_size;ksft_print_header ();
@@ -245,6 +247,15 @@ int main(int argc, char *argv[])return KSFT_FAIL ; } +/* Check if MTE supports hugetlb mappings */ + map_size =default_huge_page_size (); + map_ptr =mmap (NULL , map_size,PROT_READ |PROT_MTE , +MAP_PRIVATE |MAP_ANONYMOUS |MAP_HUGETLB ,-1 ,0 ); +if (map_ptr ==MAP_FAILED ) +ksft_exit_skip ("PROT_MTE not supported with MAP_HUGETLB mappings\n" ); +else +munmap (map_ptr, map_size); +/* Set test plan */ ksft_set_plan (12 );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1186/1191 kselftest/arm64: mte: Use the correct naming for tag check modes in check_hugetlb_options.c
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Catalin Marinas <[email protected]>
[ Upstream commit 7ae95109c64d64cdcf195788cf466ec0b3019a94 ]
The architecture doesn't define precise/imprecise MTE tag check modes, only synchronous and asynchronous. Use the correct naming and also ensure they match the MTE_{ASYNC,SYNC}_ERR type.
--- tools/testing/selftests/arm64/mte/check_hugetlb_options.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
tools/testing/selftests/arm64/mte/check_hugetlb_options.c +4 -4
@@ -283,13 +283,13 @@ int main(int argc, char *argv[]) "Check clear PROT_MTE flags with private mapping and sync error mode and mmap/mprotect memory\n");evaluate_test (check_child_hugetlb_memory_mapping (USE_MMAP ,MTE_SYNC_ERR ,MAP_PRIVATE |MAP_HUGETLB ), -"Check child hugetlb memory with private mapping, precise mode and mmap memory\n" ); +"Check child hugetlb memory with private mapping, sync error mode and mmap memory\n" );evaluate_test (check_child_hugetlb_memory_mapping (USE_MMAP ,MTE_ASYNC_ERR ,MAP_PRIVATE |MAP_HUGETLB ), -"Check child hugetlb memory with private mapping, precise mode and mmap memory\n" ); +"Check child hugetlb memory with private mapping, async error mode and mmap memory\n" );evaluate_test (check_child_hugetlb_memory_mapping (USE_MPROTECT ,MTE_SYNC_ERR ,MAP_PRIVATE |MAP_HUGETLB ), -"Check child hugetlb memory with private mapping, precise mode and mmap/mprotect memory\n" ); +"Check child hugetlb memory with private mapping, sync error mode and mmap/mprotect memory\n" );evaluate_test (check_child_hugetlb_memory_mapping (USE_MPROTECT ,MTE_ASYNC_ERR ,MAP_PRIVATE |MAP_HUGETLB ), -"Check child hugetlb memory with private mapping, precise mode and mmap/mprotect memory\n" ); +"Check child hugetlb memory with private mapping, async error mode and mmap/mprotect memory\n" );mte_restore_setup ();free_hugetlb ();
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1187/1191 tools/build: Use SYSTEM_BPFTOOL for system bpftool
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomas Glozar <[email protected]>
commit 814d051ebed40b27285ab3c5e2454bd01a0f9631 upstream.
The feature test for system bpftool uses BPFTOOL as the variable to set its path, defaulting to just "bpftool" if not set by the user.
This conflicts with selftests and a few other utilities, which expect BPFTOOL to be set to the in-tree bpftool path by default. For example, bpftool selftests fail to build:
$ make -C tools/testing/selftests/bpf/ make: Entering directory '/home/tglozar/dev/linux/tools/testing/selftests/bpf'
make: *** No rule to make target 'bpftool', needed by '/home/tglozar/dev/linux/tools/testing/selftests/bpf/tools/include/vmlinux.h'. Stop.
make: Leaving directory '/home/tglozar/dev/linux/tools/testing/selftests/bpf'
Fix the problem by renaming the variable used for system bpftool from BPFTOOL to SYSTEM_BPFTOOL, so that the new usage does not conflict with the existing one of BPFTOOL.
--- tools/build/feature/Makefile | 2 +- tools/scripts/Makefile.include | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
tools/build/feature/Makefile +1 -1
@@ -381,7 +381,7 @@ $(OUTPUT)test-libpfm4.bin: $(BUILD) -lpfm $(OUTPUT)test-bpftool-skeletons.bin: - $(BPFTOOL) version | grep '^features:.*skeletons' \ + $(SYSTEM_BPFTOOL) version | grep '^features:.*skeletons' \ > $(@:.bin=.make.output) 2>&1 ###############################
tools/scripts/Makefile.include +1 -1
@@ -95,7 +95,7 @@ endif CC_NO_CLANG := $(shell $(CC) -dM -E -x c /dev/null | grep -Fq "__clang__"; echo $$?) # Some tools require bpftool -BPFTOOL ?= bpftool +SYSTEM_BPFTOOL ?= bpftool ifeq ($(CC_NO_CLANG), 1) EXTRA_WARNINGS += -Wstrict-aliasing=3
Greg Kroah-Hartman
maintainerPATCH 1188/1191 pinctrl: mediatek: common-v1: Fix error checking in mtk_eint_init()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit 446d28584723e5d4bcdb18cf6ef87cb2bb597dd8 upstream.
The devm_kzalloc() function doesn't return error pointers, it returns NULL on error. Then on the next line it checks the same pointer again by mistake, "->base" instead of "->base[0]".
--- drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/pinctrl/mediatek/pinctrl-mtk-common.c +3 -3
@@ -1015,12 +1015,12 @@ static int mtk_eint_init(struct mtk_pinc pctl->eint->nbase =1 ;/* mtk-eint expects an array */ pctl->eint->base =devm_kzalloc (pctl->dev,sizeof (pctl->eint->base),GFP_KERNEL ); -if (IS_ERR (pctl->eint->base)) +if (!pctl->eint->base)return -ENOMEM ; pctl->eint->base[0 ] =devm_platform_ioremap_resource (pdev,0 ); -if (IS_ERR (pctl->eint->base)) -return PTR_ERR (pctl->eint->base); +if (IS_ERR (pctl->eint->base[0 ])) +return PTR_ERR (pctl->eint->base[0 ]); pctl->eint->irq =irq_of_parse_and_map (np,0 );if (!pctl->eint->irq)
Greg Kroah-Hartman
maintainerPATCH 1189/1191 net: hsr: must allocate more bytes for RedBox support
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
commit af8edaeddbc52e53207d859c912b017fd9a77629 upstream.
Blamed commit forgot to change hsr_init_skb() to allocate larger skb for RedBox case.
Indeed, send_hsr_supervision_frame() will add
two additional components (struct hsr_sup_tlv
and struct hsr_sup_payload)
syzbot reported the following crash:
skbuff: skb_over_panic: text:ffffffff8afd4b0a len:34 put:6 head:ffff88802ad29e00 data:ffff88802ad29f22 tail:0x144 end:0x140 dev:gretap0
------------[ cut here ]------------ kernel BUG at net/core/skbuff.c:206 ! Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN NOPTI CPU: 2 UID: 0 PID: 7611 Comm: syz-executor Not tainted 6.12.0-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 RIP: 0010:skb_panic+0x157/0x1d0 net/core/skbuff.c:206 Code: b6 04 01 84 c0 74 04 3c 03 7e 21 8b 4b 70 41 56 45 89 e8 48 c7 c7 a0 7d 9b 8c 41 57 56 48 89 ee 52 4c 89 e2 e8 9a 76 79 f8 90 <0f> 0b 4c 89 4c 24 10 48 89 54 24 08 48 89 34 24 e8 94 76 fb f8 4c RSP: 0018:ffffc90000858ab8 EFLAGS: 00010282 RAX: 0000000000000087 RBX: ffff8880598c08c0 RCX: ffffffff816d3e69 RDX: 0000000000000000 RSI: ffffffff816de786 RDI: 0000000000000005 RBP: ffffffff8c9b91c0 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000302 R11: ffffffff961cc1d0 R12: ffffffff8afd4b0a R13: 0000000000000006 R14: ffff88804b938130 R15: 0000000000000140 FS: 000055558a3d6500(0000) GS:ffff88806a800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f1295974ff8 CR3: 000000002ab6e000 CR4: 0000000000352ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <IRQ> skb_over_panic net/core/skbuff.c:211 [inline] skb_put+0x174/0x1b0 net/core/skbuff.c:2617 send_hsr_supervision_frame+0x6fa/0x9e0 net/hsr/hsr_device.c:342 hsr_proxy_announce+0x1a3/0x4a0 net/hsr/hsr_device.c:436 call_timer_fn+0x1a0/0x610 kernel/time/timer.c:1794 expire_timers kernel/time/timer.c:1845 [inline] __run_timers+0x6e8/0x930 kernel/time/timer.c:2419 __run_timer_base kernel/time/timer.c:2430 [inline] __run_timer_base kernel/time/timer.c:2423 [inline] run_timer_base+0x111/0x190 kernel/time/timer.c:2439 run_timer_softirq+0x1a/0x40 kernel/time/timer.c:2449 handle_softirqs+0x213/0x8f0 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu kernel/softirq.c:637 [inline] irq_exit_rcu+0xbb/0x120 kernel/softirq.c:649 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline] sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1049 </IRQ>
--- net/hsr/hsr_device.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)
net/hsr/hsr_device.c +13 -6
@@ -253,20 +253,22 @@ static const struct header_ops hsr_heade .parse = eth_header_parse, }; -static struct sk_buff *hsr_init_skb (struct hsr_port *master) +static struct sk_buff *hsr_init_skb (struct hsr_port *master,int extra) {struct hsr_priv *hsr = master->hsr;struct sk_buff *skb;int hlen, tlen; +int len; hlen =LL_RESERVED_SPACE (master->dev); tlen = master->dev->needed_tailroom; + len =sizeof (struct hsr_sup_tag ) +sizeof (struct hsr_sup_payload );/* skb size is same for PRP/HSR frames, only difference * being, for PRP it is a trailer and for HSR it is a -* header +* header. +* RedBox might use @extra more bytes. */ - skb =dev_alloc_skb (sizeof (struct hsr_sup_tag ) + -sizeof (struct hsr_sup_payload ) + hlen + tlen); + skb =dev_alloc_skb (len + extra + hlen + tlen);if (!skb)return skb;
@@ -301,6 +303,7 @@ static void send_hsr_supervision_frame(sstruct hsr_sup_tlv *hsr_stlv;struct hsr_sup_tag *hsr_stag;struct sk_buff *skb; +int extra =0 ; *interval =msecs_to_jiffies (HSR_LIFE_CHECK_INTERVAL );if (hsr->announce_count <3 && hsr->prot_version ==0 ) {
@@ -309,7 +312,11 @@ static void send_hsr_supervision_frame(s hsr->announce_count++; } - skb =hsr_init_skb (master); +if (hsr->redbox) + extra =sizeof (struct hsr_sup_tlv ) + +sizeof (struct hsr_sup_payload ); + + skb =hsr_init_skb (master, extra);if (!skb) {netdev_warn_once (master->dev,"HSR: Could not send supervision frame\n" );return ;
@@ -369,7 +376,7 @@ static void send_prp_supervision_frame(sstruct hsr_sup_tag *hsr_stag;struct sk_buff *skb; - skb =hsr_init_skb (master); + skb =hsr_init_skb (master,0 );if (!skb) {netdev_warn_once (master->dev,"PRP: Could not send supervision frame\n" );return ;
Greg Kroah-Hartman
maintainerPATCH 1190/1191 nvmet-rdma: fix queue leak when connect backlog is exceeded
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xixin Liu <[email protected]>
commit fb1ed67788e21832b614c23767a088c08cfdd2f2 upstream.
When pending disconnecting queues exceed the backlog limit, the connect path only drops the device reference and leaks the newly allocated queue and its IB resources.
--- drivers/nvme/target/rdma.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
drivers/nvme/target/rdma.c +7 -8
@@ -1628,19 +1628,13 @@ static int nvmet_rdma_queue_connect(strumutex_unlock (&nvmet_rdma_queue_mutex);if (pending >NVMET_RDMA_BACKLOG ) { ret =NVME_SC_CONNECT_CTRL_BUSY ; - goto put_device; + goto free_queue; } } ret =nvmet_rdma_cm_accept (cm_id, queue, &event->param.conn); -if (ret) { -/* -* Don't destroy the cm_id in free path, as we implicitly -* destroy the cm_id here with non-zero ret code. -*/ - queue->cm_id =NULL ; +if (ret) goto free_queue; - }mutex_lock (&nvmet_rdma_queue_mutex);list_add_tail (&queue->queue_list, &nvmet_rdma_queue_list);
@@ -1649,6 +1643,11 @@ static int nvmet_rdma_queue_connect(strureturn 0 ; free_queue: +/* +* Don't destroy the cm_id in free path, as we implicitly +* destroy the cm_id here with non-zero ret code. +*/ + queue->cm_id =NULL ;nvmet_rdma_free_queue (queue); put_device:kref_put (&ndev->ref, nvmet_rdma_free_dev);
Greg Kroah-Hartman
maintainerPATCH 1191/1191 Bluetooth: Devcoredump: Fix storing u32 without specifying byte order issue
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zijun Hu <[email protected]>
commit 0ab905c3be8c2be368821dd2bd1f8d126064d993 upstream.
API hci_devcd_init() stores its u32 type parameter @dump_size into skb, but it does not specify which byte order is used to store the integer, let us take little endian to store and parse the integer.
--- net/bluetooth/coredump.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
net/bluetooth/coredump.c +7 -6
@@ -5,6 +5,7 @@#include <linux/devcoredump.h> +#include <asm/unaligned.h> #include <net/bluetooth/bluetooth.h> #include <net/bluetooth/hci_core.h>
@@ -180,25 +181,25 @@ hdr_free:static void hci_devcd_handle_pkt_init (struct hci_dev *hdev,struct sk_buff *skb) { -u32 *dump_size; +u32 dump_size;if (hdev->dump.state !=HCI_DEVCOREDUMP_IDLE ) {DBG_UNEXPECTED_STATE ();return ; } -if (skb->len !=sizeof (*dump_size)) { +if (skb->len !=sizeof (dump_size)) {bt_dev_dbg (hdev,"Invalid dump init pkt" );return ; } - dump_size =skb_pull_data (skb,sizeof (*dump_size)); -if (!*dump_size) { + dump_size =get_unaligned_le32 (skb_pull_data (skb,4 )); +if (!dump_size) {bt_dev_err (hdev,"Zero size dump init pkt" );return ; } -if (hci_devcd_prepare (hdev, *dump_size)) { +if (hci_devcd_prepare (hdev, dump_size)) {bt_dev_err (hdev,"Failed to prepare for dump" );return ; }
@@ -441,7 +442,7 @@ int hci_devcd_init(struct hci_dev *hdev,return -ENOMEM ;hci_dmp_cb (skb)->pkt_type =HCI_DEVCOREDUMP_PKT_INIT ; -skb_put_data (skb, &dump_size,sizeof (dump_size)); +put_unaligned_le32 (dump_size,skb_put (skb,4 ));skb_queue_tail (&hdev->dump.dump_q, skb);queue_work (hdev->workqueue, &hdev->dump.dump_rx);
# Librecast Test Results
020/020 [ OK ] liblcrq
010/010 [ OK ] libmld
120/120 [ OK ] liblibrecast
CPU/kernel: Linux auntie 6.1.188-rc1-03320-g78c4b2009acf #1 SMP PREEMPT_DYNAMIC Sat Sep 12 17:38:56 -00 2026 x86_64 AMD Ryzen 9 9950X 16-Core Processor AuthenticAMD GNU/Linux
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.188 release. There are 1191 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon, 14 Sep 2026 06:54:17 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.188-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
Tested on an amd64 laptop (Lenovo ThinkPad T14 Gen 1). Working well, no regressions observed.
Signature · 1 line
-Barry K. Nathan <[email protected]>
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.188 release. There are 1191 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon, 14 Sep 2026 06:54:17 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 10 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.188-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
The build fails with:
sound/soc/fsl/fsl_audmix.c:461:12: warning: 'fsl_audmix_runtime_resume' used but never defined 461 | static int fsl_audmix_runtime_resume(struct device *dev);
| ^~~~~~~~~~~~~~~~~~~~~~~~~sound/soc/fsl/fsl_audmix.c:462:12: warning: 'fsl_audmix_runtime_suspend' used but never defined 462 | static int fsl_audmix_runtime_suspend(struct device *dev);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
ERROR: modpost: "fsl_audmix_runtime_suspend" [sound/soc/fsl/snd-soc-fsl-audmix.ko] undefined!
ERROR: modpost: "fsl_audmix_runtime_resume" [sound/soc/fsl/snd-soc-fsl-audmix.ko] undefined! make[1]: *** [scripts/Makefile.modpost:127: Module.symvers] Error 1
make: *** [Makefile:1977: modpost] Error 2
This is due to commit "ASoC: fsl_audmix: rework runtime PM handling in probe" commit id d8f18d3367a252b194e2eed54ef785f7fff479da and I have CONFIG_PM=n in my config.
Sasha Levin
maintainerQuoted 2 lines
ERROR: modpost: "
fsl_audmix_runtime_suspend" [sound/soc/fsl/snd-soc-fsl-audmix.ko] undefined!
ERROR: modpost: "fsl_audmix_runtime_resume" [sound/soc/fsl/snd-soc-fsl-audmix.ko] undefined!
Dropped from the 6.1 queue. Same CONFIG_PM=n build break also hit the 5.15 and 6.6 queues, both dropped as well.
Thanks for the report.
Signature · 2 lines
Thanks, Sasha
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.188 release. There are 1191 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
6.1.188-rc1 fails to build for us: the tools/perf host build breaks
| util/hisi-ptt-decoder/hisi-ptt-pkt-decoder.c:14:10: fatal error: linux/unaligned.h: No such file or directory | 14 | #include <linux/unaligned.h> | compilation terminated. ... | util/hisi-ptt-decoder/hisi-ptt-pkt-decoder.h:13:10: fatal error: linux/bitfield.h: No such file or directory | 13 | #include <linux/bitfield.h> | compilation terminated.
make[4]: *** [.../tools/build/Makefile.build:96: .../util/hisi-ptt.o] Error 1 make[4]: *** [.../tools/build/Makefile.build:143: hisi-ptt-decoder] Error 2
ERROR: perf-1.0-r9 do_compile: oe_runmake failed
[PATCH 6.1 0302/1191] perf hisi-ptt: Fix PTT trace TLP header parsing (upstream commit 2b8a2e5d4240 "perf hisi-ptt: Fix PTT trace TLP header parsing")
I would drop this patch.
Francesco
Sasha Levin
maintainerQuoted 3 lines
6.1.188-rc1 fails to build for us: the
tools/perfhost build breaks|
util/hisi-ptt-decoder/hisi-ptt-pkt-decoder.c:14:10: fatal error:linux/unaligned.h: No such file or directory
Dropped from the 6.1 queue. Also dropped from 6.6 for the same reason (tools/include/linux/unaligned.h is missing there too).
Additionally dropped from 6.12, even though you didn't report it there:unaligned.h and bitfield.h do exist on 6.12, but GENMASK_U32/BIT_U32 are absent from tools/include/linux/bits.h on that branch, and this commit's decoding logic needs them, so the build breaks there as well.
Quoted 1 line
I would drop this patch.
Thanks for the report.
Signature · 2 lines
Thanks, Sasha
Am 12.09.2026 um 08:45 schrieb Greg Kroah-Hartman:
Quoted 4 lines
This is the start of the stable review cycle for the 6.1.188 release. There are 1191 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Builds, boots and works on my 2-socket Ivy Bridge Xeon E5-2697v2 server. No dmesg oddities or regressions found.
Beste Grüße,
Peter Schneider
Signature · 8 lines
Climb the mountain not to plant your flag, but to embrace the challenge, enjoy the air and behold the view. Climb it so you can see the world, not so the world can see you. -- David McCullough Jr. OpenPGP: 0xA3828BD796CCE11A8CADE8866E3A92C92C3FF244 Download: https://www.peters-netzplatz.de/download/pschneider1968_pub.asc https://keys.mailvelope.com/pks/lookup?op=get&[email protected] https://keys.mailvelope.com/pks/lookup?op=get&[email protected]
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.188 release. There are 1191 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon, 14 Sep 2026 06:54:17 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.188-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
Quoted 8 lines · On Sat, 12 Sep 2026 08:45:28 +0200 Greg Kroah-Hartman…
This is the start of the stable review cycle for the 6.1.188 release. There are 1191 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon, 14 Sep 2026 06:54:17 +0000. Anything received after that time might be too late.
Boot-tested under QEMU for Rust x86_64:
Thanks!
Cheers,
Miguel
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.188 release. There are 1191 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon, 14 Sep 2026 06:54:17 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.188-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
perf fails to build on arm/arm64/bmips with:
CC
/local/users/fainelli/buildroot/output/arm/build/linux-custom/tools/perf/util/zlib.o util/hisi-ptt-decoder/hisi-ptt-pkt-decoder.c:14:10: fatal error: linux/unaligned.h: No such file or directory
14 | #include <linux/unaligned.h>
| ^~~~~~~~~~~~~~~~~~~
compilation terminated.
CC
/local/users/fainelli/buildroot/output/arm/build/linux-custom/tools/perf/util/lzma.o
make[7]: *** [/local/users/fainelli/buildroot/output/arm/build/linux-custom/tools/build/Makefile.build:97: /local/users/fainelli/buildroot/output/arm/build/linux-custom/tools/perf/util/hisi-ptt-decoder/hisi-ptt-pkt-decoder.o] Error 1
CC
/local/users/fainelli/buildroot/output/arm/build/linux-custom/tools/perf/util/cap.o
CC
/local/users/fainelli/buildroot/output/arm/build/linux-custom/tools/perf/util/demangle-ocaml.o
make[6]: *** [/local/users/fainelli/buildroot/output/arm/build/linux-custom/tools/build/Makefile.build:143: hisi-ptt-decoder] Error 2
make[6]: *** Waiting for unfinished jobs....
In file included from util/hisi-ptt.c:24:util/hisi-ptt-decoder/hisi-ptt-pkt-decoder.h:13:10: fatal error: linux/bitfield.h: No such file or directory
13 | #include <linux/bitfield.h>
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
this is due to 6c4b82b50c46842683a3a39e1bc8291581e8b1cb ("perf hisi-ptt: Fix PTT trace TLP header parsing")
Signature · 1 line
Florian
Sasha Levin
maintainerQuoted 5 lines
perf fails to build on arm/arm64/bmips with:
util/hisi-ptt-decoder/hisi-ptt-pkt-decoder.c:14:10: fatal error:linux/unaligned.h: No such file or directory
14 | #include <linux/unaligned.h>
Thanks for the report, and sorry for the late answer. 2b8a2e5d424f ("perf
hisi-ptt: Fix PTT trace TLP header parsing") was dropped from the 6.1, 6.6 and 6.12 queues before those releases went out, so 6.1.188, 6.6.157 and 6.12.110 do not carry it. That covers the identical reports you sent on the 6.6 and 6.12 threads too.
Signature · 2 lines
Thanks, Sasha