5.10.247-rc1 review
Subsystems (5)
Greg Kroah-Hartman
maintainerPATCH 161/300 net: dsa: b53: fix enabling ip multicast
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jonas Gorski <[email protected]>
[ Upstream commit c264294624e956a967a9e2e5fa41e3273340b089 ]
In the New Control register bit 1 is either reserved, or has a different function:
Out of Range Error Discard
When enabled, the ingress port discards any frames if the Length field is between 1500 and 1536 (excluding 1500 and 1536) and with good CRC.
The actual bit for enabling IP multicast is bit 0, which was only explicitly enabled for BCM5325 so far.
For older switch chips, this bit defaults to 0, so we want to enable it as well, while newer switch chips default to 1, and their documentation says "It is illegal to set this bit to zero."
So drop the wrong B53_IPMC_FWD_EN define, enable the IP multicast bit also for other switch chips. While at it, rename it to (B53_)IP_MC as that is how it is called in Broadcom code.
--- drivers/net/dsa/b53/b53_common.c | 4 ++-- drivers/net/dsa/b53/b53_regs.h | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-)
drivers/net/dsa/b53/b53_common.c +2 -2
@@ -349,11 +349,11 @@ static void b53_set_forwarding(struct b53_device *dev, int enable)* frames should be flooded or not. */ b53_read8 (dev,B53_CTRL_PAGE ,B53_IP_MULTICAST_CTRL , &mgmt); - mgmt |=B53_UC_FWD_EN |B53_MC_FWD_EN |B53_IPMC_FWD_EN ; + mgmt |=B53_UC_FWD_EN |B53_MC_FWD_EN |B53_IP_MC ;b53_write8 (dev,B53_CTRL_PAGE ,B53_IP_MULTICAST_CTRL , mgmt); }else {b53_read8 (dev,B53_CTRL_PAGE ,B53_IP_MULTICAST_CTRL , &mgmt); - mgmt |=B53_IP_MCAST_25 ; + mgmt |=B53_IP_MC ;b53_write8 (dev,B53_CTRL_PAGE ,B53_IP_MULTICAST_CTRL , mgmt); } }
drivers/net/dsa/b53/b53_regs.h +1 -2
@@ -104,8 +104,7 @@/* IP Multicast control (8 bit) */ #define B53_IP_MULTICAST_CTRL 0x21 -#define B53_IP_MCAST_25 BIT(0) -#define B53_IPMC_FWD_EN BIT(1) +#define B53_IP_MC BIT(0)#define B53_UC_FWD_EN BIT(6)#define B53_MC_FWD_EN BIT(7)
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 162/300 net: dsa: b53: stop reading ARL entries if search is done
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jonas Gorski <[email protected]>
[ Upstream commit 0be04b5fa62a82a9929ca261f6c9f64a3d0a28da ]
The switch clears the ARL_SRCH_STDN bit when the search is done, i.e. it finished traversing the ARL table.
This means that there will be no valid result, so we should not attempt to read and process any further entries.
We only ever check the validity of the entries for 4 ARL bin chips, and only after having passed the first entry to the b53_fdb_copy().
This means that we always pass an invalid entry at the end to the b53_fdb_copy(). b53_fdb_copy() does check the validity though before passing on the entry, so it never gets passed on.
On < 4 ARL bin chips, we will even continue reading invalid entries until we reach the result limit.
--- drivers/net/dsa/b53/b53_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/dsa/b53/b53_common.c +1 -1
@@ -1731,7 +1731,7 @@ static int b53_arl_search_wait(struct b53_device *dev) do { b53_read8(dev, B53_ARLIO_PAGE, B53_ARL_SRCH_CTL, ®); if (!(reg & ARL_SRCH_STDN)) - return 0; + return -ENOENT; if (reg & ARL_SRCH_VLID) return 0;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 163/300 sctp: Hold RCU read lock while iterating over address list
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Wiehler <[email protected]>
[ Upstream commit 38f50242bf0f237cdc262308d624d333286ec3c5 ]
With CONFIG_PROVE_RCU_LIST=y and by executing
$ netcat -l --sctp & $ netcat --sctp localhost & $ ss --sctp
one can trigger the following Lockdep-RCU splat(s):
WARNING: suspicious RCU usage 6.18.0-rc1-00093-g7f864458e9a6 #5 Not tainted
-----------------------------
net/sctp/diag.c:76 RCU-list traversed in non-reader section!!
other info that might help us debug this:
rcu_scheduler_active = 2, debug_locks = 1
2 locks held by ss/215:
#0: ffff9c740828bec0 (nlk_cb_mutex-SOCK_DIAG){+.+.}-{4:4}, at: __netlink_dump_start+0x84/0x2b0 #1: ffff9c7401d72cd0 (sk_lock-AF_INET6){+.+.}-{0:0}, at: sctp_sock_dump+0x38/0x200
stack backtrace: CPU: 0 UID: 0 PID: 215 Comm: ss Not tainted 6.18.0-rc1-00093-g7f864458e9a6 #5 PREEMPT(voluntary) Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 04/01/2014 Call Trace: <TASK> dump_stack_lvl+0x5d/0x90 lockdep_rcu_suspicious.cold+0x4e/0xa3 inet_sctp_diag_fill.isra.0+0x4b1/0x5d0 sctp_sock_dump+0x131/0x200 sctp_transport_traverse_process+0x170/0x1b0 ? __pfx_sctp_sock_filter+0x10/0x10 ? __pfx_sctp_sock_dump+0x10/0x10 sctp_diag_dump+0x103/0x140 __inet_diag_dump+0x70/0xb0 netlink_dump+0x148/0x490 __netlink_dump_start+0x1f3/0x2b0 inet_diag_handler_cmd+0xcd/0x100 ? __pfx_inet_diag_dump_start+0x10/0x10 ? __pfx_inet_diag_dump+0x10/0x10 ? __pfx_inet_diag_dump_done+0x10/0x10 sock_diag_rcv_msg+0x18e/0x320 ? __pfx_sock_diag_rcv_msg+0x10/0x10 netlink_rcv_skb+0x4d/0x100 netlink_unicast+0x1d7/0x2b0 netlink_sendmsg+0x203/0x450 ____sys_sendmsg+0x30c/0x340 ___sys_sendmsg+0x94/0xf0 __sys_sendmsg+0x83/0xf0 do_syscall_64+0xbb/0x390 entry_SYSCALL_64_after_hwframe+0x77/0x7f ... </TASK>
--- net/sctp/diag.c | 4 ++++ 1 file changed, 4 insertions(+)
net/sctp/diag.c +4 -0
@@ -73,19 +73,23 @@ static int inet_diag_msg_sctpladdrs_fill(struct sk_buff *skb,struct nlattr *attr;void *info =NULL ; +rcu_read_lock ();list_for_each_entry_rcu (laddr, address_list, list) addrcnt++; +rcu_read_unlock (); attr =nla_reserve (skb,INET_DIAG_LOCALS , addrlen * addrcnt);if (!attr)return -EMSGSIZE ; info =nla_data (attr); +rcu_read_lock ();list_for_each_entry_rcu (laddr, address_list, list) {memcpy (info, &laddr->a,sizeof (laddr->a));memset (info +sizeof (laddr->a),0 , addrlen -sizeof (laddr->a)); info += addrlen; } +rcu_read_unlock ();return 0 ; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 164/300 sctp: Prevent TOCTOU out-of-bounds write
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Wiehler <[email protected]>
[ Upstream commit 95aef86ab231f047bb8085c70666059b58f53c09 ]
For the following path not holding the sock lock,
sctp_diag_dump() -> sctp_for_each_endpoint() -> sctp_ep_dump()
make sure not to exceed bounds in case the address list has grown between buffer allocation (time-of-check) and write (time-of-use).
--- net/sctp/diag.c | 3 +++ 1 file changed, 3 insertions(+)
net/sctp/diag.c +3 -0
@@ -88,6 +88,9 @@ static int inet_diag_msg_sctpladdrs_fill(struct sk_buff *skb,memcpy (info, &laddr->a,sizeof (laddr->a));memset (info +sizeof (laddr->a),0 , addrlen -sizeof (laddr->a)); info += addrlen; + +if (!--addrcnt) +break ; }rcu_read_unlock ();
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 165/300 net: sctp: Fix some typos
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lu Wei <[email protected]>
[ Upstream commit 21c00a186fac6e035eef5e6751f1e2d2609f969c ]
Modify "unkown" to "unknown" in net/sctp/sm_make_chunk.c and Modify "orginal" to "original" in net/sctp/socket.c.
Stable-dep-of: f1fc201148c7 ("sctp: Hold sock lock while iterating over address list")
--- net/sctp/sm_make_chunk.c | 2 +- net/sctp/socket.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
net/sctp/sm_make_chunk.c +1 -1
@@ -3206,7 +3206,7 @@ bool sctp_verify_asconf(const struct sctp_association *asoc,return false;break ;default : -/* This is unkown to us, reject! */ +/* This is unknown to us, reject! */ return false; } }
net/sctp/socket.c +1 -1
@@ -9266,7 +9266,7 @@ void sctp_copy_sock(struct sock *newsk, struct sock *sk,if (newsk->sk_flags &SK_FLAGS_TIMESTAMP )net_enable_timestamp (); -/* Set newsk security attributes from orginal sk and connection +/* Set newsk security attributes from original sk and connection * security attribute from ep. */ security_sctp_sk_clone (ep, sk, newsk);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 166/300 net: Use nlmsg_unicast() instead of netlink_unicast()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yajun Deng <[email protected]>
[ Upstream commit 01757f536ac825e3614d583fee9acb48c64ed084 ]
It has 'if (err >0 )' statement in nlmsg_unicast(), so use nlmsg_unicast() instead of netlink_unicast(), this looks more concise.
v2: remove the change in netfilter.
Stable-dep-of: f1fc201148c7 ("sctp: Hold sock lock while iterating over address list")
--- net/ipv4/fib_frontend.c | 2 +- net/ipv4/inet_diag.c | 5 +---- net/ipv4/raw_diag.c | 7 ++----- net/ipv4/udp_diag.c | 6 ++---- net/mptcp/mptcp_diag.c | 6 ++---- net/netlink/af_netlink.c | 2 +- net/sctp/diag.c | 6 ++---- net/unix/diag.c | 6 ++---- 8 files changed, 13 insertions(+), 27 deletions(-)
net/ipv4/fib_frontend.c +1 -1
@@ -1400,7 +1400,7 @@ static void nl_fib_input(struct sk_buff *skb) portid =NETLINK_CB (skb).portid;/* netlink portid */ NETLINK_CB (skb).portid =0 ;/* from kernel */ NETLINK_CB (skb).dst_group =0 ;/* unicast */ -netlink_unicast (net->ipv4.fibnl, skb, portid,MSG_DONTWAIT ); +nlmsg_unicast (net->ipv4.fibnl, skb, portid); }static int __net_init nl_fib_lookup_init (struct net *net)
net/ipv4/inet_diag.c +1 -4
@@ -572,10 +572,7 @@ int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo,nlmsg_free (rep); goto out; } - err =netlink_unicast (net->diag_nlsk, rep,NETLINK_CB (in_skb).portid, -MSG_DONTWAIT ); -if (err >0 ) - err =0 ; + err =nlmsg_unicast (net->diag_nlsk, rep,NETLINK_CB (in_skb).portid); out:if (sk)
net/ipv4/raw_diag.c +2 -5
@@ -119,11 +119,8 @@ static int raw_diag_dump_one(struct netlink_callback *cb,return err; } - err =netlink_unicast (net->diag_nlsk, rep, -NETLINK_CB (in_skb).portid, -MSG_DONTWAIT ); -if (err >0 ) - err =0 ; + err =nlmsg_unicast (net->diag_nlsk, rep,NETLINK_CB (in_skb).portid); +return err; }
net/ipv4/udp_diag.c +2 -4
@@ -77,10 +77,8 @@ static int udp_dump_one(struct udp_table *tbl,kfree_skb (rep); goto out; } - err =netlink_unicast (net->diag_nlsk, rep,NETLINK_CB (in_skb).portid, -MSG_DONTWAIT ); -if (err >0 ) - err =0 ; + err =nlmsg_unicast (net->diag_nlsk, rep,NETLINK_CB (in_skb).portid); + out:if (sk)sock_put (sk);
net/mptcp/mptcp_diag.c +2 -4
@@ -57,10 +57,8 @@ static int mptcp_diag_dump_one(struct netlink_callback *cb,kfree_skb (rep); goto out; } - err =netlink_unicast (net->diag_nlsk, rep,NETLINK_CB (in_skb).portid, -MSG_DONTWAIT ); -if (err >0 ) - err =0 ; + err =nlmsg_unicast (net->diag_nlsk, rep,NETLINK_CB (in_skb).portid); + out:sock_put (sk);
net/netlink/af_netlink.c +1 -1
@@ -2470,7 +2470,7 @@ void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err,nlmsg_end (skb, rep); -netlink_unicast (in_skb->sk, skb,NETLINK_CB (in_skb).portid,MSG_DONTWAIT ); +nlmsg_unicast (in_skb->sk, skb,NETLINK_CB (in_skb).portid); }EXPORT_SYMBOL (netlink_ack);
net/sctp/diag.c +2 -4
@@ -288,10 +288,8 @@ static int sctp_tsp_dump_one(struct sctp_transport *tsp, void *p) goto out; } - err =netlink_unicast (net->diag_nlsk, rep,NETLINK_CB (in_skb).portid, -MSG_DONTWAIT ); -if (err >0 ) - err =0 ; + err =nlmsg_unicast (net->diag_nlsk, rep,NETLINK_CB (in_skb).portid); + out:return err; }
net/unix/diag.c +2 -4
@@ -299,10 +299,8 @@ static int unix_diag_get_exact(struct sk_buff *in_skb, goto again; } - err =netlink_unicast (net->diag_nlsk, rep,NETLINK_CB (in_skb).portid, -MSG_DONTWAIT ); -if (err >0 ) - err =0 ; + err =nlmsg_unicast (net->diag_nlsk, rep,NETLINK_CB (in_skb).portid); + out:if (sk)sock_put (sk);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 167/300 sctp: hold endpoint before calling cb in sctp_transport_lookup_process
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xin Long <[email protected]>
[ Upstream commit f9d31c4cf4c11ff10317f038b9c6f7c3bda6cdd4 ]
The same fix in commit 5ec7d18d1813 ("sctp: use call_rcu to free endpoint") is also needed for dumping one asoc and sock after the lookup.
Stable-dep-of: f1fc201148c7 ("sctp: Hold sock lock while iterating over address list")
--- include/net/sctp/sctp.h | 3 +-- net/sctp/diag.c | 46 +++++++++++++++++++---------------------- net/sctp/socket.c | 22 +++++++++++++------- 3 files changed, 37 insertions(+), 34 deletions(-)
include/net/sctp/sctp.h +1 -2
@@ -110,8 +110,7 @@ struct sctp_transport *sctp_transport_get_next(struct net *net, struct rhashtable_iter *iter);struct sctp_transport *sctp_transport_get_idx (struct net *net,struct rhashtable_iter *iter,int pos); -int sctp_transport_lookup_process (int (*cb)(struct sctp_transport *,void *), -struct net *net, +int sctp_transport_lookup_process (sctp_callback_t cb,struct net *net,const union sctp_addr *laddr,const union sctp_addr *paddr,void *p); int sctp_transport_traverse_process(sctp_callback_t cb, sctp_callback_t cb_done,
net/sctp/diag.c +21 -25
91 lines not on this page · raw message
net/sctp/socket.c +15 -7
@@ -5212,23 +5212,31 @@ int sctp_for_each_endpoint(int (*cb)(struct sctp_endpoint *, void *), }EXPORT_SYMBOL_GPL (sctp_for_each_endpoint); -int sctp_transport_lookup_process (int (*cb)(struct sctp_transport *,void *), -struct net *net, +int sctp_transport_lookup_process (sctp_callback_t cb,struct net *net,const union sctp_addr *laddr,const union sctp_addr *paddr,void *p) {struct sctp_transport *transport; -int err; +struct sctp_endpoint *ep; +int err = -ENOENT ;rcu_read_lock (); transport =sctp_addrs_lookup_transport (net, laddr, paddr); +if (!transport) { +rcu_read_unlock (); +return err; + } + ep = transport->asoc->ep; +if (!sctp_endpoint_hold (ep)) {/* asoc can be peeled off */ +sctp_transport_put (transport); +rcu_read_unlock (); +return err; + }rcu_read_unlock (); -if (!transport) -return -ENOENT ; - err =cb (transport, p); + err =cb (ep, transport, p); +sctp_endpoint_put (ep);sctp_transport_put (transport); -return err; }EXPORT_SYMBOL_GPL (sctp_transport_lookup_process);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 168/300 sctp: Hold sock lock while iterating over address list
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Wiehler <[email protected]>
[ Upstream commit f1fc201148c7e684c10a72b6a3375597f28d1ef6 ]
Move address list traversal in inet_assoc_attr_size() under the sock lock to avoid holding the RCU read lock.
--- net/sctp/diag.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
net/sctp/diag.c +9 -5
@@ -230,14 +230,15 @@ struct sctp_comm_param {bool net_admin; }; -static size_t inet_assoc_attr_size (struct sctp_association *asoc) +static size_t inet_assoc_attr_size (struct sock *sk, +struct sctp_association *asoc) {int addrlen =sizeof (struct sockaddr_storage );int addrcnt =0 ;struct sctp_sockaddr_entry *laddr;list_for_each_entry_rcu (laddr, &asoc->base.bind_addr.address_list, - list) + list,lockdep_sock_is_held (sk)) addrcnt++;return nla_total_size (sizeof (struct sctp_info ))
@@ -263,11 +264,14 @@ static int sctp_sock_dump_one(struct sctp_endpoint *ep, struct sctp_transport *tif (err)return err; - rep =nlmsg_new (inet_assoc_attr_size (assoc),GFP_KERNEL ); -if (!rep) +lock_sock (sk); + + rep =nlmsg_new (inet_assoc_attr_size (sk, assoc),GFP_KERNEL ); +if (!rep) { +release_sock (sk);return -ENOMEM ; + } -lock_sock (sk);if (ep != assoc->ep) { err = -EAGAIN ; goto out;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 169/300 net: usb: qmi_wwan: initialize MAC header offset in qmimux_rx_fixup
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qendrim Maxhuni <[email protected]>
[ Upstream commit e120f46768d98151ece8756ebd688b0e43dc8b29 ]
Raw IP packets have no MAC header, leaving skb->mac_header uninitialized. This can trigger kernel panics on ARM64 when xfrm or other subsystems access the offset due to strict alignment checks.
Initialize the MAC header to prevent such crashes.
This can trigger kernel panics on ARM when running IPsec over the qmimux0 interface.
Example trace:
Internal error: Oops: 000000009600004f [#1] SMP
CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Not tainted 6.12.34-gbe78e49cb433 #1
Hardware name: LS1028A RDB Board (DT)
pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : xfrm_input+0xde8/0x1318
lr : xfrm_input+0x61c/0x1318
sp : ffff800080003b20
Call trace:
xfrm_input+0xde8/0x1318
xfrm6_rcv+0x38/0x44
xfrm6_esp_rcv+0x48/0xa8
ip6_protocol_deliver_rcu+0x94/0x4b0
ip6_input_finish+0x44/0x70
ip6_input+0x44/0xc0
ipv6_rcv+0x6c/0x114
__netif_receive_skb_one_core+0x5c/0x8c
__netif_receive_skb+0x18/0x60
process_backlog+0x78/0x17c
__napi_poll+0x38/0x180
net_rx_action+0x168/0x2f0--- drivers/net/usb/qmi_wwan.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/usb/qmi_wwan.c +6 -0
@@ -207,6 +207,12 @@ static int qmimux_rx_fixup(struct usbnet *dev, struct sk_buff *skb)return 0 ; skbn->dev = net; +/* Raw IP packets don't have a MAC header, but other subsystems +* (like xfrm) may still access MAC header offsets, so they must +* be initialized. +*/ +skb_reset_mac_header (skbn); +switch (skb->data[offset + qmimux_hdr_sz] &0xf0 ) {case 0x40 : skbn->protocol =htons (ETH_P_IP );
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 170/300 tracing: Fix memory leaks in create_field_var()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zilin Guan <[email protected]>
[ Upstream commit 80f0d631dcc76ee1b7755bfca1d8417d91d71414 ]
The function create_field_var() allocates memory for 'val' through create_hist_field() inside parse_atom(), and for 'var' through create_var(), which in turn allocates var->type and var->var.name internally. Simply calling kfree() to release these structures will result in memory leaks.
Use destroy_hist_field() to properly free 'val', and explicitly release the memory of var->type and var->var.name before freeing 'var' itself.
--- kernel/trace/trace_events_hist.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
kernel/trace/trace_events_hist.c +4 -2
@@ -2729,14 +2729,16 @@ static struct field_var *create_field_var(struct hist_trigger_data *hist_data, var =create_var (hist_data, file, field_name, val->size, val->type);if (IS_ERR (var)) {hist_err (tr,HIST_ERR_VAR_CREATE_FIND_FAIL ,errpos (field_name)); -kfree (val); +destroy_hist_field (val,0 ); ret =PTR_ERR (var); goto err; } field_var =kzalloc (sizeof (struct field_var ),GFP_KERNEL );if (!field_var) { -kfree (val); +destroy_hist_field (val,0 ); +kfree_const (var->type); +kfree (var->var.name);kfree (var); ret = -ENOMEM ; goto err;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 171/300 lib/crypto: curve25519-hacl64: Fix older clang KASAN workaround for GCC
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nathan Chancellor <[email protected]>
commit 2b81082ad37cc3f28355fb73a6a69b91ff7dbf20 upstream.
Commit 2f13daee2a72 ("lib/crypto/curve25519-hacl64: Disable KASAN with clang-17 and older") inadvertently disabled KASAN in curve25519-hacl64.o for GCC unconditionally because clang-min-version will always evaluate to nothing for GCC. Add a check for CONFIG_CC_IS_CLANG to avoid applying the workaround for GCC, which is only needed for clang-17 and older.
--- lib/crypto/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/crypto/Makefile +1 -1
@@ -23,7 +23,7 @@ libcurve25519-generic-y := curve25519 libcurve25519-generic-$(CONFIG_ARCH_SUPPORTS_INT128) := curve25519-hacl64.o libcurve25519-generic-y += curve25519-generic.o # clang versions prior to 18 may blow out the stack with KASAN -ifeq ($(call clang-min-version, 180000),) +ifeq ($(CONFIG_CC_IS_CLANG)_$(call clang-min-version, 180000),y_) KASAN_SANITIZE_curve25519-hacl64.o := n endif
Greg Kroah-Hartman
maintainerPATCH 172/300 extcon: adc-jack: Cleanup wakeup source only if it was enabled
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
commit 92bac7d4de9c07933f6b76d8f1c7f8240f911f4f upstream.
Driver in the probe enables wakeup source conditionally, so the cleanup path should do the same - do not release the wakeup source memory if it was not allocated.
--- drivers/extcon/extcon-adc-jack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/extcon/extcon-adc-jack.c +2 -1
@@ -162,7 +162,8 @@ static int adc_jack_remove(struct platfo {struct adc_jack_data *data =platform_get_drvdata (pdev); -device_init_wakeup (&pdev->dev, false); +if (data->wakeup_source) +device_init_wakeup (&pdev->dev, false);free_irq (data->irq, data);cancel_work_sync (&data->handler.work);
Greg Kroah-Hartman
maintainerPATCH 173/300 compiler_types: Move unused static inline functions warning to W=2
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <[email protected]>
[ Upstream commit 9818af18db4bfefd320d0fef41390a616365e6f7 ]
Per Nathan, clang catches unused "static inline" functions in C files since commit 6863f5643dd7 ("kbuild: allow Clang to find unused static inline functions for W=1 build").
Quoted 8 lines · Linus
So I entirely ignore W=1 issues, because I think so many of the extra warnings are bogus.
But if this one in particular is causing more problems than most - some teams do seem to use W=1 as part of their test builds - it's fine to send me a patch that just moves bad warnings to W=2.
And if anybody uses W=2 for their test builds, that's THEIR problem..
Here is the change to bump the warning from W=1 to W=2.
--- include/linux/compiler_types.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
include/linux/compiler_types.h +2 -3
@@ -158,10 +158,9 @@ struct ftrace_likely_data {/* * GCC does not warn about unused static inline functions for -Wunused-function. * Suppress the warning in clang as well by using __maybe_unused, but enable it -* for W=1 build. This will allow clang to find unused functions. Remove the -* __inline_maybe_unused entirely after fixing most of -Wunused-function warnings. +* for W=2 build. This will allow clang to find unused functions. */ -#ifdef KBUILD_EXTRA_WARN1 +#ifdef KBUILD_EXTRA_WARN2 #define __inline_maybe_unused#else #define __inline_maybe_unused __maybe_unused
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 174/300 RISC-V: clear hot-unplugged cores from all task mm_cpumasks to avoid rfence errors
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Danil Skrebenkov <[email protected]>
[ Upstream commit ae9e9f3d67dcef7582a4524047b01e33c5185ddb ]
openSBI v1.7 adds harts checks for ipi operations. Especially it adds comparison between hmask passed as an argument from linux and mask of online harts (from openSBI side). If they don't fit each other the error occurs.
When cpu is offline, cpu_online_mask is explicitly cleared in __cpu_disable. However, there is no explicit clearing of mm_cpumask. mm_cpumask is used for rfence operations that call openSBI RFENCE extension which uses ipi to remote harts. If hart is offline there may be error if mask of linux is not as mask of online harts in openSBI.
this patch adds explicit clearing of mm_cpumask for offline hart.
--- arch/riscv/kernel/cpu-hotplug.c | 1 + 1 file changed, 1 insertion(+)
arch/riscv/kernel/cpu-hotplug.c +1 -0
@@ -65,6 +65,7 @@ void __cpu_die(unsigned int cpu) }pr_notice ("CPU%u: off\n" , cpu); +clear_tasks_mm_cpumask (cpu);/* Verify from the firmware if the cpu is really stopped*/ if (cpu_ops[cpu]->cpu_is_stopped) ret = cpu_ops[cpu]->cpu_is_stopped (cpu);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 175/300 NFS4: Fix state renewals missing after boot
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joshua Watt <[email protected]>
[ Upstream commit 9bb3baa9d1604cd20f49ae7dac9306b4037a0e7a ]
Since the last renewal time was initialized to 0 and jiffies start counting at -5 minutes, any clients connected in the first 5 minutes after a reboot would have their renewal timer set to a very long interval. If the connection was idle, this would result in the client state timing out on the server and the next call to the server would return NFS4ERR_BADSESSION.
Fix this by initializing the last renewal time to the current jiffies instead of 0.
--- fs/nfs/nfs4client.c | 1 + 1 file changed, 1 insertion(+)
fs/nfs/nfs4client.c +1 -0
@@ -221,6 +221,7 @@ struct nfs_client *nfs4_alloc_client(const struct nfs_client_initdata *cl_init) clp->cl_state =1 <<NFS4CLNT_LEASE_EXPIRED ; clp->cl_mvops = nfs_v4_minor_ops[cl_init->minorversion]; clp->cl_mig_gen =1 ; + clp->cl_last_renewal = jiffies;#if IS_ENABLED (CONFIG_NFS_V4_1 )init_waitqueue_head (&clp->cl_lock_waitq);#endif
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 176/300 HID: quirks: avoid Cooler Master MM712 dongle wakeup bug
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tristan Lobb <[email protected]>
[ Upstream commit 0be4253bf878d9aaa2b96031ac8683fceeb81480 ]
The Cooler Master Mice Dongle includes a vendor defined HID interface alongside its mouse interface. Not polling it will cause the mouse to stop responding to polls on any interface once woken up again after going into power saving mode.
Add the HID_QUIRK_ALWAYS_POLL quirk alongside the Cooler Master VID and the Dongle's PID.
--- drivers/hid/hid-ids.h | 3 +++ drivers/hid/hid-quirks.c | 1 + 2 files changed, 4 insertions(+)
drivers/hid/hid-ids.h +3 -0
@@ -298,6 +298,9 @@#define USB_DEVICE_ID_CODEMERCS_IOW_FIRST 0x1500#define USB_DEVICE_ID_CODEMERCS_IOW_LAST 0x15ff +#define USB_VENDOR_ID_COOLER_MASTER 0x2516 +#define USB_DEVICE_ID_COOLER_MASTER_MICE_DONGLE 0x01b7 +#define USB_VENDOR_ID_CORSAIR 0x1b1c#define USB_DEVICE_ID_CORSAIR_K90 0x1b02
drivers/hid/hid-quirks.c +1 -0
@@ -57,6 +57,7 @@ static const struct hid_device_id hid_quirks[] = { { HID_USB_DEVICE(USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_FLIGHT_SIM_YOKE), HID_QUIRK_NOGET }, { HID_USB_DEVICE(USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_PRO_PEDALS), HID_QUIRK_NOGET }, { HID_USB_DEVICE(USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_PRO_THROTTLE), HID_QUIRK_NOGET }, + { HID_USB_DEVICE(USB_VENDOR_ID_COOLER_MASTER, USB_DEVICE_ID_COOLER_MASTER_MICE_DONGLE), HID_QUIRK_ALWAYS_POLL }, { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K65RGB), HID_QUIRK_NO_INIT_REPORTS }, { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K65RGB_RAPIDFIRE), HID_QUIRK_NO_INIT_REPORTS | HID_QUIRK_ALWAYS_POLL }, { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K70RGB), HID_QUIRK_NO_INIT_REPORTS },
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 177/300 ASoC: max98090/91: fixed max98091 ALSA widget powering up/down
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sharique Mohammad <[email protected]>
[ Upstream commit 7a37291ed40a33a5f6c3d370fdde5ee0d8f7d0e4 ]
The widgets DMIC3_ENA and DMIC4_ENA must be defined in the DAPM suppy widget, just like DMICL_ENA and DMICR_ENA. Whenever they are turned on or off, the required startup or shutdown sequences must be taken care by the max98090_shdn_event.
--- sound/soc/codecs/max98090.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
sound/soc/codecs/max98090.c +4 -2
@@ -1233,9 +1233,11 @@ static const struct snd_soc_dapm_widget max98091_dapm_widgets[] = {SND_SOC_DAPM_INPUT ("DMIC4" ),SND_SOC_DAPM_SUPPLY ("DMIC3_ENA" ,M98090_REG_DIGITAL_MIC_ENABLE , -M98090_DIGMIC3_SHIFT ,0 ,NULL ,0 ), +M98090_DIGMIC3_SHIFT ,0 , max98090_shdn_event, +SND_SOC_DAPM_POST_PMU ),SND_SOC_DAPM_SUPPLY ("DMIC4_ENA" ,M98090_REG_DIGITAL_MIC_ENABLE , - M98090_DIGMIC4_SHIFT, 0, NULL, 0), +M98090_DIGMIC4_SHIFT ,0 , max98090_shdn_event, + SND_SOC_DAPM_POST_PMU), }; static const struct snd_soc_dapm_route max98090_dapm_routes[] = {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 178/300 net: fec: correct rx_bytes statistic for the case SHIFT16 is set
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Fang <[email protected]>
[ Upstream commit ad17e7e92a7c52ce70bb764813fcf99464f96903 ]
Two additional bytes in front of each frame received into the RX FIFO if SHIFT16 is set, so we need to subtract the extra two bytes from pkt_len to correct the statistic of rx_bytes.
--- drivers/net/ethernet/freescale/fec_main.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/freescale/fec_main.c +2 -0
@@ -1525,6 +1525,8 @@ fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id) ndev->stats.rx_packets++; pkt_len =fec16_to_cpu (bdp->cbd_datlen); ndev->stats.rx_bytes += pkt_len; +if (fep->quirks &FEC_QUIRK_HAS_RACC ) + ndev->stats.rx_bytes -=2 ; index =fec_enet_get_bd_index (bdp, &rxq->bd); skb = rxq->rx_skbuff[index];
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 179/300 Bluetooth: btusb: reorder cleanup in btusb_disconnect to avoid UAF
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Raphael Pinsonneault-Thibeault <[email protected]>
[ Upstream commit 23d22f2f71768034d6ef86168213843fc49bf550 ]
There is a KASAN: slab-use-after-free read in btusb_disconnect(). Calling "usb_driver_release_interface(&btusb_driver, data->intf)" will free the btusb data associated with the interface. The same data is then used later in the function, hence the UAF.
Fix by moving the accesses to btusb data to before the data is free'd.
--- drivers/bluetooth/btusb.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/bluetooth/btusb.c +6 -7
@@ -4391,6 +4391,11 @@ static void btusb_disconnect(struct usb_interface *intf)hci_unregister_dev (hdev); +if (data->oob_wake_irq) +device_init_wakeup (&data->udev->dev, false); +if (data->reset_gpio) +gpiod_put (data->reset_gpio); +if (intf == data->intf) {if (data->isoc)usb_driver_release_interface (&btusb_driver, data->isoc);
@@ -4401,17 +4406,11 @@ static void btusb_disconnect(struct usb_interface *intf)usb_driver_release_interface (&btusb_driver, data->diag);usb_driver_release_interface (&btusb_driver, data->intf); }else if (intf == data->diag) { -usb_driver_release_interface (&btusb_driver, data->intf);if (data->isoc)usb_driver_release_interface (&btusb_driver, data->isoc); +usb_driver_release_interface (&btusb_driver, data->intf); } -if (data->oob_wake_irq) -device_init_wakeup (&data->udev->dev, false); - -if (data->reset_gpio) -gpiod_put (data->reset_gpio); -hci_free_dev (hdev); }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 180/300 Bluetooth: 6lowpan: reset link-local header on ipv6 recv path
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pauli Virtanen <[email protected]>
[ Upstream commit 3b78f50918276ab28fb22eac9aa49401ac436a3b ]
Bluetooth 6lowpan.c netdev has header_ops, so it must set link-local header for RX skb, otherwise things crash, eg. with AF_PACKET SOCK_RAW
Add missing skb_reset_mac_header() for uncompressed ipv6 RX path.
For the compressed one, it is done in lowpan_header_decompress().
Log: (BlueZ 6lowpan-tester Client Recv Raw - Success)
------
kernel BUG at net/core/skbuff.c:212!
Call Trace: <IRQ> ... packet_rcv (net/packet/af_packet.c:2152) ... <TASK>
__local_bh_enable_ip (kernel/softirq.c:407)netif_rx (net/core/dev.c:5648)chan_recv_cb (net/bluetooth/6lowpan.c:294 net/bluetooth/6lowpan.c:359)
------
--- net/bluetooth/6lowpan.c | 1 + 1 file changed, 1 insertion(+)
net/bluetooth/6lowpan.c +1 -0
@@ -317,6 +317,7 @@ static int recv_pkt(struct sk_buff *skb, struct net_device *dev, local_skb->pkt_type =PACKET_HOST ; local_skb->dev = dev; +skb_reset_mac_header (local_skb);skb_set_transport_header (local_skb,sizeof (struct ipv6hdr ));if (give_skb_to_upper (local_skb, dev) !=NET_RX_SUCCESS ) {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 181/300 Bluetooth: 6lowpan: fix BDADDR_LE vs ADDR_LE_DEV address type confusion
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pauli Virtanen <[email protected]>
[ Upstream commit b454505bf57a2e4f5d49951d4deb03730a9348d9 ]
Bluetooth 6lowpan.c confuses BDADDR_LE and ADDR_LE_DEV address types, e.g. debugfs "connect" command takes the former, and "disconnect" and "connect" to already connected device take the latter. This is due to using same value both for l2cap_chan_connect and hci_conn_hash_lookup_le which take different dst_type values.
Fix address type passed to hci_conn_hash_lookup_le().
Retain the debugfs API difference between "connect" and "disconnect" commands since it's been like this since 2015 and nobody apparently complained.
--- net/bluetooth/6lowpan.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-)
net/bluetooth/6lowpan.c +24 -4
@@ -994,10 +994,11 @@ static struct l2cap_chan *bt_6lowpan_listen(void) }static int get_l2cap_conn (char *buf,bdaddr_t *addr,u8 *addr_type, -struct l2cap_conn **conn) +struct l2cap_conn **conn,bool disconnect) {struct hci_conn *hcon;struct hci_dev *hdev; +int le_addr_type;int n; n = sscanf(buf, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx %hhu",
@@ -1008,13 +1009,32 @@ static int get_l2cap_conn(char *buf, bdaddr_t *addr, u8 *addr_type,if (n <7 )return -EINVAL ; +if (disconnect) { +/* The "disconnect" debugfs command has used different address +* type constants than "connect" since 2015. Let's retain that +* for now even though it's obviously buggy... +*/ + *addr_type +=1 ; + } + +switch (*addr_type) { +case BDADDR_LE_PUBLIC : + le_addr_type =ADDR_LE_DEV_PUBLIC ; +break ; +case BDADDR_LE_RANDOM : + le_addr_type =ADDR_LE_DEV_RANDOM ; +break ; +default : +return -EINVAL ; + } +/* The LE_PUBLIC address type is ignored because of BDADDR_ANY */ hdev =hci_get_route (addr,BDADDR_ANY ,BDADDR_LE_PUBLIC );if (!hdev)return -ENOENT ;hci_dev_lock (hdev); - hcon =hci_conn_hash_lookup_le (hdev, addr, *addr_type); + hcon =hci_conn_hash_lookup_le (hdev, addr, le_addr_type);hci_dev_unlock (hdev);hci_dev_put (hdev);
@@ -1141,7 +1161,7 @@ static ssize_t lowpan_control_write(struct file *fp, buf[buf_size] ='\0' ;if (memcmp (buf,"connect " ,8 ) ==0 ) { - ret =get_l2cap_conn (&buf[8 ], &addr, &addr_type, &conn); + ret =get_l2cap_conn (&buf[8 ], &addr, &addr_type, &conn, false);if (ret == -EINVAL )return ret;
@@ -1178,7 +1198,7 @@ static ssize_t lowpan_control_write(struct file *fp, }if (memcmp (buf,"disconnect " ,11 ) ==0 ) { - ret =get_l2cap_conn (&buf[11 ], &addr, &addr_type, &conn); + ret =get_l2cap_conn (&buf[11 ], &addr, &addr_type, &conn, true);if (ret <0 )return ret;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 182/300 Bluetooth: 6lowpan: Dont hold spin lock over sleeping functions
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pauli Virtanen <[email protected]>
[ Upstream commit 98454bc812f3611551e4b1f81732da4aa7b9597e ]
disconnect_all_peers() calls sleeping function (l2cap_chan_close) under spinlock. Holding the lock doesn't actually do any good -- we work on a local copy of the list, and the lock doesn't protect against peer->chan having already been freed.
Fix by taking refcounts of peer->chan instead. Clean up the code and old comments a bit.
Take devices_lock instead of RCU, because the kfree_rcu(); l2cap_chan_put(); construct in chan_close_cb() does not guarantee peer->chan is necessarily valid in RCU.
Also take l2cap_chan_lock() which is required for l2cap_chan_close().
Log: (bluez 6lowpan-tester Client Connect - Disable)
------
BUG: sleeping function called from invalid context at kernel/locking/mutex.c:575 ... <TASK>
...l2cap_send_disconn_req (net/bluetooth/l2cap_core.c:938 net/bluetooth/l2cap_core.c:1495)
...
? __pfx_l2cap_chan_close (net/bluetooth/l2cap_core.c:809)do_enable_set (net/bluetooth/6lowpan.c:1048 net/bluetooth/6lowpan.c:1068)
------
--- net/bluetooth/6lowpan.c | 68 ++++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 25 deletions(-)
net/bluetooth/6lowpan.c +43 -25
@@ -52,6 +52,11 @@ static bool enable_6lowpan;static struct l2cap_chan *listen_chan;static DEFINE_MUTEX (set_lock); +enum { +LOWPAN_PEER_CLOSING , +LOWPAN_PEER_MAXBITS +}; +struct lowpan_peer {struct list_head list;struct rcu_head rcu;
@@ -60,6 +65,8 @@ struct lowpan_peer {/* peer addresses in various formats */ unsigned char lladdr[ETH_ALEN ];struct in6_addr peer_addr; + +DECLARE_BITMAP (flags,LOWPAN_PEER_MAXBITS ); };struct lowpan_btle_dev {
@@ -1051,41 +1058,52 @@ static int get_l2cap_conn(char *buf, bdaddr_t *addr, u8 *addr_type,static void disconnect_all_peers (void ) {struct lowpan_btle_dev *entry; -struct lowpan_peer *peer, *tmp_peer, *new_peer; -struct list_head peers; - -INIT_LIST_HEAD (&peers); +struct lowpan_peer *peer; +int nchans; -/* We make a separate list of peers as the close_cb() will -* modify the device peers list so it is better not to mess -* with the same list at the same time. +/* l2cap_chan_close() cannot be called from RCU, and lock ordering +* chan->lock > devices_lock prevents taking write side lock, so copy +* then close. */ rcu_read_lock (); +list_for_each_entry_rcu (entry, &bt_6lowpan_devices, list) +list_for_each_entry_rcu (peer, &entry->peers, list) +clear_bit (LOWPAN_PEER_CLOSING , peer->flags); +rcu_read_unlock (); -list_for_each_entry_rcu (entry, &bt_6lowpan_devices, list) { -list_for_each_entry_rcu (peer, &entry->peers, list) { - new_peer =kmalloc (sizeof (*new_peer),GFP_ATOMIC ); -if (!new_peer) -break ; +do { +struct l2cap_chan *chans[32 ]; +int i; - new_peer->chan = peer->chan; -INIT_LIST_HEAD (&new_peer->list); + nchans =0 ; -list_add (&new_peer->list, &peers); - } - } +spin_lock (&devices_lock); -rcu_read_unlock (); +list_for_each_entry_rcu (entry, &bt_6lowpan_devices, list) { +list_for_each_entry_rcu (peer, &entry->peers, list) { +if (test_and_set_bit (LOWPAN_PEER_CLOSING , + peer->flags)) +continue ; -spin_lock (&devices_lock); -list_for_each_entry_safe (peer, tmp_peer, &peers, list) { -l2cap_chan_close (peer->chan,ENOENT ); +l2cap_chan_hold (peer->chan); + chans[nchans++] = peer->chan; -list_del_rcu (&peer->list); -kfree_rcu (peer, rcu); - } -spin_unlock (&devices_lock); +if (nchans >=ARRAY_SIZE (chans)) + goto done; + } + } + +done: +spin_unlock (&devices_lock); + +for (i =0 ; i < nchans; ++i) { +l2cap_chan_lock (chans[i]); +l2cap_chan_close (chans[i],ENOENT ); +l2cap_chan_unlock (chans[i]); +l2cap_chan_put (chans[i]); + } + }while (nchans); }struct set_enable {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 183/300 sctp: prevent possible shift-out-of-bounds in sctp_transport_update_rto
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 1534ff77757e44bcc4b98d0196bc5c0052fce5fa ]
syzbot reported a possible shift-out-of-bounds [1]
Blamed commit added rto_alpha_max and rto_beta_max set to 1000.
It is unclear if some sctp users are setting very large rto_alpha and/or rto_beta.
In order to prevent user regression, perform the test at run time.
Also add READ_ONCE() annotations as sysctl values can change under us.
[1]
UBSAN: shift-out-of-bounds in net/sctp/transport.c:509:41 shift exponent 64 is too large for 32-bit type 'unsigned int' CPU: 0 UID: 0 PID: 16704 Comm: syz.2.2320 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025 Call Trace: <TASK> __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x16c/0x1f0 lib/dump_stack.c:120 ubsan_epilogue lib/ubsan.c:233 [inline] __ubsan_handle_shift_out_of_bounds+0x27f/0x420 lib/ubsan.c:494 sctp_transport_update_rto.cold+0x1c/0x34b net/sctp/transport.c:509 sctp_check_transmitted+0x11c4/0x1c30 net/sctp/outqueue.c:1502 sctp_outq_sack+0x4ef/0x1b20 net/sctp/outqueue.c:1338 sctp_cmd_process_sack net/sctp/sm_sideeffect.c:840 [inline] sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1372 [inline]
--- net/sctp/transport.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
net/sctp/transport.c +9 -4
@@ -337,6 +337,7 @@ void sctp_transport_update_rto(struct sctp_transport *tp, __u32 rtt)if (tp->rttvar || tp->srtt) {struct net *net = tp->asoc->base.net; +unsigned int rto_beta, rto_alpha;/* 6.3.1 C3) When a new RTT measurement R' is made, set * RTTVAR <- (1 - RTO.Beta) * RTTVAR + RTO.Beta * |SRTT - R'| * SRTT <- (1 - RTO.Alpha) * SRTT + RTO.Alpha * R'
@@ -348,10 +349,14 @@ void sctp_transport_update_rto(struct sctp_transport *tp, __u32 rtt)* For example, assuming the default value of RTO.Alpha of * 1/8, rto_alpha would be expressed as 3. */ - tp->rttvar = tp->rttvar - (tp->rttvar >> net->sctp.rto_beta) - + (((__u32 )abs ((__s64 )tp->srtt - (__s64 )rtt)) >> net->sctp.rto_beta); - tp->srtt = tp->srtt - (tp->srtt >> net->sctp.rto_alpha) - + (rtt >> net->sctp.rto_alpha); + rto_beta =READ_ONCE (net->sctp.rto_beta); +if (rto_beta <32 ) + tp->rttvar = tp->rttvar - (tp->rttvar >> rto_beta) + + (((__u32 )abs ((__s64 )tp->srtt - (__s64 )rtt)) >> rto_beta); + rto_alpha =READ_ONCE (net->sctp.rto_alpha); +if (rto_alpha <32 ) + tp->srtt = tp->srtt - (tp->srtt >> rto_alpha) + + (rtt >> rto_alpha); }else {/* 6.3.1 C2) When the first RTT measurement R is made, set * SRTT <- R, RTTVAR <- R/2.
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 184/300 net/smc: fix mismatch between CLC header and proposal
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: D. Wythe <[email protected]>
[ Upstream commit ec33f2e5a2d0dbbfd71435209aee812fdc9369b8 ]
The current CLC proposal message construction uses a mix of ini->smc_type_v1/v2 and pclc_base->hdr.typev1/v2 to decide whether to include optional extensions (IPv6 prefix extension for v1, and v2 extension). This leads to a critical inconsistency: when smc_clc_prfx_set() fails - for example, in IPv6-only environments with only link-local addresses, or when the local IP address and the outgoing interface’s network address are not in the same subnet.
As a result, the proposal message is assembled using the stale ini->smc_type_v1 value—causing the IPv6 prefix extension to be included even though the header indicates v1 is not supported. The peer then receives a malformed CLC proposal where the header type does not match the payload, and immediately resets the connection.
The fix ensures consistency between the CLC header flags and the actual payload by synchronizing ini->smc_type_v1 with pclc_base->hdr.typev1 when prefix setup fails.
--- net/smc/smc_clc.c | 1 + 1 file changed, 1 insertion(+)
net/smc/smc_clc.c +1 -0
@@ -529,6 +529,7 @@ int smc_clc_send_proposal(struct smc_sock *smc, struct smc_init_info *ini)return SMC_CLC_DECL_CNFERR ; } pclc_base->hdr.typev1 =SMC_TYPE_N ; + ini->smc_type_v1 =SMC_TYPE_N ; }else { pclc_base->iparea_offset =htons (sizeof (*pclc_smcd)); plen += sizeof(*pclc_prfx) +
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 185/300 tipc: Fix use-after-free in tipc_mon_reinit_self().
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuniyuki Iwashima <[email protected]>
[ Upstream commit 0725e6afb55128be21a2ca36e9674f573ccec173 ]
syzbot reported use-after-free of tipc_net(net)->monitors[] in tipc_mon_reinit_self(). [0]
The array is protected by RTNL, but tipc_mon_reinit_self() iterates over it without RTNL.
tipc_mon_reinit_self() is called from tipc_net_finalize(), which is always under RTNL except for tipc_net_finalize_work().
Let's hold RTNL in tipc_net_finalize_work().
[0]:
BUG: KASAN: slab-use-after-free in __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
BUG: KASAN: slab-use-after-free in _raw_spin_lock_irqsave+0xa7/0xf0 kernel/locking/spinlock.c:162
Read of size 1 at addr ffff88805eae1030 by task kworker/0:7/5989
CPU: 0 UID: 0 PID: 5989 Comm: kworker/0:7 Not tainted syzkaller #0 PREEMPT_{RT,(full)}
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
Workqueue: events tipc_net_finalize_work
Call Trace:
<TASK>
dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0xca/0x240 mm/kasan/report.c:482
kasan_report+0x118/0x150 mm/kasan/report.c:595
__kasan_check_byte+0x2a/0x40 mm/kasan/common.c:568
kasan_check_byte include/linux/kasan.h:399 [inline]
lock_acquire+0x8d/0x360 kernel/locking/lockdep.c:5842
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xa7/0xf0 kernel/locking/spinlock.c:162
rtlock_slowlock kernel/locking/rtmutex.c:1894 [inline]
rwbase_rtmutex_lock_state kernel/locking/spinlock_rt.c:160 [inline]
rwbase_write_lock+0xd3/0x7e0 kernel/locking/rwbase_rt.c:244
rt_write_lock+0x76/0x110 kernel/locking/spinlock_rt.c:243
write_lock_bh include/linux/rwlock_rt.h:99 [inline]
tipc_mon_reinit_self+0x79/0x430 net/tipc/monitor.c:718
tipc_net_finalize+0x115/0x190 net/tipc/net.c:140
process_one_work kernel/workqueue.c:3236 [inline]
process_scheduled_works+0xade/0x17b0 kernel/workqueue.c:3319
worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400
kthread+0x70e/0x8a0 kernel/kthread.c:463
ret_from_fork+0x439/0x7d0 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
</TASK>
Allocated by task 6089:
kasan_save_stack mm/kasan/common.c:47 [inline]
kasan_save_track+0x3e/0x80 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:388 [inline]
__kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:405
kasan_kmalloc include/linux/kasan.h:260 [inline]
__kmalloc_cache_noprof+0x1a8/0x320 mm/slub.c:4407
kmalloc_noprof include/linux/slab.h:905 [inline]
kzalloc_noprof include/linux/slab.h:1039 [inline]
tipc_mon_create+0xc3/0x4d0 net/tipc/monitor.c:657
tipc_enable_bearer net/tipc/bearer.c:357 [inline]
__tipc_nl_bearer_enable+0xe16/0x13f0 net/tipc/bearer.c:1047
__tipc_nl_compat_doit net/tipc/netlink_compat.c:371 [inline]
tipc_nl_compat_doit+0x3bc/0x5f0 net/tipc/netlink_compat.c:393
tipc_nl_compat_handle net/tipc/netlink_compat.c:-1 [inline]
tipc_nl_compat_recv+0x83c/0xbe0 net/tipc/netlink_compat.c:1321
genl_family_rcv_msg_doit+0x215/0x300 net/netlink/genetlink.c:1115
genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline]
genl_rcv_msg+0x60e/0x790 net/netlink/genetlink.c:1210
netlink_rcv_skb+0x208/0x470 net/netlink/af_netlink.c:2552
genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219
netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline]
netlink_unicast+0x846/0xa10 net/netlink/af_netlink.c:1346
netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1896
sock_sendmsg_nosec net/socket.c:714 [inline]
__sock_sendmsg+0x21c/0x270 net/socket.c:729
____sys_sendmsg+0x508/0x820 net/socket.c:2614
___sys_sendmsg+0x21f/0x2a0 net/socket.c:2668
__sys_sendmsg net/socket.c:2700 [inline]
__do_sys_sendmsg net/socket.c:2705 [inline]
__se_sys_sendmsg net/socket.c:2703 [inline]
__x64_sys_sendmsg+0x1a1/0x260 net/socket.c:2703
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Freed by task 6088:
kasan_save_stack mm/kasan/common.c:47 [inline]
kasan_save_track+0x3e/0x80 mm/kasan/common.c:68
kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:576
poison_slab_object mm/kasan/common.c:243 [inline]
__kasan_slab_free+0x5b/0x80 mm/kasan/common.c:275
kasan_slab_free include/linux/kasan.h:233 [inline]
slab_free_hook mm/slub.c:2422 [inline]
slab_free mm/slub.c:4695 [inline]
kfree+0x195/0x550 mm/slub.c:4894
tipc_l2_device_event+0x380/0x650 net/tipc/bearer.c:-1
notifier_call_chain+0x1b3/0x3e0 kernel/notifier.c:85
call_netdevice_notifiers_extack net/core/dev.c:2267 [inline]
call_netdevice_notifiers net/core/dev.c:2281 [inline]
unregister_netdevice_many_notify+0x14d7/0x1fe0 net/core/dev.c:12166
unregister_netdevice_many net/core/dev.c:12229 [inline]
unregister_netdevice_queue+0x33c/0x380 net/core/dev.c:12073
unregister_netdevice include/linux/netdevice.h:3385 [inline]
__tun_detach+0xe4d/0x1620 drivers/net/tun.c:621
tun_detach drivers/net/tun.c:637 [inline]
tun_chr_close+0x10d/0x1c0 drivers/net/tun.c:3433
__fput+0x458/0xa80 fs/file_table.c:468
task_work_run+0x1d4/0x260 kernel/task_work.c:227
resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
exit_to_user_mode_loop+0xec/0x110 kernel/entry/common.c:43
exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline]
syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline]
do_syscall_64+0x2bd/0x3b0 arch/x86/entry/syscall_64.c:100
entry_SYSCALL_64_after_hwframe+0x77/0x7f--- net/tipc/net.c | 2 ++ 1 file changed, 2 insertions(+)
net/tipc/net.c +2 -0
@@ -141,7 +141,9 @@ void tipc_net_finalize_work(struct work_struct *work) { struct tipc_net *tn = container_of(work, struct tipc_net, work); +rtnl_lock ();tipc_net_finalize (tipc_link_net (tn->bcl), tn->trial_addr); +rtnl_unlock (); }void tipc_net_stop (struct net *net)
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 186/300 net: mdio: fix resource leak in mdiobus_register_device()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Buday Csaba <[email protected]>
[ Upstream commit e6ca8f533ed41129fcf052297718f417f021cc7d ]
Fix a possible leak in mdiobus_register_device() when both a reset-gpio and a reset-controller are present.
Clean up the already claimed reset-gpio, when the registration of the reset-controller fails, so when an error code is returned, the device retains its state before the registration attempt.
--- drivers/net/phy/mdio_bus.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/phy/mdio_bus.c +4 -1
@@ -80,8 +80,11 @@ int mdiobus_register_device(struct mdio_device *mdiodev)return err; err =mdiobus_register_reset (mdiodev); -if (err) +if (err) { +gpiod_put (mdiodev->reset_gpio); + mdiodev->reset_gpio =NULL ;return err; + }/* Assert the reset signal */ mdio_device_reset (mdiodev,1 );
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 187/300 wifi: mac80211: skip rate verification for not captured PSDUs
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Berg <[email protected]>
[ Upstream commit 7fe0d21f5633af8c3fab9f0ef0706c6156623484 ]
If for example the sniffer did not follow any AIDs in an MU frame, then some of the information may not be filled in or is even expected to be invalid. As an example, in that case it is expected that Nss is zero.
--- net/mac80211/rx.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
net/mac80211/rx.c +7 -3
@@ -4779,10 +4779,14 @@ void ieee80211_rx_list(struct ieee80211_hw *hw, struct ieee80211_sta *pubsta,if (WARN_ON (!local->started)) goto drop; -if (likely (!(status->flag &RX_FLAG_FAILED_PLCP_CRC ))) { +if (likely (!(status->flag &RX_FLAG_FAILED_PLCP_CRC ) && + !(status->flag &RX_FLAG_NO_PSDU && + status->zero_length_psdu_type == +IEEE80211_RADIOTAP_ZERO_LEN_PSDU_NOT_CAPTURED ))) {/* -* Validate the rate, unless a PLCP error means that -* we probably can't have a valid rate here anyway. +* Validate the rate, unless there was a PLCP error which may +* have an invalid rate or the PSDU was not capture and may be +* missing rate information. */ switch (status->encoding) {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 188/300 net: sched: act_ife: initialize struct tc_ife to fix KMSAN kernel-infoleak
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ranganath V N <[email protected]>
[ Upstream commit ce50039be49eea9b4cd8873ca6eccded1b4a130a ]
Fix a KMSAN kernel-infoleak detected by the syzbot .
[net?] KMSAN: kernel-infoleak in __skb_datagram_iter
In tcf_ife_dump(), the variable 'opt' was partially initialized using a designatied initializer. While the padding bytes are reamined uninitialized. nla_put() copies the entire structure into a netlink message, these uninitialized bytes leaked to userspace.
Initialize the structure with memset before assigning its fields to ensure all members and padding are cleared prior to beign copied.
This change silences the KMSAN report and prevents potential information leaks from the kernel memory.
This fix has been tested and validated by syzbot. This patch closes the bug reported at the following syzkaller link and ensures no infoleak.
--- net/sched/act_ife.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
net/sched/act_ife.c +7 -5
@@ -643,13 +643,15 @@ static int tcf_ife_dump(struct sk_buff *skb, struct tc_action *a, int bind,unsigned char *b =skb_tail_pointer (skb);struct tcf_ife_info *ife =to_ife (a);struct tcf_ife_params *p; -struct tc_ife opt = { - .index = ife->tcf_index, - .refcnt =refcount_read (&ife->tcf_refcnt) - ref, - .bindcnt =atomic_read (&ife->tcf_bindcnt) - bind, - }; +struct tc_ife opt;struct tcf_t t; +memset (&opt,0 ,sizeof (opt)); + + opt.index = ife->tcf_index, + opt.refcnt =refcount_read (&ife->tcf_refcnt) - ref, + opt.bindcnt =atomic_read (&ife->tcf_bindcnt) - bind, +spin_lock_bh (&ife->tcf_lock); opt.action = ife->tcf_action; p = rcu_dereference_protected(ife->params,
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 189/300 net/mlx5e: Fix maxrate wraparound in threshold between units
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gal Pressman <[email protected]>
[ Upstream commit a7bf4d5063c7837096aab2853224eb23628514d9 ]
The previous calculation used roundup() which caused an overflow for rates between 25.5Gbps and 26Gbps.
For example, a rate of 25.6Gbps would result in using 100Mbps units with value of 256, which would overflow the 8 bits field.
Simplify the upper_limit_mbps calculation by removing the unnecessary roundup, and adjust the comparison to use <= to correctly handle the boundary condition.
--- drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c +3 -2
@@ -587,18 +587,19 @@ static int mlx5e_dcbnl_ieee_setmaxrate(struct net_device *netdev,struct mlx5_core_dev *mdev = priv->mdev;u8 max_bw_value[IEEE_8021QAZ_MAX_TCS ];u8 max_bw_unit[IEEE_8021QAZ_MAX_TCS ]; -__u64 upper_limit_mbps =roundup (255 *MLX5E_100MB ,MLX5E_1GB ); +__u64 upper_limit_mbps;int i;memset (max_bw_value,0 ,sizeof (max_bw_value));memset (max_bw_unit,0 ,sizeof (max_bw_unit)); + upper_limit_mbps =255 *MLX5E_100MB ;for (i =0 ; i <=mlx5_max_tc (mdev); i++) {if (!maxrate->tc_maxrate[i]) { max_bw_unit[i] =MLX5_BW_NO_LIMIT ;continue ; } -if (maxrate->tc_maxrate[i] < upper_limit_mbps) { +if (maxrate->tc_maxrate[i] <= upper_limit_mbps) { max_bw_value[i] =div_u64 (maxrate->tc_maxrate[i],MLX5E_100MB ); max_bw_value[i] = max_bw_value[i] ? max_bw_value[i] :1 ;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 190/300 net/mlx5e: Fix wraparound in rate limiting for values above 255 Gbps
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gal Pressman <[email protected]>
[ Upstream commit 43b27d1bd88a4bce34ec2437d103acfae9655f9e ]
Add validation to reject rates exceeding 255 Gbps that would overflow the 8 bits max bandwidth field.
--- drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c +9 -1
@@ -588,11 +588,13 @@ static int mlx5e_dcbnl_ieee_setmaxrate(struct net_device *netdev,u8 max_bw_value[IEEE_8021QAZ_MAX_TCS ];u8 max_bw_unit[IEEE_8021QAZ_MAX_TCS ];__u64 upper_limit_mbps; +__u64 upper_limit_gbps;int i;memset (max_bw_value,0 ,sizeof (max_bw_value));memset (max_bw_unit,0 ,sizeof (max_bw_unit)); upper_limit_mbps =255 *MLX5E_100MB ; + upper_limit_gbps =255 *MLX5E_1GB ;for (i =0 ; i <=mlx5_max_tc (mdev); i++) {if (!maxrate->tc_maxrate[i]) {
@@ -604,10 +606,16 @@ static int mlx5e_dcbnl_ieee_setmaxrate(struct net_device *netdev, MLX5E_100MB); max_bw_value[i] = max_bw_value[i] ? max_bw_value[i] :1 ; max_bw_unit[i] =MLX5_100_MBPS_UNIT ; - }else { + }else if (max_bw_value[i] <= upper_limit_gbps) { max_bw_value[i] =div_u64 (maxrate->tc_maxrate[i],MLX5E_1GB ); max_bw_unit[i] =MLX5_GBPS_UNIT ; + }else { +netdev_err (netdev, +"tc_%d maxrate %llu Kbps exceeds limit %llu\n" , + i, maxrate->tc_maxrate[i], + upper_limit_gbps); +return -EINVAL ; } }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 191/300 net_sched: limit try_bulk_dequeue_skb() batches
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 0345552a653ce5542affeb69ac5aa52177a5199b ]
After commit 100dfa74cad9 ("inet: dev_queue_xmit() llist adoption") I started seeing many qdisc requeues on IDPF under high TX workload.
$ tc -s qd sh dev eth1 handle 1: ; sleep 1; tc -s qd sh dev eth1 handle 1: qdisc mq 1: root Sent 43534617319319 bytes 268186451819 pkt (dropped 0, overlimits 0 requeues 3532840114) backlog 1056Kb 6675p requeues 3532840114 qdisc mq 1: root Sent 43554665866695 bytes 268309964788 pkt (dropped 0, overlimits 0 requeues 3537737653) backlog 781164b 4822p requeues 3537737653
This is caused by try_bulk_dequeue_skb() being only limited by BQL budget.
perf record -C120-239 -e qdisc:qdisc_dequeue sleep 1 ; perf script
...
netperf 75332 [146] 2711.138269: qdisc:qdisc_dequeue: dequeue ifindex=5 qdisc handle=0x80150000 parent=0x10013 txq_state=0x0 packets=1292 skbaddr=0xff378005a1e9f200 netperf 75332 [146] 2711.138953: qdisc:qdisc_dequeue: dequeue ifindex=5 qdisc handle=0x80150000 parent=0x10013 txq_state=0x0 packets=1213 skbaddr=0xff378004d607a500 netperf 75330 [144] 2711.139631: qdisc:qdisc_dequeue: dequeue ifindex=5 qdisc handle=0x80150000 parent=0x10013 txq_state=0x0 packets=1233 skbaddr=0xff3780046be20100 netperf 75333 [147] 2711.140356: qdisc:qdisc_dequeue: dequeue ifindex=5 qdisc handle=0x80150000 parent=0x10013 txq_state=0x0 packets=1093 skbaddr=0xff37800514845b00 netperf 75337 [151] 2711.141037: qdisc:qdisc_dequeue: dequeue ifindex=5 qdisc handle=0x80150000 parent=0x10013 txq_state=0x0 packets=1353 skbaddr=0xff37800460753300 netperf 75337 [151] 2711.141877: qdisc:qdisc_dequeue: dequeue ifindex=5 qdisc handle=0x80150000 parent=0x10013 txq_state=0x0 packets=1367 skbaddr=0xff378004e72c7b00 netperf 75330 [144] 2711.142643: qdisc:qdisc_dequeue: dequeue ifindex=5 qdisc handle=0x80150000 parent=0x10013 txq_state=0x0 packets=1202 skbaddr=0xff3780045bd60000
...
This is bad because :
1) Large batches hold one victim cpu for a very long time.
2) Driver often hit their own TX ring limit (all slots are used).
3) We call dev_requeue_skb()
4) Requeues are using a FIFO (q->gso_skb), breaking qdisc ability to implement FQ or priority scheduling.
5) dequeue_skb() gets packets from q->gso_skb one skb at a time with no xmit_more support. This is causing many spinlock games between the qdisc and the device driver.
Requeues were supposed to be very rare, lets keep them this way.
Limit batch sizes to /proc/sys/net/core/dev_weight (default 64) as __qdisc_run() was designed to use.
--- net/sched/sch_generic.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
net/sched/sch_generic.c +10 -7
@@ -172,9 +172,10 @@ static inline void dev_requeue_skb(struct sk_buff *skb, struct Qdisc *q)static void try_bulk_dequeue_skb (struct Qdisc *q,struct sk_buff *skb,const struct netdev_queue *txq, -int *packets) +int *packets,int budget) {int bytelimit =qdisc_avail_bulklimit (txq) - skb->len; +int cnt =0 ;while (bytelimit >0 ) {struct sk_buff *nskb = q->dequeue (q);
@@ -185,8 +186,10 @@ static void try_bulk_dequeue_skb(struct Qdisc *q, bytelimit -= nskb->len;/* covers GSO len */ skb->next = nskb; skb = nskb; - (*packets)++;/* GSO counts as one pkt */ +if (++cnt >= budget) +break ; } + (*packets) += cnt;skb_mark_not_on_list (skb); }
@@ -220,7 +223,7 @@ static void try_bulk_dequeue_skb_slow(struct Qdisc *q,* A requeued skb (via q->gso_skb) can also be a SKB list. */ static struct sk_buff *dequeue_skb (struct Qdisc *q,bool *validate, -int *packets) +int *packets,int budget) {const struct netdev_queue *txq = q->dev_queue;struct sk_buff *skb =NULL ;
@@ -287,7 +290,7 @@ static struct sk_buff *dequeue_skb(struct Qdisc *q, bool *validate,if (skb) { bulk:if (qdisc_may_bulk (q)) -try_bulk_dequeue_skb (q, skb, txq, packets); +try_bulk_dequeue_skb (q, skb, txq, packets, budget);else try_bulk_dequeue_skb_slow (q, skb, packets); }
@@ -379,7 +382,7 @@ bool sch_direct_xmit(struct sk_buff *skb, struct Qdisc *q,* >0 - queue is not empty. * */ -static inline bool qdisc_restart (struct Qdisc *q,int *packets) +static inline bool qdisc_restart (struct Qdisc *q,int *packets,int budget) {spinlock_t *root_lock =NULL ;struct netdev_queue *txq;
@@ -388,7 +391,7 @@ static inline bool qdisc_restart(struct Qdisc *q, int *packets)bool validate;/* Dequeue packet */ - skb =dequeue_skb (q, &validate, packets); + skb =dequeue_skb (q, &validate, packets, budget);if (unlikely (!skb))return false;
@@ -406,7 +409,7 @@ void __qdisc_run(struct Qdisc *q)int quota =READ_ONCE (dev_tx_weight);int packets; -while (qdisc_restart (q, &packets)) { +while (qdisc_restart (q, &packets, quota)) { quota -= packets;if (quota <=0 ) {__netif_schedule (q);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 192/300 hsr: Fix supervision frame sending on HSRv0
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Maurer <[email protected]>
[ Upstream commit 96a3a03abf3d8cc38cd9cb0d280235fbcf7c3f7f ]
On HSRv0, no supervision frames were sent. The supervison frames were generated successfully, but failed the check for a sufficiently long mac header, i.e., at least sizeof(struct hsr_ethhdr), in hsr_fill_frame_info() because the mac header only contained the ethernet header.
Fix this by including the HSR header in the mac header when generating HSR supervision frames. Note that the mac header now also includes the TLV fields. This matches how we set the headers on rx and also the size of struct hsrv0_ethhdr_sp.
--- net/hsr/hsr_device.c | 3 +++ 1 file changed, 3 insertions(+)
net/hsr/hsr_device.c +3 -0
@@ -296,6 +296,9 @@ static void send_hsr_supervision_frame(struct hsr_port *master, } hsr_stag =skb_put (skb,sizeof (struct hsr_sup_tag )); +skb_set_network_header (skb,ETH_HLEN +HSR_HLEN ); +skb_reset_mac_len (skb); +set_hsr_stag_path (hsr_stag, (hsr->prot_version ?0x0 :0xf ));set_hsr_stag_HSR_ver (hsr_stag, hsr->prot_version);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 193/300 Bluetooth: L2CAP: export l2cap_chan_hold for modules
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pauli Virtanen <[email protected]>
[ Upstream commit e060088db0bdf7932e0e3c2d24b7371c4c5b867c ]
l2cap_chan_put() is exported, so export also l2cap_chan_hold() for modules.
l2cap_chan_hold() has use case in net/bluetooth/6lowpan.c
--- net/bluetooth/l2cap_core.c | 1 + 1 file changed, 1 insertion(+)
net/bluetooth/l2cap_core.c +1 -0
@@ -518,6 +518,7 @@ void l2cap_chan_hold(struct l2cap_chan *c)kref_get (&c->kref); } +EXPORT_SYMBOL_GPL (l2cap_chan_hold);struct l2cap_chan *l2cap_chan_hold_unless_zero (struct l2cap_chan *c) {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 194/300 acpi,srat: Fix incorrect device handle check for Generic Initiator
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shuai Xue <[email protected]>
[ Upstream commit 7c3643f204edf1c5edb12b36b34838683ee5f8dc ]
The Generic Initiator Affinity Structure in SRAT table uses device handle type field to indicate the device type. According to ACPI specification, the device handle type value of 1 represents PCI device, not 0.
--- drivers/acpi/numa/srat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/numa/srat.c +1 -1
@@ -140,7 +140,7 @@ acpi_table_print_srat_entry(struct acpi_subtable_header *header)struct acpi_srat_generic_affinity *p = (struct acpi_srat_generic_affinity *)header; -if (p->device_handle_type ==0 ) { +if (p->device_handle_type ==1 ) {/* * For pci devices this may be the only place they * are assigned a proximity domain
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 195/300 regulator: fixed: use dev_err_probe for register
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Morgan <[email protected]>
[ Upstream commit d0f95e6496a974a890df5eda65ffaee66ab0dc73 ]
Instead of returning error directly, use dev_err_probe. This avoids messages in the dmesg log for devices which will be probed again later.
Stable-dep-of: 636f4618b1cd ("regulator: fixed: fix GPIO descriptor leak on register failure")
--- drivers/regulator/fixed.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/regulator/fixed.c +3 -2
@@ -238,8 +238,9 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev) drvdata->dev =devm_regulator_register (&pdev->dev, &drvdata->desc, &cfg);if (IS_ERR (drvdata->dev)) { - ret =PTR_ERR (drvdata->dev); -dev_err (&pdev->dev,"Failed to register regulator: %d\n" , ret); + ret =dev_err_probe (&pdev->dev,PTR_ERR (drvdata->dev), +"Failed to register regulator: %ld\n" , +PTR_ERR (drvdata->dev));return ret; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 196/300 regulator: fixed: fix GPIO descriptor leak on register failure
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haotian Zhang <[email protected]>
[ Upstream commit 636f4618b1cd96f6b5a2b8c7c4f665c8533ecf13 ]
In the commit referenced by the Fixes tag, devm_gpiod_get_optional() was replaced by manual
GPIO management, relying on the regulator core to release the GPIO descriptor. However, this approach does not account for the error path: when regulator registration fails, the core never takes over the GPIO, resulting in a resource leak.
Add gpiod_put() before returning on regulator registration failure.
--- drivers/regulator/fixed.c | 1 + 1 file changed, 1 insertion(+)
drivers/regulator/fixed.c +1 -0
@@ -241,6 +241,7 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev) ret =dev_err_probe (&pdev->dev,PTR_ERR (drvdata->dev),"Failed to register regulator: %ld\n" ,PTR_ERR (drvdata->dev)); +gpiod_put (cfg.ena_gpiod);return ret; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 197/300 ASoC: cs4271: Fix regulator leak on probe failure
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haotian Zhang <[email protected]>
[ Upstream commit 6b6eddc63ce871897d3a5bc4f8f593e698aef104 ]
The probe function enables regulators at the beginning but fails to disable them in its error handling path. If any operation after enabling the regulators fails, the probe will exit with an error, leaving the regulators permanently enabled, which could lead to a resource leak.
Add a proper error handling path to call regulator_bulk_disable() before returning an error.
--- sound/soc/codecs/cs4271.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
sound/soc/codecs/cs4271.c +7 -3
@@ -594,17 +594,17 @@ static int cs4271_component_probe(struct snd_soc_component *component) ret =regcache_sync (cs4271->regmap);if (ret <0 ) -return ret; + goto err_disable_regulator; ret =regmap_update_bits (cs4271->regmap,CS4271_MODE2 ,CS4271_MODE2_PDN |CS4271_MODE2_CPEN ,CS4271_MODE2_PDN |CS4271_MODE2_CPEN );if (ret <0 ) -return ret; + goto err_disable_regulator; ret =regmap_update_bits (cs4271->regmap,CS4271_MODE2 ,CS4271_MODE2_PDN ,0 );if (ret <0 ) -return ret; + goto err_disable_regulator;/* Power-up sequence requires 85 uS */ udelay (85 );
@@ -614,6 +614,10 @@ static int cs4271_component_probe(struct snd_soc_component *component) CS4271_MODE2_MUTECAEQUB);return 0 ; + +err_disable_regulator: +regulator_bulk_disable (ARRAY_SIZE (cs4271->supplies), cs4271->supplies); +return ret; }static void cs4271_component_remove (struct snd_soc_component *component)
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 198/300 drm/vmwgfx: Validate command header size against SVGA_CMD_MAX_DATASIZE
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Forbes <[email protected]>
[ Upstream commit 32b415a9dc2c212e809b7ebc2b14bc3fbda2b9af ]
This data originates from userspace and is used in buffer offset calculations which could potentially overflow causing an out-of-bounds access.
--- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +5 -0
@@ -3622,6 +3622,11 @@ static int vmw_cmd_check(struct vmw_private *dev_priv, cmd_id = header->id; +if (header->size >SVGA_CMD_MAX_DATASIZE ) { +VMW_DEBUG_USER ("SVGA3D command: %d is too big.\n" , + cmd_id +SVGA_3D_CMD_BASE ); +return -E2BIG ; + } *size = header->size +sizeof (SVGA3dCmdHeader); cmd_id -=SVGA_3D_CMD_BASE ;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 199/300 ALSA: usb-audio: Fix NULL pointer dereference in snd_usb_mixer_controls_badd
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haein Lee <[email protected]>
[ Upstream commit 632108ec072ad64c8c83db6e16a7efee29ebfb74 ]
In snd_usb_create_streams(), for UAC version 3 devices, the Interface Association Descriptor (IAD) is retrieved via usb_ifnum_to_if(). If this call fails, a fallback routine attempts to obtain the IAD from the next interface and sets a BADD profile. However, snd_usb_mixer_controls_badd() assumes that the IAD retrieved from usb_ifnum_to_if() is always valid, without performing a NULL check. This can lead to a NULL pointer dereference when usb_ifnum_to_if() fails to find the interface descriptor.
This patch adds a NULL pointer check after calling usb_ifnum_to_if() in snd_usb_mixer_controls_badd() to prevent the dereference.
This issue was discovered by syzkaller, which triggered the bug by sending a crafted USB device descriptor.
--- sound/usb/mixer.c | 2 ++ 1 file changed, 2 insertions(+)
sound/usb/mixer.c +2 -0
@@ -2999,6 +2999,8 @@ static int snd_usb_mixer_controls_badd(struct usb_mixer_interface *mixer,int i; assoc =usb_ifnum_to_if (dev, ctrlif)->intf_assoc; +if (!assoc) +return -EINVAL ;/* Detect BADD capture/playback channels from AS EP descriptors */ for (i =0 ; i < assoc->bInterfaceCount; i++) {
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 200/300 fsdax: mark the iomap argument to dax_iomap_sector as const
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christoph Hellwig <[email protected]>
[ Upstream commit 7e4f4b2d689d959b03cb07dfbdb97b9696cb1076 ]
--- fs/dax.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/dax.c +1 -1
@@ -1006,7 +1006,7 @@ int dax_writeback_mapping_range(struct address_space *mapping, }EXPORT_SYMBOL_GPL (dax_writeback_mapping_range); -static sector_t dax_iomap_sector (struct iomap *iomap,loff_t pos) +static sector_t dax_iomap_sector (const struct iomap *iomap,loff_t pos) {return (iomap->addr + (pos &PAGE_MASK ) - iomap->offset) >>9 ; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 201/300 mm/ksm: fix flag-dropping behavior in ksm_madvise
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jakub Acs <[email protected]>
[ Upstream commit f04aad36a07cc17b7a5d5b9a2d386ce6fae63e93 ]
syzkaller discovered the following crash: (kernel BUG)
[ 44.607039] ------------[ cut here ]------------ [ 44.607422] kernel BUG at mm/userfaultfd.c:2067! [ 44.608148] Oops: invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC KASAN NOPTI [ 44.608814] CPU: 1 UID: 0 PID: 2475 Comm: reproducer Not tainted 6.16.0-rc6 #1 PREEMPT(none) [ 44.609635] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 04/01/2014 [ 44.610695] RIP: 0010:userfaultfd_release_all+0x3a8/0x460
<snip other registers, drop unreliable trace>
[ 44.617726] Call Trace: [ 44.617926] <TASK> [ 44.619284] userfaultfd_release+0xef/0x1b0 [ 44.620976] __fput+0x3f9/0xb60 [ 44.621240] fput_close_sync+0x110/0x210 [ 44.622222] __x64_sys_close+0x8f/0x120 [ 44.622530] do_syscall_64+0x5b/0x2f0 [ 44.622840] entry_SYSCALL_64_after_hwframe+0x76/0x7e [ 44.623244] RIP: 0033:0x7f365bb3f227
Kernel panics because it detects UFFD inconsistency during
userfaultfd_release_all(). Specifically, a VMA which has a valid pointer to vma->vm_userfaultfd_ctx, but no UFFD flags in vma->vm_flags.
The inconsistency is caused in ksm_madvise(): when user calls madvise() with MADV_UNMEARGEABLE on a VMA that is registered for UFFD in MINOR mode, it accidentally clears all flags stored in the upper 32 bits of vma->vm_flags.
Assuming x86_64 kernel build, unsigned long is 64-bit and unsigned int and int are 32-bit wide. This setup causes the following mishap during the &= ~VM_MERGEABLE assignment.
VM_MERGEABLE is a 32-bit constant of type unsigned int, 0x8000'0000. After ~ is applied, it becomes 0x7fff'ffff unsigned int, which is then promoted to unsigned long before the & operation. This promotion fills upper 32 bits with leading 0s, as we're doing unsigned conversion (and even for a signed conversion, this wouldn't help as the leading bit is 0). & operation thus ends up AND-ing vm_flags with 0x0000'0000'7fff'ffff instead of intended 0xffff'ffff'7fff'ffff and hence accidentally clears the upper 32-bits of its value.
Fix it by changing VM_MERGEABLE constant to unsigned long, using the BIT() macro.
Note: other VM_* flags are not affected: This only happens to the VM_MERGEABLE flag, as the other VM_* flags are all constants of type int and after ~ operation, they end up with leading 1 and are thus converted to unsigned long with leading 1s.
Note 2:
After commit 31defc3b01d9 ("userfaultfd: remove (VM_)BUG_ON()s"), this is no longer a kernel BUG, but a WARNING at the same place:
[ 45.595973] WARNING: CPU: 1 PID: 2474 at mm/userfaultfd.c:2067
but the root-cause (flag-drop) remains the same.
--- include/linux/mm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/mm.h +1 -1
@@ -296,7 +296,7 @@ extern unsigned int kobjsize(const void *objp);#define VM_MIXEDMAP 0x10000000/* Can contain "struct page" and pure PFN pages */ #define VM_HUGEPAGE 0x20000000/* MADV_HUGEPAGE marked this vma */ #define VM_NOHUGEPAGE 0x40000000/* MADV_NOHUGEPAGE marked this vma */ -#define VM_MERGEABLE 0x80000000/* KSM may merge identical pages */ +#define VM_MERGEABLE BIT(31)/* KSM may merge identical pages */ #ifdef CONFIG_ARCH_USES_HIGH_VMA_FLAGS #define VM_HIGH_ARCH_BIT_0 32/* bit only usable on 64-bit architectures */
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 202/300 lib/crypto: arm/curve25519: Disable on CPU_BIG_ENDIAN
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Biggers <[email protected]>
commit 44e8241c51f762aafa50ed116da68fd6ecdcc954 upstream.
On big endian arm kernels, the arm optimized Curve25519 code produces incorrect outputs and fails the Curve25519 test. This has been true ever since this code was added.
It seems that hardly anyone (or even no one?) actually uses big endian arm kernels. But as long as they're ostensibly supported, we should disable this code on them so that it's not accidentally used.
Note: for future-proofing, use !CPU_BIG_ENDIAN instead of CPU_LITTLE_ENDIAN. Both of these are arch-specific options that could get removed in the future if big endian support gets dropped.
--- arch/arm/crypto/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/crypto/Kconfig +1 -1
@@ -147,7 +147,7 @@ config CRYPTO_NHPOLY1305_NEON config CRYPTO_CURVE25519_NEON tristate "NEON accelerated Curve25519 scalar multiplication library" - depends on KERNEL_MODE_NEON + depends on KERNEL_MODE_NEON && !CPU_BIG_ENDIAN select CRYPTO_LIB_CURVE25519_GENERIC select CRYPTO_ARCH_HAVE_LIB_CURVE25519
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 203/300 mtd: onenand: Pass correct pointer to IRQ handler
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
[ Upstream commit 97315e7c901a1de60e8ca9b11e0e96d0f9253e18 ]
This was supposed to pass "onenand" instead of "&onenand" with the ampersand. Passing a random stack address which will be gone when the function ends makes no sense. However the good thing is that the pointer is never used, so this doesn't cause a problem at run time.
--- drivers/mtd/nand/onenand/onenand_samsung.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/onenand/onenand_samsung.c +1 -1
@@ -908,7 +908,7 @@ static int s3c_onenand_probe(struct platform_device *pdev) err =devm_request_irq (&pdev->dev, r->start, s5pc110_onenand_irq,IRQF_SHARED ,"onenand" , - &onenand); + onenand);if (err) {dev_err (&pdev->dev,"failed to get irq\n" );return err;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 204/300 netfilter: nf_tables: reject duplicate device on updates
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <[email protected]>
commit cf5fb87fcdaaaafec55dcc0dc5a9e15ead343973 upstream.
A chain/flowtable update with duplicated devices in the same batch is possible. Unfortunately, netdev event path only removes the first device that is found, leaving unregistered the hook of the duplicated device.
Check if a duplicated device exists in the transaction batch, bail out with EEXIST in such case.
WARNING is hit when unregistering the hook:
[49042.221275] WARNING: CPU: 4 PID: 8425 at net/netfilter/core.c:340 nf_hook_entry_head+0xaa/0x150 [49042.221375] CPU: 4 UID: 0 PID: 8425 Comm: nft Tainted: G S 6.16.0+ #170 PREEMPT(full) [...] [49042.221382] RIP: 0010:nf_hook_entry_head+0xaa/0x150
--- net/netfilter/nf_tables_api.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
net/netfilter/nf_tables_api.c +15 -0
@@ -7105,6 +7105,7 @@ static int nft_flowtable_update(struct nft_ctx *ctx, const struct nlmsghdr *nlh, {const struct nlattr *const *nla = ctx->nla;struct nft_flowtable_hook flowtable_hook; +struct nftables_pernet *nft_net;struct nft_hook *hook, *next;struct nft_trans *trans;bool unregister = false;
@@ -7120,6 +7121,20 @@ static int nft_flowtable_update(struct nft_ctx *ctx, const struct nlmsghdr *nlh,if (nft_hook_list_find (&flowtable->hook_list, hook)) {list_del (&hook->list);kfree (hook); +continue ; + } + + nft_net =net_generic (ctx->net, nf_tables_net_id); +list_for_each_entry (trans, &nft_net->commit_list, list) { +if (trans->msg_type !=NFT_MSG_NEWFLOWTABLE || + trans->ctx.table != ctx->table || + !nft_trans_flowtable_update (trans)) +continue ; + +if (nft_hook_list_find (&nft_trans_flowtable_hooks (trans), hook)) { + err = -EEXIST ; + goto err_flowtable_update_hook; + } } }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 205/300 HID: hid-ntrig: Prevent memory leak in ntrig_report_version()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Ichikawa <[email protected]>
[ Upstream commit 53f731f5bba0cf03b751ccceb98b82fadc9ccd1e ]
Use a scope-based cleanup helper for the buffer allocated with kmalloc() in ntrig_report_version() to simplify the cleanup logic and prevent memory leaks (specifically the !hid_is_usb()-case one).
--- drivers/hid/hid-ntrig.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/hid/hid-ntrig.c +2 -5
@@ -142,13 +142,13 @@ static void ntrig_report_version(struct hid_device *hdev)int ret;char buf[20 ];struct usb_device *usb_dev =hid_to_usb_dev (hdev); -unsigned char *data =kmalloc (8 ,GFP_KERNEL ); + unsigned char *data __free(kfree) = kmalloc(8, GFP_KERNEL);if (!hid_is_usb (hdev))return ;if (!data) - goto err_free; +return ; ret = usb_control_msg(usb_dev, usb_rcvctrlpipe(usb_dev, 0), USB_REQ_CLEAR_FEATURE,
@@ -163,9 +163,6 @@ static void ntrig_report_version(struct hid_device *hdev)hid_info (hdev,"Firmware version: %s (%02x%02x %02x%02x)\n" , buf, data[2 ], data[3 ], data[4 ], data[5 ]); } - -err_free: -kfree (data); } static ssize_t show_phys_width(struct device *dev,
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 206/300 NFSD: free copynotify stateid in nfs4_free_ol_stateid()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Olga Kornievskaia <[email protected]>
commit 4aa17144d5abc3c756883e3a010246f0dba8b468 upstream.
Typically copynotify stateid is freed either when parent's stateid is being close/freed or in nfsd4_laundromat if the stateid hasn't been used in a lease period.
However, in case when the server got an OPEN (which created a parent stateid), followed by a COPY_NOTIFY using that stateid, followed by a client reboot. New client instance while doing CREATE_SESSION would force expire previous state of this client. It leads to the open state being freed thru release_openowner-> nfs4_free_ol_stateid() and it finds that it still has copynotify stateid associated with it. We currently print a warning and is triggerred
WARNING: CPU: 1 PID: 8858 at fs/nfsd/nfs4state.c:1550 nfs4_free_ol_stateid+0xb0/0x100 [nfsd]
This patch, instead, frees the associated copynotify stateid here.
If the parent stateid is freed (without freeing the copynotify stateids associated with it), it leads to the list corruption when laundromat ends up freeing the copynotify state later.
[ 1626.839430] Internal error: Oops - BUG: 00000000f2000800 [#1] SMP [ 1626.842828] Modules linked in: nfnetlink_queue nfnetlink_log bluetooth cfg80211 rpcrdma rdma_cm iw_cm ib_cm ib_core nfsd nfs_acl lockd grace nfs_localio ext4 crc16 mbcache jbd2 overlay uinput snd_seq_dummy snd_hrtimer qrtr rfkill vfat fat uvcvideo snd_hda_codec_generic videobuf2_vmalloc videobuf2_memops snd_hda_intel uvc snd_intel_dspcfg videobuf2_v4l2 videobuf2_common snd_hda_codec snd_hda_core videodev snd_hwdep snd_seq mc snd_seq_device snd_pcm snd_timer snd soundcore sg loop auth_rpcgss vsock_loopback vmw_vsock_virtio_transport_common vmw_vsock_vmci_transport vmw_vmci vsock xfs 8021q garp stp llc mrp nvme ghash_ce e1000e nvme_core sr_mod nvme_keyring nvme_auth cdrom vmwgfx drm_ttm_helper ttm sunrpc dm_mirror dm_region_hash dm_log iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi fuse dm_multipath dm_mod nfnetlink [ 1626.855594] CPU: 2 UID: 0 PID: 199 Comm: kworker/u24:33 Kdump: loaded Tainted: G B W 6.17.0-rc7+ #22 PREEMPT(voluntary) [ 1626.857075] Tainted: [B]=BAD_PAGE, [W]=WARN [ 1626.857573] Hardware name: VMware, Inc. VMware20,1/VBSA, BIOS VMW201.00V.24006586.BA64.2406042154 06/04/2024 [ 1626.858724] Workqueue: nfsd4 laundromat_main [nfsd] [ 1626.859304] pstate: 61400005 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--) [ 1626.860010] pc : __list_del_entry_valid_or_report+0x148/0x200 [ 1626.860601] lr : __list_del_entry_valid_or_report+0x148/0x200 [ 1626.861182] sp : ffff8000881d7a40 [ 1626.861521] x29: ffff8000881d7a40 x28: 0000000000000018 x27: ffff0000c2a98200 [ 1626.862260] x26: 0000000000000600 x25: 0000000000000000 x24: ffff8000881d7b20 [ 1626.862986] x23: ffff0000c2a981e8 x22: 1fffe00012410e7d x21: ffff0000920873e8 [ 1626.863701] x20: ffff0000920873e8 x19: ffff000086f22998 x18: 0000000000000000 [ 1626.864421] x17: 20747562202c3839 x16: 3932326636383030 x15: 3030666666662065 [ 1626.865092] x14: 6220646c756f6873 x13: 0000000000000001 x12: ffff60004fd9e4a3 [ 1626.865713] x11: 1fffe0004fd9e4a2 x10: ffff60004fd9e4a2 x9 : dfff800000000000 [ 1626.866320] x8 : 00009fffb0261b5e x7 : ffff00027ecf2513 x6 : 0000000000000001 [ 1626.866938] x5 : ffff00027ecf2510 x4 : ffff60004fd9e4a3 x3 : 0000000000000000 [ 1626.867553] x2 : 0000000000000000 x1 : ffff000096069640 x0 : 000000000000006d [ 1626.868167] Call trace: [ 1626.868382] __list_del_entry_valid_or_report+0x148/0x200 (P) [ 1626.868876] _free_cpntf_state_locked+0xd0/0x268 [nfsd] [ 1626.869368] nfs4_laundromat+0x6f8/0x1058 [nfsd] [ 1626.869813] laundromat_main+0x24/0x60 [nfsd] [ 1626.870231] process_one_work+0x584/0x1050 [ 1626.870595] worker_thread+0x4c4/0xc60 [ 1626.870893] kthread+0x2f8/0x398 [ 1626.871146] ret_from_fork+0x10/0x20 [ 1626.871422] Code: aa1303e1 aa1403e3 910e8000 97bc55d7 (d4210000) [ 1626.871892] SMP: stopping secondary CPUs
--- fs/nfsd/nfs4state.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/nfsd/nfs4state.c +2 -1
@@ -1499,7 +1499,8 @@ static void nfs4_free_ol_stateid(structrelease_all_access (stp);if (stp->st_stateowner)nfs4_put_stateowner (stp->st_stateowner); -WARN_ON (!list_empty (&stid->sc_cp_list)); +if (!list_empty (&stid->sc_cp_list)) +nfs4_free_cpntf_statelist (stid->sc_client->net, stid);kmem_cache_free (stateid_slab, stid); }
Greg Kroah-Hartman
maintainerPATCH 207/300 gcov: add support for GCC 15
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Oberparleiter <[email protected]>
commit ec4d11fc4b2dd4a2fa8c9d801ee9753b74623554 upstream.
Using gcov on kernels compiled with GCC 15 results in truncated 16-byte long .gcda files with no usable data. To fix this, update GCOV_COUNTERS to match the value defined by GCC 15.
Tested with GCC 14.3.0 and GCC 15.2.0.
--- kernel/gcov/gcc_4_7.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
kernel/gcov/gcc_4_7.c +3 -1
@@ -19,7 +19,9 @@#include <linux/vmalloc.h> #include "gcov.h" -#if (__GNUC__ >=14 ) +#if (__GNUC__ >=15 ) +#define GCOV_COUNTERS 10 +#elif (__GNUC__ >=14 )#define GCOV_COUNTERS 9#elif (__GNUC__ >=10 )#define GCOV_COUNTERS 8
Greg Kroah-Hartman
maintainerPATCH 208/300 strparser: Fix signed/unsigned mismatch bug
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nate Karstens <[email protected]>
commit 4da4e4bde1c453ac5cc2dce5def81d504ae257ee upstream.
The len member of the sk_buff is an unsigned int. This is cast to ssize_t (a signed type) for the first sk_buff in the comparison, but not the second sk_buff. On 32-bit systems, this can result in an integer underflow for certain values because unsigned arithmetic is being used.
This appears to be an oversight: if the intention was to use unsigned arithmetic, then the first cast would have been omitted. The change ensures both len values are cast to ssize_t.
The underflow causes an issue with ktls when multiple TLS PDUs are included in a single TCP segment. The mainline kernel does not use strparser for ktls anymore, but this is still useful for other features that still use strparser, and for backporting.
--- net/strparser/strparser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/strparser/strparser.c +1 -1
@@ -238,7 +238,7 @@ static int __strp_recv(read_descriptor_tstrp_parser_err (strp, -EMSGSIZE , desc);break ; }else if (len <= (ssize_t )head->len - - skb->len - stm->strp.offset) { + (ssize_t )skb->len - stm->strp.offset) {/* Length must be into new skb (and also * greater than zero) */
Greg Kroah-Hartman
maintainerPATCH 209/300 ipv4: route: Prevent rt_bind_exception() from rebinding stale fnhe
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chuang Wang <[email protected]>
commit ac1499fcd40fe06479e9b933347b837ccabc2a40 upstream.
The sit driver's packet transmission path calls: sit_tunnel_xmit() -> update_or_create_fnhe(), which lead to fnhe_remove_oldest() being called to delete entries exceeding FNHE_RECLAIM_DEPTH+random.
The race window is between fnhe_remove_oldest() selecting fnheX for deletion and the subsequent kfree_rcu(). During this time, the concurrent path's __mkroute_output() -> find_exception() can fetch the soon-to-be-deleted fnheX, and rt_bind_exception() then binds it with a new dst using a dst_hold(). When the original fnheX is freed via RCU, the dst reference remains permanently leaked.
CPU 0 CPU 1__mkroute_output()
find_exception() [fnheX]
update_or_create_fnhe()
fnhe_remove_oldest() [fnheX]
rt_bind_exception() [bind dst]
RCU callback [fnheX freed, dst leak]
This issue manifests as a device reference count leak and a warning in dmesg when unregistering the net device:
unregister_netdevice: waiting for sitX to become free. Usage count = N
Ido Schimmel provided the simple test validation method [1].
The fix clears 'oldest->fnhe_daddr' before calling fnhe_flush_routes(). Since rt_bind_exception() checks this field, setting it to zero prevents the stale fnhe from being reused and bound to a new dst just before it is freed.
[1]
ip netns add ns1
ip -n ns1 link set dev lo up
ip -n ns1 address add 192.0.2.1/32 dev lo
ip -n ns1 link add name dummy1 up type dummy
ip -n ns1 route add 192.0.2.2/32 dev dummy1
ip -n ns1 link add name gretap1 up arp off type gretap \
local 192.0.2.1 remote 192.0.2.2
ip -n ns1 route add 198.51.0.0/16 dev gretap1
taskset -c 0 ip netns exec ns1 mausezahn gretap1 \
-A 198.51.100.1 -B 198.51.0.0/16 -t udp -p 1000 -c 0 -q &
taskset -c 2 ip netns exec ns1 mausezahn gretap1 \
-A 198.51.100.1 -B 198.51.0.0/16 -t udp -p 1000 -c 0 -q &sleep 10
ip netns pids ns1 | xargs kill
ip netns del ns1
--- net/ipv4/route.c | 5 +++++ 1 file changed, 5 insertions(+)
net/ipv4/route.c +5 -0
@@ -646,6 +646,11 @@ static void fnhe_remove_oldest(struct fn oldest_p = fnhe_p; } } + +/* Clear oldest->fnhe_daddr to prevent this fnhe from being +* rebound with new dsts in rt_bind_exception(). +*/ + oldest->fnhe_daddr =0 ;fnhe_flush_routes (oldest); *oldest_p = oldest->fnhe_next;kfree_rcu (oldest, rcu);
Greg Kroah-Hartman
maintainerPATCH 210/300 fs/proc: fix uaf in proc_readdir_de()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Yang <[email protected]>
commit 895b4c0c79b092d732544011c3cecaf7322c36a1 upstream.
Pde is erased from subdir rbtree through rb_erase(), but not set the node to EMPTY, which may result in uaf access. We should use RB_CLEAR_NODE() set the erased node to EMPTY, then pde_subdir_next() will return NULL to avoid uaf access.
We found an uaf issue while using stress-ng testing, need to run testcase getdent and tun in the same time. The steps of the issue is as follows:
1) use getdent to traverse dir /proc/pid/net/dev_snmp6/, and current pde is tun3;
2) in the [time windows] unregister netdevice tun3 and tun2, and erase them from rbtree. erase tun3 first, and then erase tun2. the pde(tun2) will be released to slab;
3) continue to getdent process, then pde_subdir_next() will return pde(tun2) which is released, it will case uaf access.
CPU 0 | CPU 1
-------------------------------------------------------------------------
traverse dir /proc/pid/net/dev_snmp6/ | unregister_netdevice(tun->dev) //tun3 tun2
sys_getdents64() |
iterate_dir() |
proc_readdir() |
proc_readdir_de() | snmp6_unregister_dev()
pde_get(de); | proc_remove()
read_unlock(&proc_subdir_lock); | remove_proc_subtree()
| write_lock(&proc_subdir_lock);
[time window] | rb_erase(&root->subdir_node, &parent->subdir);
| write_unlock(&proc_subdir_lock);
read_lock(&proc_subdir_lock); |
next = pde_subdir_next(de); |
pde_put(de); |
de = next; //UAF |rbtree of dev_snmp6
|
pde(tun3)
/ \
NULL pde(tun2)--- fs/proc/generic.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
fs/proc/generic.c +9 -3
@@ -693,6 +693,12 @@ void pde_put(struct proc_dir_entry *pde) } } +static void pde_erase (struct proc_dir_entry *pde,struct proc_dir_entry *parent) +{ +rb_erase (&pde->subdir_node, &parent->subdir); +RB_CLEAR_NODE (&pde->subdir_node); +} +/* * Remove a /proc entry and free it if it's not currently in use. */
@@ -715,7 +721,7 @@ void remove_proc_entry(const char *name,WARN (1 ,"removing permanent /proc entry '%s'" , de->name); de =NULL ; }else { -rb_erase (&de->subdir_node, &parent->subdir); +pde_erase (de, parent);if (S_ISDIR (de->mode)) parent->nlink--; }
@@ -759,7 +765,7 @@ int remove_proc_subtree(const char *name root->parent->name, root->name);return -EINVAL ; } -rb_erase (&root->subdir_node, &parent->subdir); +pde_erase (root, parent); de = root;while (1 ) {
@@ -771,7 +777,7 @@ int remove_proc_subtree(const char *name next->parent->name, next->name);return -EINVAL ; } -rb_erase (&next->subdir_node, &de->subdir); +pde_erase (next, de); de = next;continue ; }
Greg Kroah-Hartman
maintainerPATCH 211/300 spi: Try to get ACPI GPIO IRQ earlier
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit 3cd2018e15b3d66d2187d92867e265f45ad79e6f upstream.
Since commit d24cfee7f63d ("spi: Fix acpi deferred irq probe"), the acpi_dev_gpio_irq_get() call gets delayed till spi_probe() is called on the SPI device.
If there is no driver for the SPI device then the move to spi_probe() results in acpi_dev_gpio_irq_get() never getting called. This may cause problems by leaving the GPIO pin floating because this call is responsible for setting up the GPIO pin direction and/or bias according to the values from the ACPI tables.
Re-add the removed acpi_dev_gpio_irq_get() in acpi_register_spi_device() to ensure the GPIO pin is always correctly setup, while keeping the acpi_dev_gpio_irq_get() call added to spi_probe() to deal with -EPROBE_DEFER returns caused by the GPIO controller not having a driver yet.
--- drivers/spi/spi.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/spi/spi.c +10 -0
@@ -2259,6 +2259,16 @@ static acpi_status acpi_register_spi_devacpi_set_modalias (adev,acpi_device_hid (adev), spi->modalias,sizeof (spi->modalias)); +/* +* This gets re-tried in spi_probe() for -EPROBE_DEFER handling in case +* the GPIO controller does not have a driver yet. This needs to be done +* here too, because this call sets the GPIO direction and/or bias. +* Setting these needs to be done even if there is no driver, in which +* case spi_probe() will never get called. +*/ +if (spi->irq <0 ) + spi->irq =acpi_dev_gpio_irq_get (adev,0 ); +acpi_device_set_enumerated (adev); adev->power.flags.ignore_parent = true;
Greg Kroah-Hartman
maintainerPATCH 212/300 EDAC/altera: Handle OCRAM ECC enable after warm reset
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niravkumar L Rabara <[email protected]>
commit fd3ecda38fe0cb713d167b5477d25f6b350f0514 upstream.
The OCRAM ECC is always enabled either by the BootROM or by the Secure Device Manager (SDM) during a power-on reset on SoCFPGA.
However, during a warm reset, the OCRAM content is retained to preserve data, while the control and status registers are reset to their default values. As a result, ECC must be explicitly re-enabled after a warm reset.
--- drivers/edac/altera_edac.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
drivers/edac/altera_edac.c +15 -3
@@ -1147,10 +1147,22 @@ altr_check_ocram_deps_init(struct altr_eif (ret)return ret; -/* Verify OCRAM has been initialized */ +/* +* Verify that OCRAM has been initialized. +* During a warm reset, OCRAM contents are retained, but the control +* and status registers are reset to their default values. Therefore, +* ECC must be explicitly re-enabled in the control register. +* Error condition: if INITCOMPLETEA is clear and ECC_EN is already set. +*/ if (!ecc_test_bits (ALTR_A10_ECC_INITCOMPLETEA , - (base +ALTR_A10_ECC_INITSTAT_OFST ))) -return -ENODEV ; + (base +ALTR_A10_ECC_INITSTAT_OFST ))) { +if (!ecc_test_bits (ALTR_A10_ECC_EN , + (base +ALTR_A10_ECC_CTRL_OFST ))) +ecc_set_bits (ALTR_A10_ECC_EN , + (base +ALTR_A10_ECC_CTRL_OFST )); +else +return -ENODEV ; + }/* Enable IRQ on Single Bit Error */ writel (ALTR_A10_ECC_SERRINTEN , (base +ALTR_A10_ECC_ERRINTENS_OFST ));
Greg Kroah-Hartman
maintainerPATCH 213/300 EDAC/altera: Use INTTEST register for Ethernet and USB SBE injection
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niravkumar L Rabara <[email protected]>
commit 281326be67252ac5794d1383f67526606b1d6b13 upstream.
The current single-bit error injection mechanism flips bits directly in ECC RAM by performing write and read operations. When the ECC RAM is actively used by the Ethernet or USB controller, this approach sometimes trigger a false double-bit error.
Switch both Ethernet and USB EDAC devices to use the INTTEST register (altr_edac_a10_device_inject_fops) for single-bit error injection, similar to the existing double-bit error injection method.
--- drivers/edac/altera_edac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/edac/altera_edac.c +2 -2
@@ -1332,7 +1332,7 @@ static const struct edac_device_prv_data .ue_set_mask = ALTR_A10_ECC_TDERRA, .set_err_ofst = ALTR_A10_ECC_INTTEST_OFST, .ecc_irq_handler = altr_edac_a10_ecc_irq, - .inject_fops = &altr_edac_a10_device_inject2_fops, + .inject_fops = &altr_edac_a10_device_inject_fops, };#endif /* CONFIG_EDAC_ALTERA_ETHERNET */
@@ -1422,7 +1422,7 @@ static const struct edac_device_prv_data .ue_set_mask = ALTR_A10_ECC_TDERRA, .set_err_ofst = ALTR_A10_ECC_INTTEST_OFST, .ecc_irq_handler = altr_edac_a10_ecc_irq, - .inject_fops = &altr_edac_a10_device_inject2_fops, + .inject_fops = &altr_edac_a10_device_inject_fops, };#endif /* CONFIG_EDAC_ALTERA_USB */
Greg Kroah-Hartman
maintainerPATCH 214/300 isdn: mISDN: hfcsusb: fix memory leak in hfcsusb_probe()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abdun Nihaal <[email protected]>
commit 3f978e3f1570155a1327ffa25f60968bc7b9398f upstream.
In hfcsusb_probe(), the memory allocated for ctrl_urb gets leaked when setup_instance() fails with an error code. Fix that by freeing the urb before freeing the hw structure. Also change the error paths to use the goto ladder style.
Compile tested only. Issue found using a prototype static analysis tool.
--- drivers/isdn/hardware/mISDN/hfcsusb.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)
drivers/isdn/hardware/mISDN/hfcsusb.c +13 -5
@@ -1903,13 +1903,13 @@ out:mISDN_freebchannel (&hw->bch[1 ]);mISDN_freebchannel (&hw->bch[0 ]);mISDN_freedchannel (&hw->dch); -kfree (hw);return err; }static int hfcsusb_probe (struct usb_interface *intf,const struct usb_device_id *id) { +int err;struct hfcsusb *hw;struct usb_device *dev =interface_to_usbdev (intf);struct usb_host_interface *iface = intf->cur_altsetting;
@@ -2100,20 +2100,28 @@ hfcsusb_probe(struct usb_interface *intfif (!hw->ctrl_urb) {pr_warn ("%s: No memory for control urb\n" , driver_info->vend_name); -kfree (hw); -return -ENOMEM ; + err = -ENOMEM ; + goto err_free_hw; }pr_info ("%s: %s: detected \"%s\" (%s, if=%d alt=%d)\n" , hw->name, __func__, driver_info->vend_name, conf_str[small_match], ifnum, alt_used); -if (setup_instance (hw, dev->dev.parent)) -return -EIO ; +if (setup_instance (hw, dev->dev.parent)) { + err = -EIO ; + goto err_free_urb; + } hw->intf = intf;usb_set_intfdata (hw->intf, hw);return 0 ; + +err_free_urb: +usb_free_urb (hw->ctrl_urb); +err_free_hw: +kfree (hw); +return err; }/* function called when an active device is removed */
Greg Kroah-Hartman
maintainerPATCH 215/300 HID: quirks: work around VID/PID conflict for 0x4c4a/0x4155
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhang Heng <[email protected]>
commit beab067dbcff642243291fd528355d64c41dc3b2 upstream.
Based on available evidence, the USB ID 4c4a:4155 used by multiple devices has been attributed to Jieli. The commit 1a8953f4f774 ("HID: Add IGNORE quirk for SMARTLINKTECHNOLOGY") affected touchscreen functionality. Added checks for manufacturer and serial number to maintain microphone compatibility, enabling both devices to function properly.
--- drivers/hid/hid-ids.h | 4 ++-- drivers/hid/hid-quirks.c | 13 ++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-)
drivers/hid/hid-ids.h +2 -2
@@ -1365,7 +1365,7 @@#define USB_VENDOR_ID_SIGNOTEC 0x2133#define USB_DEVICE_ID_SIGNOTEC_VIEWSONIC_PD1011 0x0018 -#define USB_VENDOR_ID_SMARTLINKTECHNOLOGY 0x4c4a -#define USB_DEVICE_ID_SMARTLINKTECHNOLOGY_4155 0x4155 +#define USB_VENDOR_ID_JIELI_SDK_DEFAULT 0x4c4a +#define USB_DEVICE_ID_JIELI_SDK_4155 0x4155#endif
drivers/hid/hid-quirks.c +12 -1
@@ -876,7 +876,6 @@ static const struct hid_device_id hid_ig#endif { HID_USB_DEVICE(USB_VENDOR_ID_YEALINK, USB_DEVICE_ID_YEALINK_P1K_P4K_B2K) }, { HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_HP_5MP_CAMERA_5473) }, - { HID_USB_DEVICE(USB_VENDOR_ID_SMARTLINKTECHNOLOGY, USB_DEVICE_ID_SMARTLINKTECHNOLOGY_4155) }, { } };
@@ -1025,6 +1024,18 @@ bool hid_ignore(struct hid_device *hdev) strlen(elan_acpi_id[i].id)))return true;break ; +case USB_VENDOR_ID_JIELI_SDK_DEFAULT : +/* +* Multiple USB devices with identical IDs (mic & touchscreen). +* The touch screen requires hid core processing, but the +* microphone does not. They can be distinguished by manufacturer +* and serial number. +*/ +if (hdev->product ==USB_DEVICE_ID_JIELI_SDK_4155 && +strncmp (hdev->name,"SmartlinkTechnology" ,19 ) ==0 && +strncmp (hdev->uniq,"20201111000001" ,14 ) ==0 ) +return true; +break ; } if (hdev->type == HID_TYPE_USBMOUSE &&
Greg Kroah-Hartman
maintainerPATCH 216/300 mtd: rawnand: cadence: fix DMA device NULL pointer dereference
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niravkumar L Rabara <[email protected]>
commit 5c56bf214af85ca042bf97f8584aab2151035840 upstream.
The DMA device pointer dma_dev was being dereferenced before ensuring that cdns_ctrl->dmac is properly initialized.
Move the assignment of dma_dev after successfully acquiring the DMA channel to ensure the pointer is valid before use.
--- drivers/mtd/nand/raw/cadence-nand-controller.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mtd/nand/raw/cadence-nand-controller.c +2 -1
@@ -2833,7 +2833,7 @@ cadence_nand_irq_cleanup(int irqnum, strstatic int cadence_nand_init (struct cdns_nand_ctrl *cdns_ctrl) {dma_cap_mask_t mask; -struct dma_device *dma_dev = cdns_ctrl->dmac->device; +struct dma_device *dma_dev;int ret; cdns_ctrl->cdma_desc = dma_alloc_coherent(cdns_ctrl->dev,
@@ -2877,6 +2877,7 @@ static int cadence_nand_init(struct cdns } } + dma_dev = cdns_ctrl->dmac->device; cdns_ctrl->io.iova_dma =dma_map_resource (dma_dev->dev, cdns_ctrl->io.dma, cdns_ctrl->io.size,DMA_BIDIRECTIONAL ,0 );
Greg Kroah-Hartman
maintainerPATCH 217/300 exfat: check return value of sb_min_blocksize in exfat_read_boot_sector
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yongpeng Yang <[email protected]>
commit f2c1f631630e01821fe4c3fdf6077bc7a8284f82 upstream.
sb_min_blocksize() may return 0. Check its return value to avoid accessing the filesystem super block when sb->s_blocksize is 0.
--- fs/exfat/super.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
fs/exfat/super.c +4 -1
@@ -416,7 +416,10 @@ static int exfat_read_boot_sector(structstruct exfat_sb_info *sbi =EXFAT_SB (sb);/* set block size to read super block */ -sb_min_blocksize (sb,512 ); +if (!sb_min_blocksize (sb,512 )) { +exfat_err (sb,"unable to set blocksize" ); +return -EINVAL ; + }/* read boot sector */ sbi->boot_bh =sb_bread (sb,0 );
Greg Kroah-Hartman
maintainerPATCH 218/300 be2net: pass wrb_params in case of OS2BMC
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrey Vatoropin <[email protected]>
commit 7d277a7a58578dd62fd546ddaef459ec24ccae36 upstream.
be_insert_vlan_in_pkt() is called with the wrb_params argument being NULL at be_send_pkt_to_bmc() call site. This may lead to dereferencing a NULL pointer when processing a workaround for specific packet, as commit bc0c3405abbb ("be2net: fix a Tx stall bug caused by a specific ipv6 packet") states.
The correct way would be to pass the wrb_params from be_xmit().
--- drivers/net/ethernet/emulex/benet/be_main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/ethernet/emulex/benet/be_main.c +4 -3
@@ -1297,7 +1297,8 @@ static void be_xmit_flush(struct be_adap (adapter->bmc_filt_mask & BMC_FILT_MULTICAST)static bool be_send_pkt_to_bmc (struct be_adapter *adapter, -struct sk_buff **skb) +struct sk_buff **skb, +struct be_wrb_params *wrb_params) {struct ethhdr *eh = (struct ethhdr *)(*skb)->data;bool os2bmc = false;
@@ -1361,7 +1362,7 @@ done:* to BMC, asic expects the vlan to be inline in the packet. */ if (os2bmc) - *skb =be_insert_vlan_in_pkt (adapter, *skb,NULL ); + *skb =be_insert_vlan_in_pkt (adapter, *skb, wrb_params);return os2bmc; }
@@ -1388,7 +1389,7 @@ static netdev_tx_t be_xmit(struct sk_buf/* if os2bmc is enabled and if the pkt is destined to bmc, * enqueue the pkt a 2nd time with mgmt bit set. */ -if (be_send_pkt_to_bmc (adapter, &skb)) { +if (be_send_pkt_to_bmc (adapter, &skb, &wrb_params)) {BE_WRB_F_SET (wrb_params.features,OS2BMC ,1 ); wrb_cnt =be_xmit_enqueue (adapter, txo, skb, &wrb_params);if (unlikely (!wrb_cnt))
Greg Kroah-Hartman
maintainerPATCH 219/300 Input: cros_ec_keyb - fix an invalid memory access
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tzung-Bi Shih <[email protected]>
commit e08969c4d65ac31297fcb4d31d4808c789152f68 upstream.
If cros_ec_keyb_register_matrix() isn't called (due to buttons_switches_only) in cros_ec_keyb_probe(), ckdev->idev remains NULL. An invalid memory access is observed in cros_ec_keyb_process() when receiving an EC_MKBP_EVENT_KEY_MATRIX event in cros_ec_keyb_work() in such case.
Unable to handle kernel read from unreadable memory at virtual address 0000000000000028 ... x3 : 0000000000000000 x2 : 0000000000000000 x1 : 0000000000000000 x0 : 0000000000000000 Call trace: input_event cros_ec_keyb_work blocking_notifier_call_chain ec_irq_thread
It's still unknown about why the kernel receives such malformed event, in any cases, the kernel shouldn't access ckdev->idev and friends if the driver doesn't intend to initialize them.
--- drivers/input/keyboard/cros_ec_keyb.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/input/keyboard/cros_ec_keyb.c +6 -0
@@ -242,6 +242,12 @@ static int cros_ec_keyb_work(struct noticase EC_MKBP_EVENT_KEY_MATRIX :pm_wakeup_event (ckdev->dev,0 ); +if (!ckdev->idev) { +dev_warn_once (ckdev->dev, +"Unexpected key matrix event\n" ); +return NOTIFY_OK ; + } +if (ckdev->ec->event_size != ckdev->cols) {dev_err (ckdev->dev,"Discarded incomplete key matrix event.\n" );
Greg Kroah-Hartman
maintainerPATCH 220/300 Input: imx_sc_key - fix memory corruption on unload
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit d83f1512758f4ef6fc5e83219fe7eeeb6b428ea4 upstream.
This is supposed to be "priv" but we accidentally pass "&priv" which is an address in the stack and so it will lead to memory corruption when the imx_sc_key_action() function is called. Remove the &.
--- drivers/input/keyboard/imx_sc_key.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/keyboard/imx_sc_key.c +1 -1
@@ -158,7 +158,7 @@ static int imx_sc_key_probe(struct platfreturn error; } - error =devm_add_action_or_reset (&pdev->dev, imx_sc_key_action, &priv); + error =devm_add_action_or_reset (&pdev->dev, imx_sc_key_action, priv);if (error)return error;
Greg Kroah-Hartman
maintainerPATCH 221/300 nvme: nvme-fc: Ensure ->ioerr_work is cancelled in nvme_fc_delete_ctrl()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ewan D. Milne <[email protected]>
commit 0a2c5495b6d1ecb0fa18ef6631450f391a888256 upstream.
nvme_fc_delete_assocation() waits for pending I/O to complete before returning, and an error can cause ->ioerr_work to be queued after cancel_work_sync() had been called. Move the call to cancel_work_sync() to be after nvme_fc_delete_association() to ensure ->ioerr_work is not running when the nvme_fc_ctrl object is freed. Otherwise the following can occur:
[ 1135.911754] list_del corruption, ff2d24c8093f31f8->next is NULL [ 1135.917705] ------------[ cut here ]------------ [ 1135.922336] kernel BUG at lib/list_debug.c:52! [ 1135.926784] Oops: invalid opcode: 0000 [#1] SMP NOPTI [ 1135.931851] CPU: 48 UID: 0 PID: 726 Comm: kworker/u449:23 Kdump: loaded Not tainted 6.12.0 #1 PREEMPT(voluntary) [ 1135.943490] Hardware name: Dell Inc. PowerEdge R660/0HGTK9, BIOS 2.5.4 01/16/2025 [ 1135.950969] Workqueue: 0x0 (nvme-wq) [ 1135.954673] RIP: 0010:__list_del_entry_valid_or_report.cold+0xf/0x6f [ 1135.961041] Code: c7 c7 98 68 72 94 e8 26 45 fe ff 0f 0b 48 c7 c7 70 68 72 94 e8 18 45 fe ff 0f 0b 48 89 fe 48 c7 c7 80 69 72 94 e8 07 45 fe ff <0f> 0b 48 89 d1 48 c7 c7 a0 6a 72 94 48 89 c2 e8 f3 44 fe ff 0f 0b [ 1135.979788] RSP: 0018:ff579b19482d3e50 EFLAGS: 00010046 [ 1135.985015] RAX: 0000000000000033 RBX: ff2d24c8093f31f0 RCX: 0000000000000000 [ 1135.992148] RDX: 0000000000000000 RSI: ff2d24d6bfa1d0c0 RDI: ff2d24d6bfa1d0c0 [ 1135.999278] RBP: ff2d24c8093f31f8 R08: 0000000000000000 R09: ffffffff951e2b08 [ 1136.006413] R10: ffffffff95122ac8 R11: 0000000000000003 R12: ff2d24c78697c100 [ 1136.013546] R13: fffffffffffffff8 R14: 0000000000000000 R15: ff2d24c78697c0c0 [ 1136.020677] FS: 0000000000000000(0000) GS:ff2d24d6bfa00000(0000) knlGS:0000000000000000 [ 1136.028765] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1136.034510] CR2: 00007fd207f90b80 CR3: 000000163ea22003 CR4: 0000000000f73ef0 [ 1136.041641] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 1136.048776] DR3: 0000000000000000 DR6: 00000000fffe07f0 DR7: 0000000000000400 [ 1136.055910] PKRU: 55555554 [ 1136.058623] Call Trace: [ 1136.061074] <TASK> [ 1136.063179] ? show_trace_log_lvl+0x1b0/0x2f0 [ 1136.067540] ? show_trace_log_lvl+0x1b0/0x2f0 [ 1136.071898] ? move_linked_works+0x4a/0xa0 [ 1136.075998] ? __list_del_entry_valid_or_report.cold+0xf/0x6f [ 1136.081744] ? __die_body.cold+0x8/0x12 [ 1136.085584] ? die+0x2e/0x50 [ 1136.088469] ? do_trap+0xca/0x110 [ 1136.091789] ? do_error_trap+0x65/0x80 [ 1136.095543] ? __list_del_entry_valid_or_report.cold+0xf/0x6f [ 1136.101289] ? exc_invalid_op+0x50/0x70 [ 1136.105127] ? __list_del_entry_valid_or_report.cold+0xf/0x6f [ 1136.110874] ? asm_exc_invalid_op+0x1a/0x20 [ 1136.115059] ? __list_del_entry_valid_or_report.cold+0xf/0x6f [ 1136.120806] move_linked_works+0x4a/0xa0 [ 1136.124733] worker_thread+0x216/0x3a0 [ 1136.128485] ? __pfx_worker_thread+0x10/0x10 [ 1136.132758] kthread+0xfa/0x240 [ 1136.135904] ? __pfx_kthread+0x10/0x10 [ 1136.139657] ret_from_fork+0x31/0x50 [ 1136.143236] ? __pfx_kthread+0x10/0x10 [ 1136.146988] ret_from_fork_asm+0x1a/0x30 [ 1136.150915] </TASK>
--- drivers/nvme/host/fc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/fc.c +1 -1
@@ -3257,7 +3257,6 @@ nvme_fc_delete_ctrl(struct nvme_ctrl *nc {struct nvme_fc_ctrl *ctrl =to_fc_ctrl (nctrl); -cancel_work_sync (&ctrl->ioerr_work);cancel_delayed_work_sync (&ctrl->connect_work);/* * kill the association on the link side. this will block
@@ -3321,6 +3320,7 @@ nvme_fc_reset_ctrl_work(struct work_stru/* will block will waiting for io to terminate */ nvme_fc_delete_association (ctrl); +cancel_work_sync (&ctrl->ioerr_work);if (!nvme_change_ctrl_state (&ctrl->ctrl,NVME_CTRL_CONNECTING )) dev_err(ctrl->ctrl.device,
Greg Kroah-Hartman
maintainerPATCH 222/300 scsi: sg: Do not sleep in atomic context
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bart Van Assche <[email protected]>
commit 90449f2d1e1f020835cba5417234636937dd657e upstream.
sg_finish_rem_req() calls blk_rq_unmap_user(). The latter function may sleep. Hence, call sg_finish_rem_req() with interrupts enabled instead of disabled.
--- drivers/scsi/sg.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/scsi/sg.c +9 -1
@@ -2235,9 +2235,17 @@ sg_remove_sfp_usercontext(struct work_stwrite_lock_irqsave (&sfp->rq_list_lock, iflags);while (!list_empty (&sfp->rq_list)) { srp =list_first_entry (&sfp->rq_list, Sg_request, entry); -sg_finish_rem_req (srp);list_del (&srp->entry); +write_unlock_irqrestore (&sfp->rq_list_lock, iflags); + +sg_finish_rem_req (srp); +/* +* sg_rq_end_io() uses srp->parentfp. Hence, only clear +* srp->parentfp after blk_mq_free_request() has been called. +*/ srp->parentfp =NULL ; + +write_lock_irqsave (&sfp->rq_list_lock, iflags); }write_unlock_irqrestore (&sfp->rq_list_lock, iflags);
Greg Kroah-Hartman
maintainerPATCH 223/300 scsi: target: tcm_loop: Fix segfault in tcm_loop_tpg_address_show()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hamza Mahfooz <[email protected]>
commit e6965188f84a7883e6a0d3448e86b0cf29b24dfc upstream.
If the allocation of tl_hba->sh fails in tcm_loop_driver_probe() and we attempt to dereference it in tcm_loop_tpg_address_show() we will get a segfault, see below for an example. So, check tl_hba->sh before dereferencing it.
Unable to allocate struct scsi_host
BUG: kernel NULL pointer dereference, address: 0000000000000194 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP NOPTI CPU: 1 PID: 8356 Comm: tokio-runtime-w Not tainted 6.6.104.2-4.azl3 #1 Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS Hyper-V UEFI Release v4.1 09/28/2024 RIP: 0010:tcm_loop_tpg_address_show+0x2e/0x50 [tcm_loop] ... Call Trace: <TASK> configfs_read_iter+0x12d/0x1d0 [configfs] vfs_read+0x1b5/0x300 ksys_read+0x6f/0xf0
...
--- drivers/target/loopback/tcm_loop.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/target/loopback/tcm_loop.c +3 -0
@@ -933,6 +933,9 @@ static ssize_t tcm_loop_tpg_address_show struct tcm_loop_tpg, tl_se_tpg);struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; +if (!tl_hba->sh) +return -ENODEV ; +return snprintf (page,PAGE_SIZE ,"%d:0:%d\n" , tl_hba->sh->host_no, tl_tpg->tl_tpgt); }
Greg Kroah-Hartman
maintainerPATCH 224/300 MIPS: Malta: Fix !EVA SOC-it PCI MMIO
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maciej W. Rozycki <[email protected]>
commit ebd729fef31620e0bf74cbf8a4c7fda73a2a4e7e upstream.
Fix a regression that has caused accesses to the PCI MMIO window to complete unclaimed in non-EVA configurations with the SOC-it family of system controllers, preventing PCI devices from working that use MMIO.
In the non-EVA case PHYS_OFFSET is set to 0, meaning that PCI_BAR0 is set with an empty mask (and PCI_HEAD4 matches addresses starting from 0 accordingly). Consequently all addresses are matched for incoming DMA accesses from PCI. This seems to confuse the system controller's logic and outgoing bus cycles targeting the PCI MMIO window seem not to make it to the intended devices.
This happens as well when a wider mask is used with PCI_BAR0, such as 0x80000000 or 0xe0000000, that makes addresses match that overlap with the PCI MMIO window, which starts at 0x10000000 in our configuration.
Set the mask in PCI_BAR0 to 0xf0000000 for non-EVA then, covering the non-EVA maximum 256 MiB of RAM, which is what YAMON does and which used to work correctly up to the offending commit. Set PCI_P2SCMSKL to match PCI_BAR0 as required by the system controller's specification, and match PCI_P2SCMAPL to PCI_HEAD4 for identity mapping.
Verified with:
Core board type/revision = 0x0d (Core74K) / 0x01 System controller/revision = MIPS SOC-it 101 OCP / 1.3 SDR-FW-4:1 Processor Company ID/options = 0x01 (MIPS Technologies, Inc.) / 0x1c Processor ID/revision = 0x97 (MIPS 74Kf) / 0x4c
for non-EVA and with:
Core board type/revision = 0x0c (CoreFPGA-5) / 0x00 System controller/revision = MIPS ROC-it2 / 0.0 FW-1:1 (CLK_unknown) GIC Processor Company ID/options = 0x01 (MIPS Technologies, Inc.) / 0x00 Processor ID/revision = 0xa0 (MIPS interAptiv UP) / 0x20
for EVA/non-EVA, fixing:
defxx 0000:00:12.0: assign IRQ: got 10
defxx: v1.12 2021/03/10 Lawrence V. Stefani and others 0000:00:12.0: Could not read adapter factory MAC address!
vs:
defxx 0000:00:12.0: assign IRQ: got 10
defxx: v1.12 2021/03/10 Lawrence V. Stefani and others
0000:00:12.0: DEFPA at MMIO addr = 0x10142000, IRQ = 10, Hardware addr = 00-00-f8-xx-xx-xx 0000:00:12.0: registered as fddi0
for non-EVA and causing no change for EVA.
--- arch/mips/mti-malta/malta-init.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
arch/mips/mti-malta/malta-init.c +13 -7
@@ -242,16 +242,22 @@ mips_pci_controller:#endif /* -* Setup the Malta max (2GB) memory for PCI DMA in host bridge -* in transparent addressing mode. +* Set up memory mapping in host bridge for PCI DMA masters, +* in transparent addressing mode. For EVA use the Malta +* maximum of 2 GiB memory in the alias space at 0x80000000 +* as per PHYS_OFFSET. Otherwise use 256 MiB of memory in +* the regular space, avoiding mapping the PCI MMIO window +* for DMA as it seems to confuse the system controller's +* logic, causing PCI MMIO to stop working. */ - mask =PHYS_OFFSET |PCI_BASE_ADDRESS_MEM_PREFETCH ; -MSC_WRITE (MSC01_PCI_BAR0 , mask); -MSC_WRITE (MSC01_PCI_HEAD4 , mask); + mask =PHYS_OFFSET ?PHYS_OFFSET :0xf0000000 ; +MSC_WRITE (MSC01_PCI_BAR0 , + mask |PCI_BASE_ADDRESS_MEM_PREFETCH ); +MSC_WRITE (MSC01_PCI_HEAD4 , +PHYS_OFFSET |PCI_BASE_ADDRESS_MEM_PREFETCH ); - mask &=MSC01_PCI_BAR0_SIZE_MSK ;MSC_WRITE (MSC01_PCI_P2SCMSKL , mask); -MSC_WRITE (MSC01_PCI_P2SCMAPL , mask); +MSC_WRITE (MSC01_PCI_P2SCMAPL ,PHYS_OFFSET );/* Don't handle target retries indefinitely. */ if ((data & MSC01_PCI_CFG_MAXRTRY_MSK) ==
Greg Kroah-Hartman
maintainerPATCH 225/300 drm/tegra: dc: Fix reference leak in tegra_dc_couple()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ma Ke <[email protected]>
commit 4c5376b4b143c4834ebd392aef2215847752b16a upstream.
driver_find_device() calls get_device() to increment the reference count once a matching device is found, but there is no put_device() to balance the reference count. To avoid reference count leakage, add put_device() to decrease the reference count.
Found by code review.
--- drivers/gpu/drm/tegra/dc.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/tegra/dc.c +1 -0
@@ -2524,6 +2524,7 @@ static int tegra_dc_couple(struct tegra_ dc->client.parent = &parent->client;dev_dbg (dc->dev,"coupled to %s\n" ,dev_name (companion)); +put_device (companion); }return 0 ;
Greg Kroah-Hartman
maintainerPATCH 226/300 mlxsw: spectrum: Fix memory leak in mlxsw_sp_flower_stats()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zilin Guan <[email protected]>
[ Upstream commit 407a06507c2358554958e8164dc97176feddcafc ]
The function mlxsw_sp_flower_stats() calls mlxsw_sp_acl_ruleset_get() to obtain a ruleset reference. If the subsequent call to mlxsw_sp_acl_rule_lookup() fails to find a rule, the function returns an error without releasing the ruleset reference, causing a memory leak.
Fix this by using a goto to the existing error handling label, which calls mlxsw_sp_acl_ruleset_put() to properly release the reference.
--- drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c +4 -2
@@ -650,8 +650,10 @@ int mlxsw_sp_flower_stats(struct mlxsw_sp *mlxsw_sp,return -EINVAL ; rule =mlxsw_sp_acl_rule_lookup (mlxsw_sp, ruleset, f->cookie); -if (!rule) -return -EINVAL ; +if (!rule) { + err = -EINVAL ; + goto err_rule_get_stats; + } err =mlxsw_sp_acl_rule_get_stats (mlxsw_sp, rule, &packets, &bytes, &drops, &lastuse, &used_hw_stats);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 227/300 net: openvswitch: remove never-working support for setting nsh fields
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilya Maximets <[email protected]>
[ Upstream commit dfe28c4167a9259fc0c372d9f9473e1ac95cff67 ]
The validation of the set(nsh(...)) action is completely wrong. It runs through the nsh_key_put_from_nlattr() function that is the same function that validates NSH keys for the flow match and the push_nsh() action. However, the set(nsh(...)) has a very different memory layout. Nested attributes in there are doubled in size in case of the masked set(). That makes proper validation impossible.
There is also confusion in the code between the 'masked' flag, that says that the nested attributes are doubled in size containing both the value and the mask, and the 'is_mask' that says that the value we're parsing is the mask. This is causing kernel crash on trying to write into mask part of the match with SW_FLOW_KEY_PUT() during validation, while validate_nsh() doesn't allocate any memory for it:
BUG: kernel NULL pointer dereference, address: 0000000000000018 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 1c2383067 P4D 1c2383067 PUD 20b703067 PMD 0 Oops: Oops: 0000 [#1] SMP NOPTI CPU: 8 UID: 0 Kdump: loaded Not tainted 6.17.0-rc4+ #107 PREEMPT(voluntary) RIP: 0010:nsh_key_put_from_nlattr+0x19d/0x610 [openvswitch] Call Trace: <TASK> validate_nsh+0x60/0x90 [openvswitch] validate_set.constprop.0+0x270/0x3c0 [openvswitch] __ovs_nla_copy_actions+0x477/0x860 [openvswitch] ovs_nla_copy_actions+0x8d/0x100 [openvswitch] ovs_packet_cmd_execute+0x1cc/0x310 [openvswitch] genl_family_rcv_msg_doit+0xdb/0x130 genl_family_rcv_msg+0x14b/0x220 genl_rcv_msg+0x47/0xa0 netlink_rcv_skb+0x53/0x100 genl_rcv+0x24/0x40 netlink_unicast+0x280/0x3b0 netlink_sendmsg+0x1f7/0x430 ____sys_sendmsg+0x36b/0x3a0 ___sys_sendmsg+0x87/0xd0 __sys_sendmsg+0x6d/0xd0 do_syscall_64+0x7b/0x2c0 entry_SYSCALL_64_after_hwframe+0x76/0x7e
The third issue with this process is that while trying to convert the non-masked set into masked one, validate_set() copies and doubles the size of the OVS_KEY_ATTR_NSH as if it didn't have any nested attributes. It should be copying each nested attribute and doubling them in size independently. And the process must be properly reversed during the conversion back from masked to a non-masked variant during the flow dump.
In the end, the only two outcomes of trying to use this action are either validation failure or a kernel crash. And if somehow someone manages to install a flow with such an action, it will most definitely not do what it is supposed to, since all the keys and the masks are mixed up.
Fixing all the issues is a complex task as it requires re-writing most of the validation code.
Given that and the fact that this functionality never worked since introduction, let's just remove it altogether. It's better to re-introduce it later with a proper implementation instead of trying to fix it in stable releases.
--- net/openvswitch/actions.c | 68 +--------------------------------- net/openvswitch/flow_netlink.c | 64 ++++---------------------------- net/openvswitch/flow_netlink.h | 2 - 3 files changed, 9 insertions(+), 125 deletions(-)
net/openvswitch/actions.c +1 -67
@@ -594,69 +594,6 @@ static int set_ipv6(struct sk_buff *skb, struct sw_flow_key *flow_key,return 0 ; } -static int set_nsh (struct sk_buff *skb,struct sw_flow_key *flow_key, -const struct nlattr *a) -{ -struct nshhdr *nh; -size_t length; -int err; -u8 flags; -u8 ttl; -int i; - -struct ovs_key_nsh key; -struct ovs_key_nsh mask; - - err =nsh_key_from_nlattr (a, &key, &mask); -if (err) -return err; - -/* Make sure the NSH base header is there */ -if (!pskb_may_pull (skb,skb_network_offset (skb) +NSH_BASE_HDR_LEN )) -return -ENOMEM ; - - nh =nsh_hdr (skb); - length =nsh_hdr_len (nh); - -/* Make sure the whole NSH header is there */ - err =skb_ensure_writable (skb,skb_network_offset (skb) + - length); -if (unlikely (err)) -return err; - - nh =nsh_hdr (skb); -skb_postpull_rcsum (skb, nh, length); - flags =nsh_get_flags (nh); - flags =OVS_MASKED (flags, key.base.flags, mask.base.flags); - flow_key->nsh.base.flags = flags; - ttl =nsh_get_ttl (nh); - ttl =OVS_MASKED (ttl, key.base.ttl, mask.base.ttl); - flow_key->nsh.base.ttl = ttl; -nsh_set_flags_and_ttl (nh, flags, ttl); - nh->path_hdr =OVS_MASKED (nh->path_hdr, key.base.path_hdr, - mask.base.path_hdr); - flow_key->nsh.base.path_hdr = nh->path_hdr; -switch (nh->mdtype) { -case NSH_M_TYPE1 : -for (i =0 ; i <NSH_MD1_CONTEXT_SIZE ; i++) { - nh->md1.context[i] = -OVS_MASKED (nh->md1.context[i], key.context[i], - mask.context[i]); - } -memcpy (flow_key->nsh.context, nh->md1.context, -sizeof (nh->md1.context)); -break ; -case NSH_M_TYPE2 : -memset (flow_key->nsh.context,0 , -sizeof (flow_key->nsh.context)); -break ; -default : -return -EINVAL ; - } -skb_postpush_rcsum (skb, nh, length); -return 0 ; -} -/* Must follow skb_ensure_writable() since that can move the skb data. */ static void set_tp_port (struct sk_buff *skb,__be16 *port,__be16 new_port,__sum16 *check)
@@ -1123,10 +1060,6 @@ static int execute_masked_set_action(struct sk_buff *skb, get_mask(a, struct ovs_key_ethernet *));break ; -case OVS_KEY_ATTR_NSH : - err =set_nsh (skb, flow_key, a); -break ; -case OVS_KEY_ATTR_IPV4 : err =set_ipv4 (skb, flow_key,nla_data (a), get_mask(a, struct ovs_key_ipv4 *));
@@ -1163,6 +1096,7 @@ static int execute_masked_set_action(struct sk_buff *skb,case OVS_KEY_ATTR_CT_LABELS :case OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV4 :case OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV6 : +case OVS_KEY_ATTR_NSH : err = -EINVAL ;break ; }
net/openvswitch/flow_netlink.c +8 -56
105 lines not on this page · raw message
net/openvswitch/flow_netlink.h +0 -2
@@ -65,8 +65,6 @@ int ovs_nla_put_actions(const struct nlattr *attr,void ovs_nla_free_flow_actions (struct sw_flow_actions *);void ovs_nla_free_flow_actions_rcu (struct sw_flow_actions *); -int nsh_key_from_nlattr (const struct nlattr *attr,struct ovs_key_nsh *nsh, -struct ovs_key_nsh *nsh_mask);int nsh_hdr_from_nlattr (const struct nlattr *attr,struct nshhdr *nh,size_t size);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 228/300 s390/ctcm: Fix double-kfree
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aleksei Nikiforov <[email protected]>
[ Upstream commit da02a1824884d6c84c5e5b5ac373b0c9e3288ec2 ]
The function 'mpc_rcvd_sweep_req(mpcginfo)' is called conditionally from function 'ctcmpc_unpack_skb'. It frees passed mpcginfo. After that a call to function 'kfree' in function 'ctcmpc_unpack_skb' frees it again.
Remove 'kfree' call in function 'mpc_rcvd_sweep_req(mpcginfo)'.
Bug detected by the clang static analyzer.
--- drivers/s390/net/ctcm_mpc.c | 1 - 1 file changed, 1 deletion(-)
drivers/s390/net/ctcm_mpc.c +0 -1
@@ -712,7 +712,6 @@ static void mpc_rcvd_sweep_req(struct mpcg_info *mpcginfo) grp->sweep_req_pend_num--;ctcmpc_send_sweep_resp (ch); -kfree (mpcginfo);return ; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 229/300 vsock: Ignore signal/timeout on connect() if already established
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Luczaj <[email protected]>
[ Upstream commit 002541ef650b742a198e4be363881439bb9d86b4 ]
During connect(), acting on a signal/timeout by disconnecting an already established socket leads to several issues:
1. connect() invoking vsock_transport_cancel_pkt() -> virtio_transport_purge_skbs() may race with sendmsg() invoking virtio_transport_get_credit(). This results in a permanently elevated vvs->bytes_unsent. Which, in turn, confuses the SOCK_LINGER handling.
2. connect() resetting a connected socket's state may race with socket being placed in a sockmap. A disconnected socket remaining in a sockmap breaks sockmap's assumptions. And gives rise to WARNs.
3. connect() transitioning SS_CONNECTED -> SS_UNCONNECTED allows for a transport change/drop after TCP_ESTABLISHED. Which poses a problem for any simultaneous sendmsg() or connect() and may result in a use-after-free/null-ptr-deref.
Do not disconnect socket on signal/timeout. Keep the logic for unconnected
sockets: they don't linger, can't be placed in a sockmap, are rejected by sendmsg().
[1]: https://lore.kernel.org/netdev/[email protected]/
[2]: https://lore.kernel.org/netdev/[email protected]/
[3]: https://lore.kernel.org/netdev/[email protected]/
--- net/vmw_vsock/af_vsock.c | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-)
net/vmw_vsock/af_vsock.c +31 -9
@@ -1464,18 +1464,40 @@ static int vsock_stream_connect(struct socket *sock, struct sockaddr *addr, timeout =schedule_timeout (timeout);lock_sock (sk); -if (signal_pending (current)) { - err =sock_intr_errno (timeout); - sk->sk_state = sk->sk_state ==TCP_ESTABLISHED ?TCP_CLOSING :TCP_CLOSE ; - sock->state =SS_UNCONNECTED ; -vsock_transport_cancel_pkt (vsk); -vsock_remove_connected (vsk); - goto out_wait; - }else if ((sk->sk_state !=TCP_ESTABLISHED ) && (timeout ==0 )) { - err = -ETIMEDOUT ; +/* Connection established. Whatever happens to socket once we +* release it, that's not connect()'s concern. No need to go +* into signal and timeout handling. Call it a day. +* +* Note that allowing to "reset" an already established socket +* here is racy and insecure. +*/ +if (sk->sk_state ==TCP_ESTABLISHED ) +break ; + +/* If connection was _not_ established and a signal/timeout came +* to be, we want the socket's state reset. User space may want +* to retry. +* +* sk_state != TCP_ESTABLISHED implies that socket is not on +* vsock_connected_table. We keep the binding and the transport +* assigned. +*/ +if (signal_pending (current) || timeout ==0 ) { + err = timeout ==0 ? -ETIMEDOUT :sock_intr_errno (timeout); + +/* Listener might have already responded with +* VIRTIO_VSOCK_OP_RESPONSE. Its handling expects our +* sk_state == TCP_SYN_SENT, which hereby we break. +* In such case VIRTIO_VSOCK_OP_RST will follow. +*/ sk->sk_state =TCP_CLOSE ; sock->state =SS_UNCONNECTED ; + +/* Try to cancel VIRTIO_VSOCK_OP_REQUEST skb sent out by +* transport->connect(). +*/ vsock_transport_cancel_pkt (vsk); + goto out_wait; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 230/300 scsi: core: Fix a regression triggered by scsi_host_busy()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bart Van Assche <[email protected]>
[ Upstream commit a0b7780602b1b196f47e527fec82166a7e67c4d0 ]
Commit 995412e23bb2 ("blk-mq: Replace tags->lock with SRCU for tag iterators") introduced the following regression:
Call trace: __srcu_read_lock+0x30/0x80 (P) blk_mq_tagset_busy_iter+0x44/0x300 scsi_host_busy+0x38/0x70 ufshcd_print_host_state+0x34/0x1bc ufshcd_link_startup.constprop.0+0xe4/0x2e0 ufshcd_init+0x944/0xf80 ufshcd_pltfrm_init+0x504/0x820 ufs_rockchip_probe+0x2c/0x88 platform_probe+0x5c/0xa4 really_probe+0xc0/0x38c __driver_probe_device+0x7c/0x150 driver_probe_device+0x40/0x120 __driver_attach+0xc8/0x1e0 bus_for_each_dev+0x7c/0xdc driver_attach+0x24/0x30 bus_add_driver+0x110/0x230 driver_register+0x68/0x130 __platform_driver_register+0x20/0x2c ufs_rockchip_pltform_init+0x1c/0x28 do_one_initcall+0x60/0x1e0 kernel_init_freeable+0x248/0x2c4 kernel_init+0x20/0x140 ret_from_fork+0x10/0x20
Fix this regression by making scsi_host_busy() check whether the SCSI host tag set has already been initialized. tag_set->ops is set by scsi_mq_setup_tags() just before blk_mq_alloc_tag_set() is called. This fix is based on the assumption that scsi_host_busy() and scsi_mq_setup_tags() calls are serialized. This is the case in the UFS driver.
--- drivers/scsi/hosts.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/scsi/hosts.c +3 -2
@@ -598,8 +598,9 @@ int scsi_host_busy(struct Scsi_Host *shost) {int cnt =0 ; -blk_mq_tagset_busy_iter (&shost->tag_set, - scsi_host_check_in_flight, &cnt); +if (shost->tag_set.ops) +blk_mq_tagset_busy_iter (&shost->tag_set, + scsi_host_check_in_flight, &cnt);return cnt; }EXPORT_SYMBOL (scsi_host_busy);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 231/300 net: tls: Cancel RX async resync request on rcd_delta overflow
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shahar Shitrit <[email protected]>
[ Upstream commit c15d5c62ab313c19121f10e25d4fec852bd1c40c ]
When a netdev issues a RX async resync request for a TLS connection, the TLS module handles it by logging record headers and attempting to match them to the tcp_sn provided by the device. If a match is found, the TLS module approves the tcp_sn for resynchronization.
While waiting for a device response, the TLS module also increments rcd_delta each time a new TLS record is received, tracking the distance from the original resync request.
However, if the device response is delayed or fails (e.g due to unstable connection and device getting out of tracking, hardware errors, resource exhaustion etc.), the TLS module keeps logging and incrementing, which can lead to a WARN() when rcd_delta exceeds the threshold.
To address this, introduce tls_offload_rx_resync_async_request_cancel() to explicitly cancel resync requests when a device response failure is detected. Call this helper also as a final safeguard when rcd_delta crosses its threshold, as reaching this point implies that earlier cancellation did not occur.
--- include/net/tls.h | 6 ++++++ net/tls/tls_device.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-)
include/net/tls.h +6 -0
@@ -674,6 +674,12 @@ tls_offload_rx_resync_async_request_end(struct sock *sk, __be32 seq) ((u64)ntohl(seq) << 32) | RESYNC_REQ); } +static inline void +tls_offload_rx_resync_async_request_cancel (struct tls_offload_resync_async *resync_async) +{ +atomic64_set (&resync_async->req,0 ); +} +static inline void tls_offload_rx_resync_set_type (struct sock *sk,enum tls_offload_sync_type type) {
net/tls/tls_device.c +3 -1
@@ -710,8 +710,10 @@ tls_device_rx_resync_async(struct tls_offload_resync_async *resync_async,/* shouldn't get to wraparound: * too long in async stage, something bad happened */ -if (WARN_ON_ONCE (resync_async->rcd_delta ==USHRT_MAX )) +if (WARN_ON_ONCE (resync_async->rcd_delta ==USHRT_MAX )) { +tls_offload_rx_resync_async_request_cancel (resync_async);return false; + }/* asynchronous stage: log all headers seq such that * req_seq <= seq <= end_seq, and wait for real resync request
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 232/300 kconfig/mconf: Initialize the default locale at startup
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jakub Horký <[email protected]>
[ Upstream commit 3927c4a1084c48ef97f11281a0a43ecb2cb4d6f1 ]
Fix bug where make menuconfig doesn't initialize the default locale, which causes ncurses menu borders to be displayed incorrectly (lqqqqk) in UTF-8 terminals that don't support VT100 ACS by default, such as PuTTY.
--- scripts/kconfig/mconf.c | 3 +++ 1 file changed, 3 insertions(+)
scripts/kconfig/mconf.c +3 -0
@@ -12,6 +12,7 @@#include <errno.h> #include <fcntl.h> #include <limits.h> +#include <locale.h> #include <stdarg.h> #include <stdlib.h> #include <string.h>
@@ -1008,6 +1009,8 @@ int main(int ac, char **av)signal (SIGINT , sig_handler); +setlocale (LC_ALL ,"" ); +if (ac >1 &&strcmp (av[1 ],"-s" ) ==0 ) { silent =1 ;/* Silence conf_read() until the real callback is set up */
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 233/300 kconfig/nconf: Initialize the default locale at startup
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jakub Horký <[email protected]>
[ Upstream commit 43c2931a95e6b295bfe9e3b90dbe0f7596933e91 ]
Fix bug where make nconfig doesn't initialize the default locale, which causes ncurses menu borders to be displayed incorrectly (lqqqqk) in UTF-8 terminals that don't support VT100 ACS by default, such as PuTTY.
--- scripts/kconfig/nconf.c | 3 +++ 1 file changed, 3 insertions(+)
scripts/kconfig/nconf.c +3 -0
@@ -7,6 +7,7 @@#ifndef _GNU_SOURCE#define _GNU_SOURCE#endif +#include <locale.h> #include <string.h> #include <strings.h> #include <stdlib.h>
@@ -1478,6 +1479,8 @@ int main(int ac, char **av)int lines, columns;char *mode; +setlocale (LC_ALL ,"" ); +if (ac >1 &&strcmp (av[1 ],"-s" ) ==0 ) {/* Silence conf_read() until the real callback is set up */ conf_set_message_callback (NULL );
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 234/300 mm/mm_init: fix hash table order logging in alloc_large_system_hash()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Isaac J. Manjarres <[email protected]>
[ Upstream commit 0d6c356dd6547adac2b06b461528e3573f52d953 ]
When emitting the order of the allocation for a hash table, alloc_large_system_hash() unconditionally subtracts PAGE_SHIFT from log base 2 of the allocation size. This is not correct if the allocation size is smaller than a page, and yields a negative value for the order as seen below:
TCP established hash table entries: 32 (order: -4, 256 bytes, linear) TCP bind hash table entries: 32 (order: -2, 1024 bytes, linear)
Use get_order() to compute the order when emitting the hash table information to correctly handle cases where the allocation size is smaller than a page:
TCP established hash table entries: 32 (order: 0, 256 bytes, linear) TCP bind hash table entries: 32 (order: 0, 1024 bytes, linear)
--- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_alloc.c +1 -1
@@ -8372,7 +8372,7 @@ void *__init alloc_large_system_hash(const char *tablename,panic ("Failed to allocate %s hash table\n" , tablename);pr_info ("%s hash table entries: %ld (order: %d, %lu bytes, %s)\n" , - tablename,1UL << log2qty,ilog2 (size) -PAGE_SHIFT , size, + tablename,1UL << log2qty,get_order (size), size, virt ?"vmalloc" :"linear" );if (_hash_shift)
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 235/300 ALSA: usb-audio: fix uac2 clock source at terminal parser
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: René Rebe <[email protected]>
[ Upstream commit d26e9f669cc0a6a85cf17180c09a6686db9f4002 ]
Since 8b3a087f7f65 ("ALSA: usb-audio: Unify virtual type units type to UAC3 values") usb-audio is using UAC3_CLOCK_SOURCE instead of bDescriptorSubtype, later refactored with e0ccdef9265 ("ALSA: usb-audio:
Clean up check_input_term()") into parse_term_uac2_clock_source().
This breaks the clock source selection for at least my 1397:0003 BEHRINGER International GmbH FCA610 Pro.
Fix by using UAC2_CLOCK_SOURCE in parse_term_uac2_clock_source().
--- sound/usb/mixer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/usb/mixer.c +1 -1
@@ -925,7 +925,7 @@ static int parse_term_uac2_clock_source(struct mixer_build *state, {struct uac_clock_source_descriptor *d = p1; - term->type =UAC3_CLOCK_SOURCE <<16 ;/* virtual type */ + term->type =UAC2_CLOCK_SOURCE <<16 ;/* virtual type */ term->id = id; term->name = d->iClockSource;return 0 ;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 236/300 net: ethernet: ti: netcp: Standardize knav_dma_open_channel to return NULL on error
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nishanth Menon <[email protected]>
[ Upstream commit 90a88306eb874fe4bbdd860e6c9787f5bbc588b5 ]
Make knav_dma_open_channel consistently return NULL on error instead of ERR_PTR. Currently the header include/linux/soc/ti/knav_dma.h returns NULL when the driver is disabled, but the driver implementation does not even return NULL or ERR_PTR on failure, causing inconsistency in the users. This results in a crash in netcp_free_navigator_resources as followed (trimmed):
Unhandled fault: alignment exception (0x221) at 0xfffffff2 [fffffff2] *pgd=80000800207003, *pmd=82ffda003, *pte=00000000
Internal error: : 221 [#1] SMP ARM Modules linked in: CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.17.0-rc7 #1 NONE Hardware name: Keystone PC is at knav_dma_close_channel+0x30/0x19c LR is at netcp_free_navigator_resources+0x2c/0x28c
[... TRIM...]
Call trace: knav_dma_close_channel from netcp_free_navigator_resources+0x2c/0x28c netcp_free_navigator_resources from netcp_ndo_open+0x430/0x46c netcp_ndo_open from __dev_open+0x114/0x29c __dev_open from __dev_change_flags+0x190/0x208 __dev_change_flags from netif_change_flags+0x1c/0x58 netif_change_flags from dev_change_flags+0x38/0xa0 dev_change_flags from ip_auto_config+0x2c4/0x11f0 ip_auto_config from do_one_initcall+0x58/0x200 do_one_initcall from kernel_init_freeable+0x1cc/0x238 kernel_init_freeable from kernel_init+0x1c/0x12c kernel_init from ret_from_fork+0x14/0x38
[... TRIM...]
Standardize the error handling by making the function return NULL on all error conditions. The API is used in just the netcp_core.c so the impact is limited.
Note, this change, in effect reverts commit 5b6cb43b4d62 ("net:
ethernet: ti: netcp_core: return error while dma channel open issue"), but provides a less error prone implementation.
--- drivers/net/ethernet/ti/netcp_core.c | 10 +++++----- drivers/soc/ti/knav_dma.c | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-)
drivers/net/ethernet/ti/netcp_core.c +5 -5
@@ -1339,10 +1339,10 @@ int netcp_txpipe_open(struct netcp_tx_pipe *tx_pipe) tx_pipe->dma_channel =knav_dma_open_channel (dev, tx_pipe->dma_chan_name, &config); -if (IS_ERR (tx_pipe->dma_channel)) { +if (!tx_pipe->dma_channel) {dev_err (dev,"failed opening tx chan(%s)\n" , tx_pipe->dma_chan_name); - ret =PTR_ERR (tx_pipe->dma_channel); + ret = -EINVAL ; goto err; }
@@ -1360,7 +1360,7 @@ int netcp_txpipe_open(struct netcp_tx_pipe *tx_pipe)return 0 ; err: -if (!IS_ERR_OR_NULL (tx_pipe->dma_channel)) +if (tx_pipe->dma_channel)knav_dma_close_channel (tx_pipe->dma_channel); tx_pipe->dma_channel =NULL ;return ret;
@@ -1679,10 +1679,10 @@ static int netcp_setup_navigator_resources(struct net_device *ndev) netcp->rx_channel =knav_dma_open_channel (netcp->netcp_device->device, netcp->dma_chan_name, &config); -if (IS_ERR (netcp->rx_channel)) { +if (!netcp->rx_channel) {dev_err (netcp->ndev_dev,"failed opening rx chan(%s\n" , netcp->dma_chan_name); - ret =PTR_ERR (netcp->rx_channel); + ret = -EINVAL ; goto fail; }
drivers/soc/ti/knav_dma.c +7 -7
@@ -410,7 +410,7 @@ static int of_channel_match_helper(struct device_node *np, const char *name,* @name: slave channel name * @config: dma configuration parameters * -* Returns pointer to appropriate DMA channel on success or error. +* Return: Pointer to appropriate DMA channel on success or NULL on error. */ void *knav_dma_open_channel (struct device *dev,const char *name,struct knav_dma_cfg *config)
@@ -423,13 +423,13 @@ void *knav_dma_open_channel(struct device *dev, const char *name,if (!kdev) {pr_err ("keystone-navigator-dma driver not registered\n" ); -return (void *)-EINVAL ; +return NULL ; } chan_num =of_channel_match_helper (dev->of_node, name, &instance);if (chan_num <0 ) {dev_err (kdev->dev,"No DMA instance with name %s\n" , name); -return (void *)-EINVAL ; +return NULL ; } dev_dbg(kdev->dev, "initializing %s channel %d from DMA %s\n",
@@ -440,7 +440,7 @@ void *knav_dma_open_channel(struct device *dev, const char *name,if (config->direction !=DMA_MEM_TO_DEV && config->direction !=DMA_DEV_TO_MEM ) {dev_err (kdev->dev,"bad direction\n" ); -return (void *)-EINVAL ; +return NULL ; }/* Look for correct dma instance */
@@ -452,7 +452,7 @@ void *knav_dma_open_channel(struct device *dev, const char *name, }if (!found) {dev_err (kdev->dev,"No DMA instance with name %s\n" , instance); -return (void *)-EINVAL ; +return NULL ; }/* Look for correct dma channel from dma instance */
@@ -473,14 +473,14 @@ void *knav_dma_open_channel(struct device *dev, const char *name,if (!found) {dev_err (kdev->dev,"channel %d is not in DMA %s\n" , chan_num, instance); -return (void *)-EINVAL ; +return NULL ; }if (atomic_read (&chan->ref_count) >=1 ) {if (!check_config (chan, config)) {dev_err (kdev->dev,"channel %d config miss-match\n" , chan_num); -return (void *)-EINVAL ; +return NULL ; } }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 237/300 uio_hv_generic: Set event for all channels on the device
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Long Li <[email protected]>
commit d062463edf1770427dc2d637df4088df4835aa47 upstream.
Hyper-V may offer a non latency sensitive device with subchannels without monitor bit enabled. The decision is entirely on the Hyper-V host not configurable within guest.
When a device has subchannels, also signal events for the subchannel if its monitor bit is disabled.
This patch also removes the memory barrier when monitor bit is enabled as it is not necessary. The memory barrier is only needed between setting up interrupt mask and calling vmbus_set_event() when monitor bit is disabled.
--- drivers/uio/uio_hv_generic.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)
drivers/uio/uio_hv_generic.c +17 -4
@@ -80,9 +80,15 @@ hv_uio_irqcontrol(struct uio_info *info, {struct hv_uio_private_data *pdata = info->priv;struct hv_device *dev = pdata->device; +struct vmbus_channel *primary, *sc; - dev->channel->inbound.ring_buffer->interrupt_mask = !irq_state; -virt_mb (); + primary = dev->channel; + primary->inbound.ring_buffer->interrupt_mask = !irq_state; + +mutex_lock (&vmbus_connection.channel_mutex); +list_for_each_entry (sc, &primary->sc_list, sc_list) + sc->inbound.ring_buffer->interrupt_mask = !irq_state; +mutex_unlock (&vmbus_connection.channel_mutex);return 0 ; }
@@ -93,11 +99,18 @@ hv_uio_irqcontrol(struct uio_info *info,static void hv_uio_channel_cb (void *context) {struct vmbus_channel *chan = context; -struct hv_device *hv_dev = chan->device_obj; -struct hv_uio_private_data *pdata =hv_get_drvdata (hv_dev); +struct hv_device *hv_dev; +struct hv_uio_private_data *pdata;virt_mb (); +/* +* The callback may come from a subchannel, in which case look +* for the hv device in the primary channel +*/ + hv_dev = chan->primary_channel ? + chan->primary_channel->device_obj : chan->device_obj; + pdata =hv_get_drvdata (hv_dev);uio_event_notify (&pdata->info); }
Greg Kroah-Hartman
maintainerPATCH 238/300 net: qede: Initialize qede_ll_ops with designated initializer
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nathan Chancellor <[email protected]>
commit 6b3ab7f2cbfaeb6580709cd8ef4d72cfd01bfde4 upstream.
After a recent change [1] in clang's randstruct implementation to randomize structures that only contain function pointers, there is an error because qede_ll_ops get randomized but does not use a designated initializer for the first member:
drivers/net/ethernet/qlogic/qede/qede_main.c:206:2: error: a randomized struct can only be initialized with a designated initializer
206 | {
| ^Explicitly initialize the common member using a designated initializer to fix the build.
--- drivers/net/ethernet/qlogic/qede/qede_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/qlogic/qede/qede_main.c +1 -1
@@ -199,7 +199,7 @@ static struct pci_driver qede_pci_driver };static struct qed_eth_cb_ops qede_ll_ops = { - { + .common = { #ifdef CONFIG_RFS_ACCEL .arfs_filter_op = qede_arfs_filter_op, #endif
Greg Kroah-Hartman
maintainerPATCH 239/300 Makefile.compiler: replace cc-ifversion with compiler-specific macros
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nick Desaulniers <[email protected]>
commit 88b61e3bff93f99712718db785b4aa0c1165f35c upstream.
cc-ifversion is GCC specific. Replace it with compiler specific variants. Update the users of cc-ifversion to use these new macros.
[nathan: Backport to 5.10 and eliminate instances of cc-ifversion that
did not exist upstream when this change was original created]
--- Documentation/kbuild/makefiles.rst | 29 +++++++++++++++----------- Makefile | 4 ++- arch/mips/loongson64/Platform | 2 - arch/powerpc/Makefile | 4 ++- arch/s390/Makefile | 4 +-- drivers/gpu/drm/amd/display/dc/calcs/Makefile | 2 - drivers/gpu/drm/amd/display/dc/dcn20/Makefile | 2 - drivers/gpu/drm/amd/display/dc/dcn21/Makefile | 2 - drivers/gpu/drm/amd/display/dc/dcn30/Makefile | 2 - drivers/gpu/drm/amd/display/dc/dml/Makefile | 2 - drivers/gpu/drm/amd/display/dc/dsc/Makefile | 2 - scripts/Kbuild.include | 10 ++++++-- 12 files changed, 39 insertions(+), 26 deletions(-)
Documentation/kbuild/makefiles.rst +17 -12
@@ -552,22 +552,27 @@ more details, with real examples. In the above example, -Wno-unused-but-set-variable will be added to KBUILD_CFLAGS only if gcc really accepts it. - cc-ifversion - cc-ifversion tests the version of $(CC) and equals the fourth parameter - if version expression is true, or the fifth (if given) if the version - expression is false. + gcc-min-version + gcc-min-version tests if the value of $(CONFIG_GCC_VERSION) is greater than + or equal to the provided value and evaluates to y if so. Example:: - #fs/reiserfs/Makefile - ccflags-y := $(call cc-ifversion, -lt, 0402, -O1) + cflags-$(call gcc-min-version, 70100) := -foo - In this example, ccflags-y will be assigned the value -O1 if the - $(CC) version is less than 4.2. - cc-ifversion takes all the shell operators: - -eq, -ne, -lt, -le, -gt, and -ge - The third parameter may be a text as in this example, but it may also - be an expanded variable or a macro. + In this example, cflags-y will be assigned the value -foo if $(CC) is gcc and + $(CONFIG_GCC_VERSION) is >= 7.1. + + clang-min-version + clang-min-version tests if the value of $(CONFIG_CLANG_VERSION) is greater + than or equal to the provided value and evaluates to y if so. + + Example:: + + cflags-$(call clang-min-version, 110000) := -foo + + In this example, cflags-y will be assigned the value -foo if $(CC) is clang + and $(CONFIG_CLANG_VERSION) is >= 11.0.0. cc-cross-prefix cc-cross-prefix is used to check if there exists a $(CC) in path with
Makefile +3 -1
@@ -855,7 +855,9 @@ DEBUG_CFLAGS := # Workaround for GCC versions < 5.0 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61801 ifdef CONFIG_CC_IS_GCC -DEBUG_CFLAGS += $(call cc-ifversion, -lt, 0500, $(call cc-option, -fno-var-tracking-assignments)) +ifneq ($(call gcc-min-version, 50000),y) +DEBUG_CFLAGS += $(call cc-option, -fno-var-tracking-assignments) +endif endif ifdef CONFIG_DEBUG_INFO
arch/mips/loongson64/Platform +1 -1
@@ -12,7 +12,7 @@ cflags-$(CONFIG_CPU_LOONGSON64) += -Wa,- # by GAS. The cc-option can't probe for this behaviour so -march=loongson3a # can't easily be used safely within the kbuild framework. # -ifeq ($(call cc-ifversion, -ge, 0409, y), y) +ifeq ($(call gcc-min-version, 40900), y) ifeq ($(call ld-ifversion, -ge, 225000000, y), y) cflags-$(CONFIG_CPU_LOONGSON64) += \ $(call cc-option,-march=loongson3a -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64)
arch/powerpc/Makefile +3 -1
@@ -168,7 +168,9 @@ endif # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44199 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52828 ifndef CONFIG_CC_IS_CLANG -CC_FLAGS_FTRACE += $(call cc-ifversion, -lt, 0409, -mno-sched-epilog) +ifneq ($(call gcc-min-version, 40900),y) +CC_FLAGS_FTRACE += -mno-sched-epilog +endif endif endif
arch/s390/Makefile +2 -2
@@ -35,8 +35,8 @@ KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CON KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO_DWARF4), $(call cc-option, -gdwarf-4,)) ifdef CONFIG_CC_IS_GCC - ifeq ($(call cc-ifversion, -ge, 1200, y), y) - ifeq ($(call cc-ifversion, -lt, 1300, y), y) + ifeq ($(call gcc-min-version, 120000), y) + ifneq ($(call gcc-min-version, 130000), y) KBUILD_CFLAGS += $(call cc-disable-warning, array-bounds) KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-disable-warning, array-bounds) endif
drivers/gpu/drm/amd/display/dc/calcs/Makefile +1 -1
@@ -34,7 +34,7 @@ calcs_ccflags := -mhard-float -maltivec endif ifdef CONFIG_CC_IS_GCC -ifeq ($(call cc-ifversion, -lt, 0701, y), y) +ifneq ($(call gcc-min-version, 70100),y) IS_OLD_GCC = 1 endif endif
drivers/gpu/drm/amd/display/dc/dcn20/Makefile +1 -1
@@ -18,7 +18,7 @@ CFLAGS_$(AMDDALPATH)/dc/dcn20/dcn20_reso endif ifdef CONFIG_CC_IS_GCC -ifeq ($(call cc-ifversion, -lt, 0701, y), y) +ifneq ($(call gcc-min-version, 70100),y) IS_OLD_GCC = 1 endif endif
drivers/gpu/drm/amd/display/dc/dcn21/Makefile +1 -1
@@ -14,7 +14,7 @@ CFLAGS_$(AMDDALPATH)/dc/dcn21/dcn21_reso endif ifdef CONFIG_CC_IS_GCC -ifeq ($(call cc-ifversion, -lt, 0701, y), y) +ifneq ($(call gcc-min-version, 70100),y) IS_OLD_GCC = 1 endif endif
drivers/gpu/drm/amd/display/dc/dcn30/Makefile +1 -1
@@ -47,7 +47,7 @@ CFLAGS_REMOVE_$(AMDDALPATH)/dc/dcn30/dcn endif ifdef CONFIG_CC_IS_GCC -ifeq ($(call cc-ifversion, -lt, 0701, y), y) +ifneq ($(call gcc-min-version, 70100),y) IS_OLD_GCC = 1 endif endif
drivers/gpu/drm/amd/display/dc/dml/Makefile +1 -1
@@ -35,7 +35,7 @@ dml_ccflags := -mhard-float -maltivec endif ifdef CONFIG_CC_IS_GCC -ifeq ($(call cc-ifversion, -lt, 0701, y), y) +ifneq ($(call gcc-min-version, 70100),y) IS_OLD_GCC = 1 endif endif
drivers/gpu/drm/amd/display/dc/dsc/Makefile +1 -1
@@ -11,7 +11,7 @@ dsc_ccflags := -mhard-float -maltivec endif ifdef CONFIG_CC_IS_GCC -ifeq ($(call cc-ifversion, -lt, 0701, y), y) +ifneq ($(call gcc-min-version, 70100),y) IS_OLD_GCC = 1 endif endif
scripts/Kbuild.include +7 -3
@@ -133,9 +133,13 @@ cc-option-yn = $(call try-run,\ cc-disable-warning = $(call try-run,\ $(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1))) -# cc-ifversion -# Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1) -cc-ifversion = $(shell [ $(CONFIG_GCC_VERSION)0 $(1) $(2)000 ] && echo $(3) || echo $(4)) +# gcc-min-version +# Usage: cflags-$(call gcc-min-version, 70100) += -foo +gcc-min-version = $(shell [ $(CONFIG_GCC_VERSION)0 -ge $(1)0 ] && echo y) + +# clang-min-version +# Usage: cflags-$(call clang-min-version, 110000) += -foo +clang-min-version = $(shell [ $(CONFIG_CLANG_VERSION)0 -ge $(1)0 ] && echo y) # ld-option # Usage: KBUILD_LDFLAGS += $(call ld-option, -X, -Y)
Greg Kroah-Hartman
maintainerPATCH 240/300 Revert "NFS: Dont set NFS_INO_REVAL_PAGECACHE in the inode cache validity"
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
This reverts commit 36a9346c225270262d9f34e66c91aa1723fa903f.
The above commit was incorrectly labelled as a dependency for commit b01f21cacde9 ("NFS: Fix the setting of capabilities when automounting a new filesystem")
A revert is needed, since the incorrectly applied commit depends upon a series of other patches that were merged into Linux 5.13, but have not been applied to the 5.10 stable series.
--- fs/nfs/inode.c | 6 ++++-- fs/nfs/nfs4proc.c | 1 + 2 files changed, 5 insertions(+), 2 deletions(-)
fs/nfs/inode.c +4 -2
@@ -217,12 +217,11 @@ static void nfs_set_cache_invalid(struct flags &= ~NFS_INO_INVALID_OTHER ; flags &= ~(NFS_INO_INVALID_CHANGE |NFS_INO_INVALID_SIZE + |NFS_INO_REVAL_PAGECACHE |NFS_INO_INVALID_XATTR ); }else if (flags &NFS_INO_REVAL_PAGECACHE ) flags |=NFS_INO_INVALID_CHANGE |NFS_INO_INVALID_SIZE ; - flags &= ~NFS_INO_REVAL_PAGECACHE ; -if (!nfs_has_xattr_cache (nfsi)) flags &= ~NFS_INO_INVALID_XATTR ;if (inode->i_mapping->nrpages ==0 )
@@ -1901,6 +1900,7 @@ static int nfs_update_inode(struct inode nfsi->cache_validity &= ~(NFS_INO_INVALID_ATTR |NFS_INO_INVALID_ATIME |NFS_INO_REVAL_FORCED + |NFS_INO_REVAL_PAGECACHE |NFS_INO_INVALID_BLOCKS );/* Do atomic weak cache consistency updates */
@@ -1942,6 +1942,7 @@ static int nfs_update_inode(struct inode }else { nfsi->cache_validity |= save_cache_validity & (NFS_INO_INVALID_CHANGE + |NFS_INO_REVAL_PAGECACHE |NFS_INO_REVAL_FORCED ); cache_revalidated = false; }
@@ -1987,6 +1988,7 @@ static int nfs_update_inode(struct inode }else { nfsi->cache_validity |= save_cache_validity & (NFS_INO_INVALID_SIZE + |NFS_INO_REVAL_PAGECACHE |NFS_INO_REVAL_FORCED ); cache_revalidated = false; }
fs/nfs/nfs4proc.c +1 -0
@@ -1212,6 +1212,7 @@ nfs4_update_changeattr_locked(struct ino | cache_validity;if (cinfo->atomic && cinfo->before ==inode_peek_iversion_raw (inode)) { + nfsi->cache_validity &= ~NFS_INO_REVAL_PAGECACHE ; nfsi->attrtimeo_timestamp = jiffies; }else {if (S_ISDIR (inode->i_mode)) {
Greg Kroah-Hartman
maintainerPATCH 241/300 net: netpoll: fix incorrect refcount handling causing incorrect cleanup
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Breno Leitao <[email protected]>
[ Upstream commit 49c8d2c1f94cc2f4d1a108530d7ba52614b874c2 ]
commit efa95b01da18 ("netpoll: fix use after free") incorrectly ignored the refcount and prematurely set dev->npinfo to NULL during netpoll cleanup, leading to improper behavior and memory leaks.
Scenario causing lack of proper cleanup:
1) A netpoll is associated with a NIC (e.g., eth0) and netdev->npinfo is allocated, and refcnt = 1
- Keep in mind that npinfo is shared among all netpoll instances. In this case, there is just one.
2) Another netpoll is also associated with the same NIC and npinfo->refcnt += 1.
- Now dev->npinfo->refcnt = 2;
- There is just one npinfo associated to the netdev.
3) When the first netpolls goes to clean up:
- The first cleanup succeeds and clears np->dev->npinfo, ignoring refcnt.
- It basically calls RCU_INIT_POINTER(np->dev->npinfo, NULL);
- Set dev->npinfo = NULL, without proper cleanup
- No ->ndo_netpoll_cleanup() is either called
4) Now the second target tries to clean up
- The second cleanup fails because np->dev->npinfo is already NULL.
* In this case, ops->ndo_netpoll_cleanup() was never called, and the skb pool is not cleaned as well (for the second netpoll instance)
- This leaks npinfo and skbpool skbs, which is clearly reported by kmemleak.
Revert commit efa95b01da18 ("netpoll: fix use after free") and adds clarifying comments emphasizing that npinfo cleanup should only happen once the refcount reaches zero, ensuring stable and correct netpoll behavior.
--- net/core/netpoll.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
net/core/netpoll.c +5 -2
@@ -863,6 +863,10 @@ void __netpoll_cleanup(struct netpoll *nsynchronize_srcu (&netpoll_srcu); +/* At this point, there is a single npinfo instance per netdevice, and +* its refcnt tracks how many netpoll structures are linked to it. We +* only perform npinfo cleanup when the refcnt decrements to zero. +*/ if (refcount_dec_and_test (&npinfo->refcnt)) {const struct net_device_ops *ops;
@@ -872,8 +876,7 @@ void __netpoll_cleanup(struct netpoll *nRCU_INIT_POINTER (np->dev->npinfo,NULL );call_rcu (&npinfo->rcu, rcu_cleanup_netpoll_info); - }else -RCU_INIT_POINTER (np->dev->npinfo,NULL ); + } }EXPORT_SYMBOL_GPL (__netpoll_cleanup);
Greg Kroah-Hartman
maintainerPATCH 242/300 ALSA: usb-audio: Fix potential overflow of PCM transfer buffer
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
[ Upstream commit 05a1fc5efdd8560f34a3af39c9cf1e1526cc3ddf ]
The PCM stream data in USB-audio driver is transferred over USB URB packet buffers, and each packet size is determined dynamically. The packet sizes are limited by some factors such as wMaxPacketSize USB descriptor. OTOH, in the current code, the actually used packet sizes are determined only by the rate and the PPS, which may be bigger than the size limit above. This results in a buffer overflow, as reported by syzbot.
Basically when the limit is smaller than the calculated packet size, it implies that something is wrong, most likely a weird USB descriptor. So the best option would be just to return an error at the parameter setup time before doing any further operations.
This patch introduces such a sanity check, and returns -EINVAL when the packet size is greater than maxpacksize. The comparison with ep->packsize[1] alone should suffice since it's always equal or greater than ep->packsize[0].
--- sound/usb/endpoint.c | 5 +++++ 1 file changed, 5 insertions(+)
sound/usb/endpoint.c +5 -0
@@ -1093,6 +1093,11 @@ int snd_usb_endpoint_set_params(struct s ep->sample_rem = rate % ep->pps; ep->packsize[0 ] = rate / ep->pps; ep->packsize[1 ] = (rate + (ep->pps -1 )) / ep->pps; +if (ep->packsize[1 ] > ep->maxpacksize) { +usb_audio_dbg (ep->chip,"Too small maxpacksize %u for rate %u / pps %u\n" , + ep->maxpacksize, rate, ep->pps); +return -EINVAL ; + }/* calculate the frequency in 16.16 format */ ep->freqm = ep->freqn;
Greg Kroah-Hartman
maintainerPATCH 243/300 pmdomain: imx: Fix reference count leak in imx_gpc_remove
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miaoqian Lin <[email protected]>
[ Upstream commit bbde14682eba21d86f5f3d6fe2d371b1f97f1e61 ]
of_get_child_by_name() returns a node pointer with refcount incremented, we should use of_node_put() on it when not needed anymore. Add the missing of_node_put() to avoid refcount leak.
--- drivers/soc/imx/gpc.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/soc/imx/gpc.c +2 -0
@@ -540,6 +540,8 @@ static int imx_gpc_remove(struct platforreturn ret; } +of_node_put (pgc_node); +return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 244/300 pmdomain: arm: scmi: Fix genpd leak on provider registration failure
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sudeep Holla <[email protected]>
[ Upstream commit 7458f72cc28f9eb0de811effcb5376d0ec19094a ]
If of_genpd_add_provider_onecell() fails during probe, the previously created generic power domains are not removed, leading to a memory leak and potential kernel crash later in genpd_debug_add().
Add proper error handling to unwind the initialized domains before returning from probe to ensure all resources are correctly released on failure.
Example crash trace observed without this fix:
| Unable to handle kernel paging request at virtual address fffffffffffffc70 | CPU: 1 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.18.0-rc1 #405 PREEMPT | Hardware name: ARM LTD ARM Juno Development Platform/ARM Juno Development Platform | pstate: 00000005 (nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) | pc : genpd_debug_add+0x2c/0x160 | lr : genpd_debug_init+0x74/0x98 | Call trace: | genpd_debug_add+0x2c/0x160 (P) | genpd_debug_init+0x74/0x98 | do_one_initcall+0xd0/0x2d8 | do_initcall_level+0xa0/0x140 | do_initcalls+0x60/0xa8 | do_basic_setup+0x28/0x40 | kernel_init_freeable+0xe8/0x170 | kernel_init+0x2c/0x140 | ret_from_fork+0x10/0x20
--- drivers/firmware/arm_scmi/scmi_pm_domain.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/firmware/arm_scmi/scmi_pm_domain.c +11 -2
@@ -53,7 +53,7 @@ static int scmi_pd_power_off(struct genestatic int scmi_pm_domain_probe (struct scmi_device *sdev) { -int num_domains, i; +int num_domains, i, ret;struct device *dev = &sdev->dev;struct device_node *np = dev->of_node;struct scmi_pm_domain *scmi_pd;
@@ -106,9 +106,18 @@ static int scmi_pm_domain_probe(struct s scmi_pd_data->domains = domains; scmi_pd_data->num_domains = num_domains; + ret =of_genpd_add_provider_onecell (np, scmi_pd_data); +if (ret) + goto err_rm_genpds; +dev_set_drvdata (dev, scmi_pd_data); -return of_genpd_add_provider_onecell (np, scmi_pd_data); +return 0 ; +err_rm_genpds: +for (i = num_domains -1 ; i >=0 ; i--) +pm_genpd_remove (domains[i]); + +return ret; }static void scmi_pm_domain_remove (struct scmi_device *sdev)
Greg Kroah-Hartman
maintainerPATCH 245/300 ata: libata-scsi: Fix system suspend for a security locked drive
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <[email protected]>
[ Upstream commit b11890683380a36b8488229f818d5e76e8204587 ]
Commit cf3fc037623c ("ata: libata-scsi: Fix ata_to_sense_error() status handling") fixed ata_to_sense_error() to properly generate sense key ABORTED COMMAND (without any additional sense code), instead of the previous bogus sense key ILLEGAL REQUEST with the additional sense code UNALIGNED WRITE COMMAND, for a failed command.
However, this broke suspend for Security locked drives (drives that have Security enabled, and have not been Security unlocked by boot firmware).
The reason for this is that the SCSI disk driver, for the Synchronize Cache command only, treats any sense data with sense key ILLEGAL REQUEST as a successful command (regardless of ASC / ASCQ).
After commit cf3fc037623c ("ata: libata-scsi: Fix ata_to_sense_error() status handling") the code that treats any sense data with sense key ILLEGAL REQUEST as a successful command is no longer applicable, so the command fails, which causes the system suspend to be aborted:
sd 1:0:0:0: PM: dpm_run_callback(): scsi_bus_suspend returns -5 sd 1:0:0:0: PM: failed to suspend async: error -5
PM: Some devices failed to suspend, or early wake event detected
To make suspend work once again, for a Security locked device only, return sense data LOGICAL UNIT ACCESS NOT AUTHORIZED, the actual sense data which a real SCSI device would have returned if locked. The SCSI disk driver treats this sense data as a successful command.
--- drivers/ata/libata-scsi.c | 8 ++++++++ include/linux/ata.h | 1 + 2 files changed, 9 insertions(+)
drivers/ata/libata-scsi.c +8 -0
@@ -961,6 +961,14 @@ static void ata_gen_ata_sense(struct ataata_scsi_set_sense (dev, cmd,NOT_READY ,0x04 ,0x21 );return ; } + +if (ata_id_is_locked (dev->id)) { +/* Security locked */ +/* LOGICAL UNIT ACCESS NOT AUTHORIZED */ +ata_scsi_set_sense (dev, cmd,DATA_PROTECT ,0x74 ,0x71 ); +return ; + } +/* Use ata_to_sense_error() to map status register bits * onto sense key, asc & ascq. */
include/linux/ata.h +1 -0
@@ -557,6 +557,7 @@ struct ata_bmdma_prd {#define ata_id_has_ncq (id) ((id)[ATA_ID_SATA_CAPABILITY] & (1 << 8))#define ata_id_queue_depth (id) (((id)[ATA_ID_QUEUE_DEPTH] & 0x1f) + 1)#define ata_id_removable (id) ((id)[ATA_ID_CONFIG] & (1 << 7)) +#define ata_id_is_locked (id) (((id)[ATA_ID_DLF] & 0x7) == 0x7)#define ata_id_has_atapi_AN (id) \ ((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \ ((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \
Greg Kroah-Hartman
maintainerPATCH 246/300 mptcp: introduce mptcp_schedule_work
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paolo Abeni <[email protected]>
[ Upstream commit ba8f48f7a4d79352b764ace585b5f602ef940be0 ]
remove some of code duplications an allow preventing rescheduling on close.
Stable-dep-of: 035bca3f017e ("mptcp: fix race condition in mptcp_schedule_work()")
--- net/mptcp/pm.c | 3 +-- net/mptcp/protocol.c | 36 ++++++++++++++++++++++-------------- net/mptcp/protocol.h | 1 + 3 files changed, 24 insertions(+), 16 deletions(-)
net/mptcp/pm.c +1 -2
@@ -89,8 +89,7 @@ static bool mptcp_pm_schedule_work(strucreturn false; msk->pm.status |=BIT (new_status); -if (schedule_work (&msk->work)) -sock_hold ((struct sock *)msk); +mptcp_schedule_work ((struct sock *)msk);return true; }
net/mptcp/protocol.c +22 -14
@@ -641,9 +641,8 @@ static bool move_skbs_to_msk(struct mptc* this is not a good place to change state. Let the workqueue * do it. */ -if (mptcp_pending_data_fin (sk,NULL ) && -schedule_work (&msk->work)) -sock_hold (sk); +if (mptcp_pending_data_fin (sk,NULL )) +mptcp_schedule_work (sk); }spin_unlock_bh (&sk->sk_lock.slock);
@@ -715,23 +714,32 @@ static void mptcp_reset_timer(struct socsk_reset_timer (sk, &icsk->icsk_retransmit_timer, jiffies + tout); } +bool mptcp_schedule_work (struct sock *sk) +{ +if (inet_sk_state_load (sk) !=TCP_CLOSE && +schedule_work (&mptcp_sk (sk)->work)) { +/* each subflow already holds a reference to the sk, and the +* workqueue is invoked by a subflow, so sk can't go away here. +*/ +sock_hold (sk); +return true; + } +return false; +} +void mptcp_data_acked (struct sock *sk) {mptcp_reset_timer (sk);if ((!test_bit (MPTCP_SEND_SPACE , &mptcp_sk (sk)->flags) || - (inet_sk_state_load (sk) !=TCP_ESTABLISHED )) && -schedule_work (&mptcp_sk (sk)->work)) -sock_hold (sk); + (inet_sk_state_load (sk) !=TCP_ESTABLISHED ))) +mptcp_schedule_work (sk); }void mptcp_subflow_eof (struct sock *sk) { -struct mptcp_sock *msk =mptcp_sk (sk); - -if (!test_and_set_bit (MPTCP_WORK_EOF , &msk->flags) && -schedule_work (&msk->work)) -sock_hold (sk); +if (!test_and_set_bit (MPTCP_WORK_EOF , &mptcp_sk (sk)->flags)) +mptcp_schedule_work (sk); }static void mptcp_check_for_eof (struct mptcp_sock *msk)
@@ -1643,8 +1651,7 @@ static void mptcp_retransmit_handler(strmptcp_stop_timer (sk); }else {set_bit (MPTCP_WORK_RTX , &msk->flags); -if (schedule_work (&msk->work)) -sock_hold (sk); +mptcp_schedule_work (sk); } }
@@ -2503,7 +2510,8 @@ static void mptcp_release_cb(struct sockstruct sock *ssk; ssk =mptcp_subflow_recv_lookup (msk); -if (!ssk || !schedule_work (&msk->work)) +if (!ssk || sk->sk_state ==TCP_CLOSE || + !schedule_work (&msk->work))__sock_put (sk); }
net/mptcp/protocol.h +1 -0
@@ -410,6 +410,7 @@ static inline bool mptcp_is_fully_establvoid mptcp_rcv_space_init (struct mptcp_sock *msk,const struct sock *ssk);void mptcp_data_ready (struct sock *sk,struct sock *ssk);bool mptcp_finish_join (struct sock *sk); +bool mptcp_schedule_work (struct sock *sk);void mptcp_data_acked (struct sock *sk);void mptcp_subflow_eof (struct sock *sk);bool mptcp_update_rcv_data_fin (struct mptcp_sock *msk,u64 data_fin_seq,bool use_64bit);
Greg Kroah-Hartman
maintainerPATCH 247/300 mptcp: fix race condition in mptcp_schedule_work()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 035bca3f017ee9dea3a5a756e77a6f7138cc6eea ]
syzbot reported use-after-free in mptcp_schedule_work() [1]
Issue here is that mptcp_schedule_work() schedules a work, then gets a refcount on sk->sk_refcnt if the work was scheduled. This refcount will be released by mptcp_worker().
[A] if (schedule_work(...)) {
[B] sock_hold(sk);
return true;
}Problem is that mptcp_worker() can run immediately and complete before [B]
We need instead :
sock_hold(sk);
if (schedule_work(...))
return true;
sock_put(sk);[1]refcount_t: addition on 0; use-after-free.
WARNING: CPU: 1 PID: 29 at lib/refcount.c:25 refcount_warn_saturate+0xfa/0x1d0 lib/refcount.c:25 Call Trace: <TASK> __refcount_add include/linux/refcount.h:-1 [inline] __refcount_inc include/linux/refcount.h:366 [inline] refcount_inc include/linux/refcount.h:383 [inline] sock_hold include/net/sock.h:816 [inline] mptcp_schedule_work+0x164/0x1a0 net/mptcp/protocol.c:943 mptcp_tout_timer+0x21/0xa0 net/mptcp/protocol.c:2316 call_timer_fn+0x17e/0x5f0 kernel/time/timer.c:1747 expire_timers kernel/time/timer.c:1798 [inline] __run_timers kernel/time/timer.c:2372 [inline] __run_timer_base+0x648/0x970 kernel/time/timer.c:2384 run_timer_base kernel/time/timer.c:2393 [inline] run_timer_softirq+0xb7/0x180 kernel/time/timer.c:2403 handle_softirqs+0x22f/0x710 kernel/softirq.c:622 __do_softirq kernel/softirq.c:656 [inline] run_ktimerd+0xcf/0x190 kernel/softirq.c:1138 smpboot_thread_fn+0x542/0xa60 kernel/smpboot.c:160 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x4bc/0x870 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
--- net/mptcp/protocol.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
net/mptcp/protocol.c +12 -7
@@ -716,14 +716,19 @@ static void mptcp_reset_timer(struct socbool mptcp_schedule_work (struct sock *sk) { -if (inet_sk_state_load (sk) !=TCP_CLOSE && -schedule_work (&mptcp_sk (sk)->work)) { -/* each subflow already holds a reference to the sk, and the -* workqueue is invoked by a subflow, so sk can't go away here. -*/ -sock_hold (sk); +if (inet_sk_state_load (sk) ==TCP_CLOSE ) +return false; + +/* Get a reference on this socket, mptcp_worker() will release it. +* As mptcp_worker() might complete before us, we can not avoid +* a sock_hold()/sock_put() if schedule_work() returns false. +*/ +sock_hold (sk); + +if (schedule_work (&mptcp_sk (sk)->work))return true; - } + +sock_put (sk);return false; }
Greg Kroah-Hartman
maintainerPATCH 248/300 dt-bindings: pinctrl: toshiba,visconti: Fix number of items in groups
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 316e361b5d2cdeb8d778983794a1c6eadcb26814 ]
The "groups" property can hold multiple entries (e.g. toshiba/tmpv7708-rm-mbrc.dts file), so allow that by dropping incorrect type (pinmux-node.yaml schema already defines that as string-array) and adding constraints for items. This fixes dtbs_check warnings like:
toshiba/tmpv7708-rm-mbrc.dtb: pinctrl@24190000 (toshiba,tmpv7708-pinctrl):
pwm-pins:groups: ['pwm0_gpio16_grp', 'pwm1_gpio17_grp', 'pwm2_gpio18_grp', 'pwm3_gpio19_grp'] is too long
--- Documentation/devicetree/bindings/pinctrl/toshiba,visconti-pinctrl.yaml | 26 +++++----- 1 file changed, 14 insertions(+), 12 deletions(-)
Documentation/devicetree/bindings/pinctrl/toshiba,visconti-pinctrl.yaml +14 -12
@@ -46,18 +46,20 @@ patternProperties: groups: description: Name of the pin group to use for the functions. - $ref: "/schemas/types.yaml#/definitions/string" - enum: [i2c0_grp, i2c1_grp, i2c2_grp, i2c3_grp, i2c4_grp, - i2c5_grp, i2c6_grp, i2c7_grp, i2c8_grp, - spi0_grp, spi0_cs0_grp, spi0_cs1_grp, spi0_cs2_grp, - spi1_grp, spi2_grp, spi3_grp, spi4_grp, spi5_grp, spi6_grp, - uart0_grp, uart1_grp, uart2_grp, uart3_grp, - pwm0_gpio4_grp, pwm0_gpio8_grp, pwm0_gpio12_grp, - pwm0_gpio16_grp, pwm1_gpio5_grp, pwm1_gpio9_grp, - pwm1_gpio13_grp, pwm1_gpio17_grp, pwm2_gpio6_grp, - pwm2_gpio10_grp, pwm2_gpio14_grp, pwm2_gpio18_grp, - pwm3_gpio7_grp, pwm3_gpio11_grp, pwm3_gpio15_grp, - pwm3_gpio19_grp, pcmif_out_grp, pcmif_in_grp] + items: + enum: [i2c0_grp, i2c1_grp, i2c2_grp, i2c3_grp, i2c4_grp, + i2c5_grp, i2c6_grp, i2c7_grp, i2c8_grp, + spi0_grp, spi0_cs0_grp, spi0_cs1_grp, spi0_cs2_grp, + spi1_grp, spi2_grp, spi3_grp, spi4_grp, spi5_grp, spi6_grp, + uart0_grp, uart1_grp, uart2_grp, uart3_grp, + pwm0_gpio4_grp, pwm0_gpio8_grp, pwm0_gpio12_grp, + pwm0_gpio16_grp, pwm1_gpio5_grp, pwm1_gpio9_grp, + pwm1_gpio13_grp, pwm1_gpio17_grp, pwm2_gpio6_grp, + pwm2_gpio10_grp, pwm2_gpio14_grp, pwm2_gpio18_grp, + pwm3_gpio7_grp, pwm3_gpio11_grp, pwm3_gpio15_grp, + pwm3_gpio19_grp, pcmif_out_grp, pcmif_in_grp] + minItems: 1 + maxItems: 8 drive-strength: enum: [2, 4, 6, 8, 16, 24, 32]
Greg Kroah-Hartman
maintainerPATCH 249/300 mm/mempool: replace kmap_atomic() with kmap_local_page()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Fabio M. De Francesco" <[email protected]>
[ Upstream commit f2bcc99a5e901a13b754648d1dbab60f4adf9375 ]
kmap_atomic() has been deprecated in favor of kmap_local_page().
Therefore, replace kmap_atomic() with kmap_local_page().
kmap_atomic() is implemented like a kmap_local_page() which also disables page-faults and preemption (the latter only in !PREEMPT_RT kernels). The kernel virtual addresses returned by these two API are only valid in the context of the callers (i.e., they cannot be handed to other threads).
With kmap_local_page() the mappings are per thread and CPU local like in kmap_atomic(); however, they can handle page-faults and can be called from any context (including interrupts). The tasks that call kmap_local_page() can be preempted and, when they are scheduled to run again, the kernel virtual addresses are restored and are still valid.
The code blocks between the mappings and un-mappings don't rely on the above-mentioned side effects of kmap_atomic(), so that mere replacements of the old API with the new one is all that they require (i.e., there is no need to explicitly call pagefault_disable() and/or preempt_disable()).
Stable-dep-of: ec33b59542d9 ("mm/mempool: fix poisoning order>0 pages with HIGHMEM")
--- mm/mempool.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
mm/mempool.c +4 -4
@@ -63,10 +63,10 @@ static void check_element(mempool_t *poo }else if (pool->free == mempool_free_pages) {/* Mempools backed by page allocator */ int order = (int )(long )pool->pool_data; -void *addr =kmap_atomic ((struct page *)element); +void *addr =kmap_local_page ((struct page *)element);__check_element (pool, addr,1UL << (PAGE_SHIFT + order)); -kunmap_atomic (addr); +kunmap_local (addr); } }
@@ -86,10 +86,10 @@ static void poison_element(mempool_t *po } else if (pool->alloc == mempool_alloc_pages) {/* Mempools backed by page allocator */ int order = (int )(long )pool->pool_data; -void *addr =kmap_atomic ((struct page *)element); +void *addr =kmap_local_page ((struct page *)element);__poison_element (addr,1UL << (PAGE_SHIFT + order)); -kunmap_atomic (addr); +kunmap_local (addr); } }#else /* CONFIG_DEBUG_SLAB || CONFIG_SLUB_DEBUG_ON */
Greg Kroah-Hartman
maintainerPATCH 250/300 mm/mempool: fix poisoning order>0 pages with HIGHMEM
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vlastimil Babka <[email protected]>
[ Upstream commit ec33b59542d96830e3c89845ff833cf7b25ef172 ]
The kernel test has reported:
BUG: unable to handle page fault for address: fffba000 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page *pde = 03171067 *pte = 00000000 Oops: Oops: 0002 [#1] CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Tainted: G T 6.18.0-rc2-00031-gec7f31b2a2d3 #1 NONE a1d066dfe789f54bc7645c7989957d2bdee593ca Tainted: [T]=RANDSTRUCT Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 EIP: memset (arch/x86/include/asm/string_32.h:168 arch/x86/lib/memcpy_32.c:17) Code: a5 8b 4d f4 83 e1 03 74 02 f3 a4 83 c4 04 5e 5f 5d 2e e9 73 41 01 00 90 90 90 3e 8d 74 26 00 55 89 e5 57 56 89 c6 89 d0 89 f7 <f3> aa 89 f0 5e 5f 5d 2e e9 53 41 01 00 cc cc cc 55 89 e5 53 57 56 EAX: 0000006b EBX: 00000015 ECX: 001fefff EDX: 0000006b ESI: fffb9000 EDI: fffba000 EBP: c611fbf0 ESP: c611fbe8 DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068 EFLAGS: 00010287 CR0: 80050033 CR2: fffba000 CR3: 0316e000 CR4: 00040690 Call Trace: poison_element (mm/mempool.c:83 mm/mempool.c:102) mempool_init_node (mm/mempool.c:142 mm/mempool.c:226) mempool_init_noprof (mm/mempool.c:250 (discriminator 1)) ? mempool_alloc_pages (mm/mempool.c:640) bio_integrity_initfn (block/bio-integrity.c:483 (discriminator 8)) ? mempool_alloc_pages (mm/mempool.c:640) do_one_initcall (init/main.c:1283)
Christoph found out this is due to the poisoning code not dealing properly with CONFIG_HIGHMEM because only the first page is mapped but then the whole potentially high-order page is accessed.
We could give up on HIGHMEM here, but it's straightforward to fix this with a loop that's mapping, poisoning or checking and unmapping individual pages.
--- mm/mempool.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-)
mm/mempool.c +26 -6
@@ -63,10 +63,20 @@ static void check_element(mempool_t *poo }else if (pool->free == mempool_free_pages) {/* Mempools backed by page allocator */ int order = (int )(long )pool->pool_data; -void *addr =kmap_local_page ((struct page *)element); -__check_element (pool, addr,1UL << (PAGE_SHIFT + order)); -kunmap_local (addr); +#ifdef CONFIG_HIGHMEM +for (int i =0 ; i < (1 << order); i++) { +struct page *page = (struct page *)element; +void *addr =kmap_local_page (page + i); + +__check_element (pool, addr,PAGE_SIZE ); +kunmap_local (addr); + } +#else +void *addr =page_address ((struct page *)element); + +__check_element (pool, addr,PAGE_SIZE << order); +#endif } }
@@ -86,10 +96,20 @@ static void poison_element(mempool_t *po } else if (pool->alloc == mempool_alloc_pages) {/* Mempools backed by page allocator */ int order = (int )(long )pool->pool_data; -void *addr =kmap_local_page ((struct page *)element); -__poison_element (addr,1UL << (PAGE_SHIFT + order)); -kunmap_local (addr); +#ifdef CONFIG_HIGHMEM +for (int i =0 ; i < (1 << order); i++) { +struct page *page = (struct page *)element; +void *addr =kmap_local_page (page + i); + +__poison_element (addr,PAGE_SIZE ); +kunmap_local (addr); + } +#else +void *addr =page_address ((struct page *)element); + +__poison_element (addr,PAGE_SIZE << order); +#endif } }#else /* CONFIG_DEBUG_SLAB || CONFIG_SLUB_DEBUG_ON */
Greg Kroah-Hartman
maintainerPATCH 251/300 mptcp: fix a race in mptcp_pm_del_add_timer()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 426358d9be7ce3518966422f87b96f1bad27295f ]
mptcp_pm_del_add_timer() can call sk_stop_timer_sync(sk, &entry->add_timer) while another might have free entry already, as reported by syzbot.
Add RCU protection to fix this issue.
Also change confusing add_timer variable with stop_timer boolean.
syzbot report:
BUG: KASAN: slab-use-after-free in __timer_delete_sync+0x372/0x3f0 kernel/time/timer.c:1616
Read of size 4 at addr ffff8880311e4150 by task kworker/1:1/44
CPU: 1 UID: 0 PID: 44 Comm: kworker/1:1 Not tainted syzkaller #0 PREEMPT_{RT,(full)}
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Workqueue: events mptcp_worker
Call Trace:
<TASK>
dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0xca/0x240 mm/kasan/report.c:482
kasan_report+0x118/0x150 mm/kasan/report.c:595
__timer_delete_sync+0x372/0x3f0 kernel/time/timer.c:1616
sk_stop_timer_sync+0x1b/0x90 net/core/sock.c:3631
mptcp_pm_del_add_timer+0x283/0x310 net/mptcp/pm.c:362
mptcp_incoming_options+0x1357/0x1f60 net/mptcp/options.c:1174
tcp_data_queue+0xca/0x6450 net/ipv4/tcp_input.c:5361
tcp_rcv_established+0x1335/0x2670 net/ipv4/tcp_input.c:6441
tcp_v4_do_rcv+0x98b/0xbf0 net/ipv4/tcp_ipv4.c:1931
tcp_v4_rcv+0x252a/0x2dc0 net/ipv4/tcp_ipv4.c:2374
ip_protocol_deliver_rcu+0x221/0x440 net/ipv4/ip_input.c:205
ip_local_deliver_finish+0x3bb/0x6f0 net/ipv4/ip_input.c:239
NF_HOOK+0x30c/0x3a0 include/linux/netfilter.h:318
NF_HOOK+0x30c/0x3a0 include/linux/netfilter.h:318
__netif_receive_skb_one_core net/core/dev.c:6079 [inline]
__netif_receive_skb+0x143/0x380 net/core/dev.c:6192
process_backlog+0x31e/0x900 net/core/dev.c:6544
__napi_poll+0xb6/0x540 net/core/dev.c:7594
napi_poll net/core/dev.c:7657 [inline]
net_rx_action+0x5f7/0xda0 net/core/dev.c:7784
handle_softirqs+0x22f/0x710 kernel/softirq.c:622
__do_softirq kernel/softirq.c:656 [inline]
__local_bh_enable_ip+0x1a0/0x2e0 kernel/softirq.c:302
mptcp_pm_send_ack net/mptcp/pm.c:210 [inline]
mptcp_pm_addr_send_ack+0x41f/0x500 net/mptcp/pm.c:-1
mptcp_pm_worker+0x174/0x320 net/mptcp/pm.c:1002
mptcp_worker+0xd5/0x1170 net/mptcp/protocol.c:2762
process_one_work kernel/workqueue.c:3263 [inline]
process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3346
worker_thread+0x8a0/0xda0 kernel/workqueue.c:3427
kthread+0x711/0x8a0 kernel/kthread.c:463
ret_from_fork+0x4bc/0x870 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
</TASK>
Allocated by task 44:
kasan_save_stack mm/kasan/common.c:56 [inline]
kasan_save_track+0x3e/0x80 mm/kasan/common.c:77
poison_kmalloc_redzone mm/kasan/common.c:400 [inline]
__kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:417
kasan_kmalloc include/linux/kasan.h:262 [inline]
__kmalloc_cache_noprof+0x1ef/0x6c0 mm/slub.c:5748
kmalloc_noprof include/linux/slab.h:957 [inline]
mptcp_pm_alloc_anno_list+0x104/0x460 net/mptcp/pm.c:385
mptcp_pm_create_subflow_or_signal_addr+0xf9d/0x1360 net/mptcp/pm_kernel.c:355
mptcp_pm_nl_fully_established net/mptcp/pm_kernel.c:409 [inline]
__mptcp_pm_kernel_worker+0x417/0x1ef0 net/mptcp/pm_kernel.c:1529
mptcp_pm_worker+0x1ee/0x320 net/mptcp/pm.c:1008
mptcp_worker+0xd5/0x1170 net/mptcp/protocol.c:2762
process_one_work kernel/workqueue.c:3263 [inline]
process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3346
worker_thread+0x8a0/0xda0 kernel/workqueue.c:3427
kthread+0x711/0x8a0 kernel/kthread.c:463
ret_from_fork+0x4bc/0x870 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
Freed by task 6630:
kasan_save_stack mm/kasan/common.c:56 [inline]
kasan_save_track+0x3e/0x80 mm/kasan/common.c:77
__kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:587
kasan_save_free_info mm/kasan/kasan.h:406 [inline]
poison_slab_object mm/kasan/common.c:252 [inline]
__kasan_slab_free+0x5c/0x80 mm/kasan/common.c:284
kasan_slab_free include/linux/kasan.h:234 [inline]
slab_free_hook mm/slub.c:2523 [inline]
slab_free mm/slub.c:6611 [inline]
kfree+0x197/0x950 mm/slub.c:6818
mptcp_remove_anno_list_by_saddr+0x2d/0x40 net/mptcp/pm.c:158
mptcp_pm_flush_addrs_and_subflows net/mptcp/pm_kernel.c:1209 [inline]
mptcp_nl_flush_addrs_list net/mptcp/pm_kernel.c:1240 [inline]
mptcp_pm_nl_flush_addrs_doit+0x593/0xbb0 net/mptcp/pm_kernel.c:1281
genl_family_rcv_msg_doit+0x215/0x300 net/netlink/genetlink.c:1115
genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline]
genl_rcv_msg+0x60e/0x790 net/netlink/genetlink.c:1210
netlink_rcv_skb+0x208/0x470 net/netlink/af_netlink.c:2552
genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219
netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline]
netlink_unicast+0x846/0xa10 net/netlink/af_netlink.c:1346
netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1896
sock_sendmsg_nosec net/socket.c:727 [inline]
__sock_sendmsg+0x21c/0x270 net/socket.c:742
____sys_sendmsg+0x508/0x820 net/socket.c:2630
___sys_sendmsg+0x21f/0x2a0 net/socket.c:2684
__sys_sendmsg net/socket.c:2716 [inline]
__do_sys_sendmsg net/socket.c:2721 [inline]
__se_sys_sendmsg net/socket.c:2719 [inline]
__x64_sys_sendmsg+0x1a1/0x260 net/socket.c:2719
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f--- net/mptcp/pm_netlink.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
net/mptcp/pm_netlink.c +13 -7
@@ -34,6 +34,7 @@ struct mptcp_pm_add_entry {struct timer_list add_timer;struct mptcp_sock *sock;u8 retrans_times; +struct rcu_head rcu; };struct pm_nl_pernet {
@@ -253,22 +254,27 @@ mptcp_pm_del_add_timer(struct mptcp_sock {struct mptcp_pm_add_entry *entry;struct sock *sk = (struct sock *)msk; -struct timer_list *add_timer =NULL ; +bool stop_timer = false; + +rcu_read_lock ();spin_lock_bh (&msk->pm.lock); entry =mptcp_lookup_anno_list_by_saddr (msk, addr);if (entry && (!check_id || entry->addr.id == addr->id)) { entry->retrans_times =ADD_ADDR_RETRANS_MAX ; - add_timer = &entry->add_timer; + stop_timer = true; }if (!check_id && entry)list_del (&entry->list);spin_unlock_bh (&msk->pm.lock); -/* no lock, because sk_stop_timer_sync() is calling del_timer_sync() */ -if (add_timer) -sk_stop_timer_sync (sk, add_timer); +/* Note: entry might have been removed by another thread. +* We hold rcu_read_lock() to ensure it is not freed under us. +*/ +if (stop_timer) +sk_stop_timer_sync (sk, &entry->add_timer); +rcu_read_unlock ();return entry; }
@@ -311,7 +317,7 @@ void mptcp_pm_free_anno_list(struct mptclist_for_each_entry_safe (entry, tmp, &free_list, list) {sk_stop_timer_sync (sk, &entry->add_timer); -kfree (entry); +kfree_rcu (entry, rcu); } }
@@ -772,7 +778,7 @@ static bool remove_anno_list_by_saddr(st entry =mptcp_pm_del_add_timer (msk, addr, false);if (entry) { -kfree (entry); +kfree_rcu (entry, rcu);return true; }
Greg Kroah-Hartman
maintainerPATCH 252/300 mptcp: do not fallback when OoO is present
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paolo Abeni <[email protected]>
[ Upstream commit 1bba3f219c5e8c29e63afa3c1fc24f875ebec119 ]
In case of DSS corruption, the MPTCP protocol tries to avoid the subflow reset if fallback is possible. Such corruptions happen in the receive path; to ensure fallback is possible the stack additionally needs to check for OoO data, otherwise the fallback will break the data stream.
--- net/mptcp/protocol.c | 9 +++++++++ 1 file changed, 9 insertions(+)
net/mptcp/protocol.c +9 -0
@@ -477,6 +477,15 @@ static void mptcp_check_data_fin(structstatic void mptcp_dss_corruption (struct mptcp_sock *msk,struct sock *ssk) {if (READ_ONCE (msk->allow_infinite_fallback)) { +/* The caller possibly is not holding the msk socket lock, but +* in the fallback case only the current subflow is touching +* the OoO queue. +*/ +if (!RB_EMPTY_ROOT (&msk->out_of_order_queue)) { +MPTCP_INC_STATS (sock_net (ssk),MPTCP_MIB_DSSCORRUPTIONRESET ); +mptcp_subflow_reset (ssk); +return ; + }MPTCP_INC_STATS (sock_net (ssk),MPTCP_MIB_DSSCORRUPTIONFALLBACK );mptcp_do_fallback (ssk);
Greg Kroah-Hartman
maintainerPATCH 253/300 usb: deprecate the third argument of usb_maxpacket()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vincent Mailhol <[email protected]>
[ Upstream commit 0f08c2e7458e25c967d844170f8ad1aac3b57a02 ]
This is a transitional patch with the ultimate goal of changing the prototype of usb_maxpacket() from:
| static inline __u16
| usb_maxpacket(struct usb_device *udev, int pipe, int is_out)
into:
| static inline u16 usb_maxpacket(struct usb_device *udev, int pipe)
The third argument of usb_maxpacket(): is_out gets removed because it can be derived from its second argument: pipe using usb_pipeout(pipe). Furthermore, in the current version, ubs_pipeout(pipe) is called regardless in order to sanitize the is_out parameter.
In order to make a smooth change, we first deprecate the is_out parameter by simply ignoring it (using a variadic function) and will remove it later, once all the callers get updated.
The body of the function is reworked accordingly and is_out is replaced by usb_pipeout(pipe). The WARN_ON() calls become unnecessary and get removed.
Finally, the return type is changed from __u16 to u16 because this is not a UAPI function.
Stable-dep-of: 69aeb5073123 ("Input: pegasus-notetaker - fix potential out-of-bounds access")
--- include/linux/usb.h | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-)
include/linux/usb.h +5 -11
@@ -1980,21 +1980,17 @@ usb_pipe_endpoint(struct usb_device *devreturn eps[usb_pipeendpoint (pipe)]; } -/*-------------------------------------------------------------------------*/ - -static inline __u16 -usb_maxpacket (struct usb_device *udev,int pipe,int is_out) +static inline u16 usb_maxpacket (struct usb_device *udev,int pipe, +/* int is_out deprecated */ ...) {struct usb_host_endpoint *ep;unsigned epnum =usb_pipeendpoint (pipe); -if (is_out) { -WARN_ON (usb_pipein (pipe)); +if (usb_pipeout (pipe)) ep = udev->ep_out[epnum]; - }else { -WARN_ON (usb_pipeout (pipe)); +else ep = udev->ep_in[epnum]; - } +if (!ep)return 0 ;
@@ -2002,8 +1998,6 @@ usb_maxpacket(struct usb_device *udev, ireturn usb_endpoint_maxp (&ep->desc); } -/* ----------------------------------------------------------------------- */ -/* translate USB error codes to codes user space understands */ static inline int usb_translate_errors (int error_code) {
Greg Kroah-Hartman
maintainerPATCH 254/300 Input: remove third argument of usb_maxpacket()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vincent Mailhol <[email protected]>
[ Upstream commit 948bf187694fc1f4c20cf972fa18b1a6fb3d7603 ]
The third argument of usb_maxpacket(): in_out has been deprecated because it could be derived from the second argument (e.g. using usb_pipeout(pipe)).
N.B. function usb_maxpacket() was made variadic to accommodate the transition from the old prototype with three arguments to the new one with only two arguments (so that no renaming is needed). The variadic argument is to be removed once all users of usb_maxpacket() get migrated.
Stable-dep-of: 69aeb5073123 ("Input: pegasus-notetaker - fix potential out-of-bounds access")
--- drivers/input/misc/ati_remote2.c | 2 +- drivers/input/misc/cm109.c | 2 +- drivers/input/misc/powermate.c | 2 +- drivers/input/misc/yealink.c | 2 +- drivers/input/tablet/acecad.c | 2 +- drivers/input/tablet/pegasus_notetaker.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-)
drivers/input/misc/ati_remote2.c +1 -1
@@ -639,7 +639,7 @@ static int ati_remote2_urb_init(struct areturn -ENOMEM ; pipe =usb_rcvintpipe (udev, ar2->ep[i]->bEndpointAddress); - maxp =usb_maxpacket (udev, pipe,usb_pipeout (pipe)); + maxp =usb_maxpacket (udev, pipe); maxp = maxp >4 ?4 : maxp; usb_fill_int_urb(ar2->urb[i], udev, pipe, ar2->buf[i], maxp,
drivers/input/misc/cm109.c +1 -1
@@ -745,7 +745,7 @@ static int cm109_usb_probe(struct usb_in/* get a handle to the interrupt data pipe */ pipe =usb_rcvintpipe (udev, endpoint->bEndpointAddress); - ret =usb_maxpacket (udev, pipe,usb_pipeout (pipe)); + ret =usb_maxpacket (udev, pipe);if (ret !=USB_PKT_LEN )dev_err (&intf->dev,"invalid payload size %d, expected %d\n" , ret,USB_PKT_LEN );
drivers/input/misc/powermate.c +1 -1
@@ -374,7 +374,7 @@ static int powermate_probe(struct usb_in/* get a handle to the interrupt data pipe */ pipe =usb_rcvintpipe (udev, endpoint->bEndpointAddress); - maxp =usb_maxpacket (udev, pipe,usb_pipeout (pipe)); + maxp =usb_maxpacket (udev, pipe);if (maxp <POWERMATE_PAYLOAD_SIZE_MIN || maxp >POWERMATE_PAYLOAD_SIZE_MAX ) { printk(KERN_WARNING "powermate: Expected payload of %d--%d bytes, found %d bytes!\n",
drivers/input/misc/yealink.c +1 -1
@@ -905,7 +905,7 @@ static int usb_probe(struct usb_interfac/* get a handle to the interrupt data pipe */ pipe =usb_rcvintpipe (udev, endpoint->bEndpointAddress); - ret =usb_maxpacket (udev, pipe,usb_pipeout (pipe)); + ret =usb_maxpacket (udev, pipe);if (ret !=USB_PKT_LEN )dev_err (&intf->dev,"invalid payload size %d, expected %zd\n" , ret,USB_PKT_LEN );
drivers/input/tablet/acecad.c +1 -1
@@ -130,7 +130,7 @@ static int usb_acecad_probe(struct usb_ireturn -ENODEV ; pipe =usb_rcvintpipe (dev, endpoint->bEndpointAddress); - maxp =usb_maxpacket (dev, pipe,usb_pipeout (pipe)); + maxp =usb_maxpacket (dev, pipe); acecad =kzalloc (sizeof (struct usb_acecad ),GFP_KERNEL ); input_dev =input_allocate_device ();
drivers/input/tablet/pegasus_notetaker.c +1 -1
@@ -296,7 +296,7 @@ static int pegasus_probe(struct usb_inte pegasus->intf = intf; pipe =usb_rcvintpipe (dev, endpoint->bEndpointAddress); - pegasus->data_len =usb_maxpacket (dev, pipe,usb_pipeout (pipe)); + pegasus->data_len =usb_maxpacket (dev, pipe); pegasus->data =usb_alloc_coherent (dev, pegasus->data_len,GFP_KERNEL , &pegasus->data_dma);
Greg Kroah-Hartman
maintainerPATCH 255/300 Input: pegasus-notetaker - fix potential out-of-bounds access
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Seungjin Bae <[email protected]>
[ Upstream commit 69aeb507312306f73495598a055293fa749d454e ]
In the pegasus_notetaker driver, the pegasus_probe() function allocates the URB transfer buffer using the wMaxPacketSize value from the endpoint descriptor. An attacker can use a malicious USB descriptor to force the allocation of a very small buffer.
Subsequently, if the device sends an interrupt packet with a specific pattern (e.g., where the first byte is 0x80 or 0x42),
the pegasus_parse_packet() function parses the packet without checking the allocated buffer size. This leads to an out-of-bounds memory access.
--- drivers/input/tablet/pegasus_notetaker.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/input/tablet/pegasus_notetaker.c +9 -0
@@ -63,6 +63,9 @@#define BUTTON_PRESSED 0xb5#define COMMAND_VERSION 0xa9 +/* 1 Status + 1 Color + 2 X + 2 Y = 6 bytes */ +#define NOTETAKER_PACKET_SIZE 6 +/* in xy data packet */ #define BATTERY_NO_REPORT 0x40#define BATTERY_LOW 0x41
@@ -297,6 +300,12 @@ static int pegasus_probe(struct usb_inte pipe =usb_rcvintpipe (dev, endpoint->bEndpointAddress); pegasus->data_len =usb_maxpacket (dev, pipe); +if (pegasus->data_len <NOTETAKER_PACKET_SIZE ) { +dev_err (&intf->dev,"packet size is too small (%d)\n" , + pegasus->data_len); + error = -EINVAL ; + goto err_free_mem; + } pegasus->data =usb_alloc_coherent (dev, pegasus->data_len,GFP_KERNEL , &pegasus->data_dma);
Greg Kroah-Hartman
maintainerPATCH 256/300 can: kvaser_usb: leaf: Fix potential infinite loop in command parsers
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Seungjin Bae <[email protected]>
[ Upstream commit 0c73772cd2b8cc108d5f5334de89ad648d89b9ec ]
The kvaser_usb_leaf_wait_cmd() and kvaser_usb_leaf_read_bulk_callback functions contain logic to zero-length commands. These commands are used to align data to the USB endpoint's wMaxPacketSize boundary.
The driver attempts to skip these placeholders by aligning the buffer position pos to the next packet boundary using round_up() function.
However, if zero-length command is found exactly on a packet boundary (i.e., pos is a multiple of wMaxPacketSize, including 0), round_up function will return the unchanged value of pos. This prevents pos to be increased, causing an infinite loop in the parsing logic.
This patch fixes this in the function by using pos + 1 instead. This ensures that even if pos is on a boundary, the calculation is based on pos + 1, forcing round_up() to always return the next aligned boundary.
--- drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c +2 -2
@@ -609,7 +609,7 @@ static int kvaser_usb_leaf_wait_cmd(const struct kvaser_usb *dev, u8 id,* for further details. */ if (tmp->len ==0 ) { - pos =round_up (pos, + pos =round_up (pos +1 ,le16_to_cpu (dev->bulk_in->wMaxPacketSize));continue ;
@@ -1571,7 +1571,7 @@ static void kvaser_usb_leaf_read_bulk_callback(struct kvaser_usb *dev,* number of events in case of a heavy rx load on the bus. */ if (cmd->len ==0 ) { - pos =round_up (pos,le16_to_cpu + pos =round_up (pos +1 ,le16_to_cpu (dev->bulk_in->wMaxPacketSize));continue ; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 257/300 Bluetooth: SMP: Fix not generating mackey and ltk when repairing
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luiz Augusto von Dentz <[email protected]>
[ Upstream commit 545d7827b2cd5de5eb85580cebeda6b35b3ff443 ]
The change eed467b517e8 ("Bluetooth: fix passkey uninitialized when used") introduced a goto that bypasses the creation of temporary mackey and ltk which are later used by the likes of DHKey Check step.
Later ffee202a78c2 ("Bluetooth: Always request for user confirmation for Just Works (LE SC)") which means confirm_hint is always set in case JUST_WORKS so the branch checking for an existing LTK becomes pointless as confirm_hint will always be set, so this just merge both cases of malicious or legitimate devices to be confirmed before continuing with the pairing procedure.
--- net/bluetooth/smp.c | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-)
net/bluetooth/smp.c +7 -24
@@ -2131,7 +2131,7 @@ static u8 smp_cmd_pairing_random(struct l2cap_conn *conn, struct sk_buff *skb)struct smp_chan *smp = chan->data;struct hci_conn *hcon = conn->hcon;u8 *pkax, *pkbx, *na, *nb, confirm_hint; -u32 passkey; +u32 passkey =0 ;int err;bt_dev_dbg (hcon->hdev,"conn %p" , conn);
@@ -2183,24 +2183,6 @@ static u8 smp_cmd_pairing_random(struct l2cap_conn *conn, struct sk_buff *skb)smp_send_cmd (conn,SMP_CMD_PAIRING_RANDOM ,sizeof (smp->prnd), smp->prnd);SMP_ALLOW_CMD (smp,SMP_CMD_DHKEY_CHECK ); - -/* Only Just-Works pairing requires extra checks */ -if (smp->method !=JUST_WORKS ) - goto mackey_and_ltk; - -/* If there already exists long term key in local host, leave -* the decision to user space since the remote device could -* be legitimate or malicious. -*/ -if (hci_find_ltk (hcon->hdev, &hcon->dst, hcon->dst_type, - hcon->role)) { -/* Set passkey to 0. The value can be any number since -* it'll be ignored anyway. -*/ - passkey =0 ; - confirm_hint =1 ; - goto confirm; - } } mackey_and_ltk:
@@ -2221,11 +2203,12 @@ static u8 smp_cmd_pairing_random(struct l2cap_conn *conn, struct sk_buff *skb)if (err)return SMP_UNSPECIFIED ; - confirm_hint =0 ; - -confirm: -if (smp->method ==JUST_WORKS ) - confirm_hint =1 ; +/* Always require user confirmation for Just-Works pairing to prevent +* impersonation attacks, or in case of a legitimate device that is +* repairing use the confirmation as acknowledgment to proceed with the +* creation of new keys. +*/ + confirm_hint = smp->method ==JUST_WORKS ?1 :0 ; err =mgmt_user_confirm_request (hcon->hdev, &hcon->dst, hcon->type, hcon->dst_type, passkey, confirm_hint);
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 258/300 net: aquantia: Add missing descriptor cache invalidation on ATL2
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kai-Heng Feng <[email protected]>
[ Upstream commit 7526183cfdbe352c51c285762f0e15b7c428ea06 ]
ATL2 hardware was missing descriptor cache invalidation in hw_stop(), causing SMMU translation faults during device shutdown and module removal:
[ 70.355743] arm-smmu-v3 arm-smmu-v3.5.auto: event 0x10 received: [ 70.361893] arm-smmu-v3 arm-smmu-v3.5.auto: 0x0002060000000010 [ 70.367948] arm-smmu-v3 arm-smmu-v3.5.auto: 0x0000020000000000 [ 70.374002] arm-smmu-v3 arm-smmu-v3.5.auto: 0x00000000ff9bc000 [ 70.380055] arm-smmu-v3 arm-smmu-v3.5.auto: 0x0000000000000000 [ 70.386109] arm-smmu-v3 arm-smmu-v3.5.auto: event: F_TRANSLATION client: 0001:06:00.0 sid: 0x20600 ssid: 0x0 iova: 0xff9bc000 ipa: 0x0 [ 70.398531] arm-smmu-v3 arm-smmu-v3.5.auto: unpriv data write s1 "Input address caused fault" stag: 0x0
Commit 7a1bb49461b1 ("net: aquantia: fix potential IOMMU fault after driver unbind") and commit ed4d81c4b3f2 ("net: aquantia: when cleaning hw cache it should be toggled") fixed cache invalidation for ATL B0, but ATL2 was left with only interrupt disabling. This allowed hardware to write to cached descriptors after DMA memory was unmapped, triggering SMMU faults. Once cache invalidation is applied to ATL2, the translation fault can't be observed anymore.
Add shared aq_hw_invalidate_descriptor_cache() helper and use it in both ATL B0 and ATL2 hw_stop() implementations for consistent behavior.
--- .../ethernet/aquantia/atlantic/aq_hw_utils.c | 22 +++++++++++++++++++ .../ethernet/aquantia/atlantic/aq_hw_utils.h | 1 + .../aquantia/atlantic/hw_atl/hw_atl_b0.c | 19 +--------------- .../aquantia/atlantic/hw_atl2/hw_atl2.c | 2 +- 4 files changed, 25 insertions(+), 19 deletions(-)
drivers/net/ethernet/aquantia/atlantic/aq_hw_utils.c +22 -0
@@ -15,6 +15,7 @@#include "aq_hw.h" #include "aq_nic.h" +#include "hw_atl/hw_atl_llh.h" void aq_hw_write_reg_bit (struct aq_hw_s *aq_hw,u32 addr,u32 msk,u32 shift,u32 val)
@@ -81,6 +82,27 @@ void aq_hw_write_reg64(struct aq_hw_s *hw, u32 reg, u64 value)lo_hi_writeq (value, hw->mmio + reg); } +int aq_hw_invalidate_descriptor_cache (struct aq_hw_s *hw) +{ +int err; +u32 val; + +/* Invalidate Descriptor Cache to prevent writing to the cached +* descriptors and to the data pointer of those descriptors +*/ +hw_atl_rdm_rx_dma_desc_cache_init_tgl (hw); + + err =aq_hw_err_from_flags (hw); +if (err) + goto err_exit; + +readx_poll_timeout_atomic (hw_atl_rdm_rx_dma_desc_cache_init_done_get, + hw, val, val ==1 ,1000U ,10000U ); + +err_exit: +return err; +} +int aq_hw_err_from_flags (struct aq_hw_s *hw) {int err =0 ;
drivers/net/ethernet/aquantia/atlantic/aq_hw_utils.h +1 -0
@@ -35,6 +35,7 @@ u32 aq_hw_read_reg(struct aq_hw_s *hw, u32 reg);void aq_hw_write_reg (struct aq_hw_s *hw,u32 reg,u32 value);u64 aq_hw_read_reg64 (struct aq_hw_s *hw,u32 reg);void aq_hw_write_reg64 (struct aq_hw_s *hw,u32 reg,u64 value); +int aq_hw_invalidate_descriptor_cache (struct aq_hw_s *hw);int aq_hw_err_from_flags (struct aq_hw_s *hw);int aq_hw_num_tcs (struct aq_hw_s *hw);int aq_hw_q_per_tc (struct aq_hw_s *hw);
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c +1 -18
@@ -1198,26 +1198,9 @@ static int hw_atl_b0_hw_interrupt_moderation_set(struct aq_hw_s *self)static int hw_atl_b0_hw_stop (struct aq_hw_s *self) { -int err; -u32 val; -hw_atl_b0_hw_irq_disable (self,HW_ATL_B0_INT_MASK ); -/* Invalidate Descriptor Cache to prevent writing to the cached -* descriptors and to the data pointer of those descriptors -*/ -hw_atl_rdm_rx_dma_desc_cache_init_tgl (self); - - err =aq_hw_err_from_flags (self); - -if (err) - goto err_exit; - -readx_poll_timeout_atomic (hw_atl_rdm_rx_dma_desc_cache_init_done_get, - self, val, val ==1 ,1000U ,10000U ); - -err_exit: -return err; +return aq_hw_invalidate_descriptor_cache (self); }int hw_atl_b0_hw_ring_tx_stop (struct aq_hw_s *self,struct aq_ring_s *ring)
drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c +1 -1
@@ -759,7 +759,7 @@ static int hw_atl2_hw_stop(struct aq_hw_s *self) {hw_atl_b0_hw_irq_disable (self,HW_ATL2_INT_MASK ); -return 0 ; +return aq_hw_invalidate_descriptor_cache (self); }static struct aq_stats_s *hw_atl2_utils_get_hw_stats (struct aq_hw_s *self)
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 259/300 net/mlx5e: Fix validation logic in rate limiting
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Danielle Costantino <[email protected]>
[ Upstream commit d2099d9f16dbfa1c5266d4230ff7860047bb0b68 ]
The rate limiting validation condition currently checks the output variable max_bw_value[i] instead of the input value maxrate->tc_maxrate[i]. This causes the validation to compare an uninitialized or stale value rather than the actual requested rate.
The condition should check the input rate to properly validate against the upper limit:
} else if (maxrate->tc_maxrate[i] <= upper_limit_gbps) {This aligns with the pattern used in the first branch, which correctly checks maxrate->tc_maxrate[i] against upper_limit_mbps.
The current implementation can lead to unreliable validation behavior:
- For rates between 25.5 Gbps and 255 Gbps, if max_bw_value[i] is 0 from initialization, the GBPS path may be taken regardless of whether the actual rate is within bounds
- When processing multiple TCs (i > 0), max_bw_value[i] contains the value computed for the previous TC, affecting the validation logic
- The overflow check for rates exceeding 255 Gbps may not trigger consistently depending on previous array values
This patch ensures the validation correctly examines the requested rate value for proper bounds checking.
--- drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c +1 -1
@@ -606,7 +606,7 @@ static int mlx5e_dcbnl_ieee_setmaxrate(struct net_device *netdev, MLX5E_100MB); max_bw_value[i] = max_bw_value[i] ? max_bw_value[i] :1 ; max_bw_unit[i] =MLX5_100_MBPS_UNIT ; - }else if (max_bw_value[i] <= upper_limit_gbps) { + }else if (maxrate->tc_maxrate[i] <= upper_limit_gbps) { max_bw_value[i] =div_u64 (maxrate->tc_maxrate[i],MLX5E_1GB ); max_bw_unit[i] =MLX5_GBPS_UNIT ;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 260/300 net: sxgbe: fix potential NULL dereference in sxgbe_rx()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexey Kodanev <[email protected]>
[ Upstream commit f5bce28f6b9125502abec4a67d68eabcd24b3b17 ]
Currently, when skb is null, the driver prints an error and then dereferences skb on the next line.
To fix this, let's add a 'break' after the error message to switch to sxgbe_rx_refill(), which is similar to the approach taken by the other drivers in this particular case, e.g. calxeda with xgmac_rx().
Found during a code review.
--- drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c +3 -1
@@ -1518,8 +1518,10 @@ static int sxgbe_rx(struct sxgbe_priv_data *priv, int limit) skb = priv->rxq[qnum]->rx_skbuff[entry]; -if (unlikely (!skb)) +if (unlikely (!skb)) {netdev_err (priv->dev,"rx descriptor is not consistent\n" ); +break ; + }prefetch (skb->data -NET_IP_ALIGN ); priv->rxq[qnum]->rx_skbuff[entry] =NULL ;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 261/300 net: atlantic: fix fragment overflow handling in RX path
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiefeng Zhang <[email protected]>
[ Upstream commit 5ffcb7b890f61541201461580bb6622ace405aec ]
The atlantic driver can receive packets with more than MAX_SKB_FRAGS (17) fragments when handling large multi-descriptor packets. This causes an out-of-bounds write in skb_add_rx_frag_netmem() leading to kernel panic.
The issue occurs because the driver doesn't check the total number of fragments before calling skb_add_rx_frag(). When a packet requires more than MAX_SKB_FRAGS fragments, the fragment index exceeds the array bounds.
Fix by assuming there will be an extra frag if buff->len > AQ_CFG_RX_HDR_SIZE, then all fragments are accounted for. And reusing the existing check to prevent the overflow earlier in the code path.
This crash occurred in production with an Aquantia AQC113 10G NIC.
Stack trace from production environment:
``` RIP: 0010:skb_add_rx_frag_netmem+0x29/0xd0 Code: 90 f3 0f 1e fa 0f 1f 44 00 00 48 89 f8 41 89 ca 48 89 d7 48 63 ce 8b 90 c0 00 00 00 48 c1 e1 04 48 01 ca 48 03 90 c8 00 00 00 <48> 89 7a 30 44 89 52 3c 44 89 42 38 40 f6 c7 01 75 74 48 89 fa 83 RSP: 0018:ffffa9bec02a8d50 EFLAGS: 00010287 RAX: ffff925b22e80a00 RBX: ffff925ad38d2700 RCX: fffffffe0a0c8000 RDX: ffff9258ea95bac0 RSI: ffff925ae0a0c800 RDI: 0000000000037a40 RBP: 0000000000000024 R08: 0000000000000000 R09: 0000000000000021 R10: 0000000000000848 R11: 0000000000000000 R12: ffffa9bec02a8e24 R13: ffff925ad8615570 R14: 0000000000000000 R15: ffff925b22e80a00 FS: 0000000000000000(0000) GS:ffff925e47880000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff9258ea95baf0 CR3: 0000000166022004 CR4: 0000000000f72ef0 PKRU: 55555554 Call Trace: <IRQ> aq_ring_rx_clean+0x175/0xe60 [atlantic] ? aq_ring_rx_clean+0x14d/0xe60 [atlantic] ? aq_ring_tx_clean+0xdf/0x190 [atlantic] ? kmem_cache_free+0x348/0x450 ? aq_vec_poll+0x81/0x1d0 [atlantic] ? __napi_poll+0x28/0x1c0 ? net_rx_action+0x337/0x420 ```
Changes in v4:
- Add Fixes: tag to satisfy patch validation requirements.
Changes in v3:
- Fix by assuming there will be an extra frag if buff->len > AQ_CFG_RX_HDR_SIZE, then all fragments are accounted for.
--- drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ethernet/aquantia/atlantic/aq_ring.c +5 -0
@@ -363,6 +363,11 @@ int aq_ring_rx_clean(struct aq_ring_s *self,if (!buff->is_eop) {unsigned int frag_cnt =0U ; + +/* There will be an extra fragment */ +if (buff->len >AQ_CFG_RX_HDR_SIZE ) + frag_cnt++; + buff_ = buff; do { bool is_rsc_completed = true;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 262/300 mailbox: mailbox-test: Fix debugfs_create_dir error checking
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haotian Zhang <[email protected]>
[ Upstream commit 3acf1028f5003731977f750a7070f3321a9cb740 ]
The debugfs_create_dir() function returns ERR_PTR() on error, not NULL. The current null-check fails to catch errors.
Use IS_ERR() to correctly check for errors.
--- drivers/mailbox/mailbox-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mailbox/mailbox-test.c +1 -1
@@ -267,7 +267,7 @@ static int mbox_test_add_debugfs(struct platform_device *pdev,return 0 ; tdev->root_debugfs_dir =debugfs_create_dir (dev_name (&pdev->dev),NULL ); -if (!tdev->root_debugfs_dir) { +if (IS_ERR (tdev->root_debugfs_dir)) {dev_err (&pdev->dev,"Failed to create Mailbox debugfs\n" );return -EINVAL ; }
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 263/300 spi: bcm63xx: fix premature CS deassertion on RX-only transactions
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hang Zhou <[email protected]>
[ Upstream commit fd9862f726aedbc2f29a29916cabed7bcf5cadb6 ]
On BCM6358 (and also observed on BCM6368) the controller appears to only generate as many SPI clocks as bytes that have been written into the TX FIFO. For RX-only transfers the driver programs the transfer length in SPI_MSG_CTL but does not write anything into the FIFO, so chip select is deasserted early and the RX transfer segment is never fully clocked in.
A concrete failing case is a three-transfer MAC address read from SPI-NOR:
- TX 0x03 (read command)
- TX 3-byte address
- RX 6 bytes (MAC)
In contrast, a two-transfer JEDEC-ID read (0x9f + 6-byte RX) works because the driver uses prepend_len and writes dummy bytes into the TX FIFO for the RX part.
Fix this by writing 0xff dummy bytes into the TX FIFO for RX-only segments so that the number of bytes written to the FIFO matches the total message length seen by the controller.
--- drivers/spi/spi-bcm63xx.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/spi/spi-bcm63xx.c +14 -0
@@ -257,6 +257,20 @@ static int bcm63xx_txrx_bufs(struct spi_device *spi, struct spi_transfer *first,if (t->rx_buf) { do_rx = true; + +/* +* In certain hardware implementations, there appears to be a +* hidden accumulator that tracks the number of bytes written into +* the hardware FIFO, and this accumulator overrides the length in +* the SPI_MSG_CTL register. +* +* Therefore, for read-only transfers, we need to write some dummy +* value into the FIFO to keep the accumulator tracking the correct +* length. +*/ +if (!t->tx_buf) +memset_io (bs->tx_io + len,0xFF , t->len); +/* prepend is half-duplex write only */ if (t == first) prepend_len =0 ;
Signature · 1 line
2.51.0
Greg Kroah-Hartman
maintainerPATCH 264/300 Revert "perf/x86: Always store regs->ip in perf_callchain_kernel()"
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiri Olsa <[email protected]>
commit 6d08340d1e354787d6c65a8c3cdd4d41ffb8a5ed upstream.
This reverts commit 83f44ae0f8afcc9da659799db8693f74847e66b3.
Currently we store initial stacktrace entry twice for non-HW ot_regs, which means callers that fail perf_hw_regs(regs) condition in perf_callchain_kernel.
It's easy to reproduce this bpftrace:
# bpftrace -e 'tracepoint:sched:sched_process_exec { print(kstack()); }'
Attaching 1 probe... bprm_execve+1767
bprm_execve+1767
do_execveat_common.isra.0+425
__x64_sys_execve+56
do_syscall_64+133
entry_SYSCALL_64_after_hwframe+118When perf_callchain_kernel calls unwind_start with first_frame, AFAICS we do not skip regs->ip, but it's added as part of the unwind process. Hence reverting the extra perf_callchain_store for non-hw regs leg.
I was not able to bisect this, so I'm not really sure why this was needed in v5.2 and why it's not working anymore, but I could see double entries as far as v5.10.
I did the test for both ORC and framepointer unwind with and without the this fix and except for the initial entry the stacktraces are the same.
--- arch/x86/events/core.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
arch/x86/events/core.c +5 -5
@@ -2554,13 +2554,13 @@ perf_callchain_kernel(struct perf_callchreturn ; } -if (perf_callchain_store (entry, regs->ip)) -return ; - -if (perf_hw_regs (regs)) +if (perf_hw_regs (regs)) { +if (perf_callchain_store (entry, regs->ip)) +return ;unwind_start (&state, current, regs,NULL ); -else + }else {unwind_start (&state, current,NULL , (void *)regs->sp); + }for (; !unwind_done (&state);unwind_next_frame (&state)) { addr =unwind_get_return_address (&state);
Greg Kroah-Hartman
maintainerPATCH 265/300 iio: imu: st_lsm6dsx: fix array size for st_lsm6dsx_settings fields
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Francesco Lavra <[email protected]>
commit 3af0c1fb1cdc351b64ff1a4bc06d491490c1f10a upstream.
The decimator and batch fields of struct st_lsm6dsx_settings are arrays indexed by sensor type, not by sensor hardware identifier; moreover, the batch field is only used for the accelerometer and gyroscope.
Change the array size for decimator from ST_LSM6DSX_MAX_ID to ST_LSM6DSX_ID_MAX, and change the array size for batch from ST_LSM6DSX_MAX_ID to 2; move the enum st_lsm6dsx_sensor_id definition so that the ST_LSM6DSX_ID_MAX value is usable within the struct st_lsm6dsx_settings definition.
--- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h +11 -11
@@ -221,6 +221,15 @@ struct st_lsm6dsx_event_settings {u8 wakeup_src_x_mask; }; +enum st_lsm6dsx_sensor_id { +ST_LSM6DSX_ID_GYRO , +ST_LSM6DSX_ID_ACC , +ST_LSM6DSX_ID_EXT0 , +ST_LSM6DSX_ID_EXT1 , +ST_LSM6DSX_ID_EXT2 , +ST_LSM6DSX_ID_MAX +}; +enum st_lsm6dsx_ext_sensor_id {ST_LSM6DSX_ID_MAGN , };
@@ -307,23 +316,14 @@ struct st_lsm6dsx_settings {struct st_lsm6dsx_reg drdy_mask;struct st_lsm6dsx_odr_table_entry odr_table[2 ];struct st_lsm6dsx_fs_table_entry fs_table[2 ]; -struct st_lsm6dsx_reg decimator[ST_LSM6DSX_MAX_ID ]; -struct st_lsm6dsx_reg batch[ST_LSM6DSX_MAX_ID ]; +struct st_lsm6dsx_reg decimator[ST_LSM6DSX_ID_MAX ]; +struct st_lsm6dsx_reg batch[2 ];struct st_lsm6dsx_fifo_ops fifo_ops;struct st_lsm6dsx_hw_ts_settings ts_settings;struct st_lsm6dsx_shub_settings shub_settings;struct st_lsm6dsx_event_settings event_settings; }; -enum st_lsm6dsx_sensor_id { -ST_LSM6DSX_ID_GYRO , -ST_LSM6DSX_ID_ACC , -ST_LSM6DSX_ID_EXT0 , -ST_LSM6DSX_ID_EXT1 , -ST_LSM6DSX_ID_EXT2 , -ST_LSM6DSX_ID_MAX , -}; -enum st_lsm6dsx_fifo_mode {ST_LSM6DSX_FIFO_BYPASS =0x0 ,ST_LSM6DSX_FIFO_CONT =0x6 ,
Greg Kroah-Hartman
maintainerPATCH 266/300 iio:common:ssp_sensors: Fix an error handling path ssp_probe()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe JAILLET <[email protected]>
commit 21553258b94861a73d7f2cf15469d69240e1170d upstream.
If an error occurs after a successful mfd_add_devices() call, it should be undone by a corresponding mfd_remove_devices() call, as already done in the remove function.
--- drivers/iio/common/ssp_sensors/ssp_dev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/iio/common/ssp_sensors/ssp_dev.c +3 -1
@@ -515,7 +515,7 @@ static int ssp_probe(struct spi_device * ret =spi_setup (spi);if (ret <0 ) {dev_err (&spi->dev,"Failed to setup spi\n" ); -return ret; + goto err_setup_spi; } data->fw_dl_state =SSP_FW_DL_STATE_NONE ;
@@ -580,6 +580,8 @@ err_read_reg: err_setup_irq:mutex_destroy (&data->pending_lock);mutex_destroy (&data->comm_lock); +err_setup_spi: +mfd_remove_devices (&spi->dev);dev_err (&spi->dev,"Probe failed!\n" );
Greg Kroah-Hartman
maintainerPATCH 267/300 MIPS: mm: Prevent a TLB shutdown on initial uniquification
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maciej W. Rozycki <[email protected]>
commit 9f048fa487409e364cf866c957cf0b0d782ca5a3 upstream.
Depending on the particular CPU implementation a TLB shutdown may occur if multiple matching entries are detected upon the execution of a TLBP or the TLBWI/TLBWR instructions. Given that we don't know what entries we have been handed we need to be very careful with the initial TLB setup and avoid all these instructions.
Therefore read all the TLB entries one by one with the TLBR instruction, bypassing the content addressing logic, and truncate any large pages in place so as to avoid a case in the second step where an incoming entry for a large page at a lower address overlaps with a replacement entry chosen at another index. Then preinitialize the TLB using addresses outside our usual unique range and avoiding clashes with any entries received, before making the usual call to local_flush_tlb_all().
This fixes (at least) R4x00 cores if TLBP hits multiple matching TLB entries (SGI IP22 PROM for examples sets up all TLBs to the same virtual address).
--- arch/mips/mm/tlb-r4k.c | 102 ++++++++++++++++++++++++++++++------------------- 1 file changed, 64 insertions(+), 38 deletions(-)
arch/mips/mm/tlb-r4k.c +64 -38
@@ -15,6 +15,7 @@#include <linux/mm.h> #include <linux/hugetlb.h> #include <linux/export.h> +#include <linux/sort.h> #include <asm/cpu.h> #include <asm/cpu-type.h>
@@ -498,55 +499,79 @@ static int __init set_ntlb(char *str)__setup ("ntlb=" , set_ntlb); -/* Initialise all TLB entries with unique values */ + +/* Comparison function for EntryHi VPN fields. */ +static int r4k_vpn_cmp (const void *a,const void *b) +{ +long v = *(unsigned long *)a - *(unsigned long *)b; +int s =sizeof (long ) >sizeof (int ) ?sizeof (long ) *8 -1 :0 ; +return s ? (v !=0 ) | v >> s : v; +} + +/* +* Initialise all TLB entries with unique values that do not clash with +* what we have been handed over and what we'll be using ourselves. +*/ static void r4k_tlb_uniquify (void ) { -int entry =num_wired_entries (); +unsigned long tlb_vpns[1 <<MIPS_CONF1_TLBS_SIZE ]; +int tlbsize = current_cpu_data.tlbsize; +int start =num_wired_entries (); +unsigned long vpn_mask; +int cnt, ent, idx, i; + + vpn_mask =GENMASK (cpu_vmbits -1 ,13 ); + vpn_mask |=IS_ENABLED (CONFIG_64BIT ) ?3ULL <<62 :1 <<31 ;htw_stop (); -write_c0_entrylo0 (0 ); -write_c0_entrylo1 (0 ); -while (entry < current_cpu_data.tlbsize) { -unsigned long asid_mask =cpu_asid_mask (¤t_cpu_data); -unsigned long asid =0 ; -int idx; +for (i = start, cnt =0 ; i < tlbsize; i++, cnt++) { +unsigned long vpn; -/* Skip wired MMID to make ginvt_mmid work */ -if (cpu_has_mmid) - asid =MMID_KERNEL_WIRED +1 ; +write_c0_index (i); +mtc0_tlbr_hazard (); +tlb_read (); +tlb_read_hazard (); + vpn =read_c0_entryhi (); + vpn &= vpn_mask &PAGE_MASK ; + tlb_vpns[cnt] = vpn; -/* Check for match before using UNIQUE_ENTRYHI */ -do { -if (cpu_has_mmid) { -write_c0_memorymapid (asid); -write_c0_entryhi (UNIQUE_ENTRYHI (entry)); - }else { -write_c0_entryhi (UNIQUE_ENTRYHI (entry) | asid); - } -mtc0_tlbw_hazard (); -tlb_probe (); -tlb_probe_hazard (); - idx =read_c0_index (); -/* No match or match is on current entry */ -if (idx <0 || idx == entry) -break ; -/* -* If we hit a match, we need to try again with -* a different ASID. -*/ - asid++; - }while (asid < asid_mask); - -if (idx >=0 && idx != entry) -panic ("Unable to uniquify TLB entry %d" , idx); - -write_c0_index (entry); +/* Prevent any large pages from overlapping regular ones. */ +write_c0_pagemask (read_c0_pagemask () &PM_DEFAULT_MASK );mtc0_tlbw_hazard ();tlb_write_indexed (); - entry++; +tlbw_use_hazard (); } +sort (tlb_vpns, cnt,sizeof (tlb_vpns[0 ]), r4k_vpn_cmp,NULL ); + +write_c0_pagemask (PM_DEFAULT_MASK ); +write_c0_entrylo0 (0 ); +write_c0_entrylo1 (0 ); + + idx =0 ; + ent = tlbsize; +for (i = start; i < tlbsize; i++) +while (1 ) { +unsigned long entryhi, vpn; + + entryhi =UNIQUE_ENTRYHI (ent); + vpn = entryhi & vpn_mask &PAGE_MASK ; + +if (idx >= cnt || vpn < tlb_vpns[idx]) { +write_c0_entryhi (entryhi); +write_c0_index (i); +mtc0_tlbw_hazard (); +tlb_write_indexed (); + ent++; +break ; + }else if (vpn == tlb_vpns[idx]) { + ent++; + }else { + idx++; + } + } +tlbw_use_hazard ();htw_start ();flush_micro_tlb ();
@@ -592,6 +617,7 @@ static void r4k_tlb_configure(void)/* From this point on the ARC firmware is dead. */ r4k_tlb_uniquify (); +local_flush_tlb_all ();/* Did I tell you that ARC SUCKS? */ }
Greg Kroah-Hartman
maintainerPATCH 268/300 MIPS: mm: kmalloc tlb_vpn array to avoid stack overflow
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Bogendoerfer <[email protected]>
commit 841ecc979b18d3227fad5e2d6a1e6f92688776b5 upstream.
Owing to Config4.MMUSizeExt and VTLB/FTLB MMU features later MIPSr2+ cores can have more than 64 TLB entries. Therefore allocate an array for uniquification instead of placing too an small array on the stack.
--- arch/mips/mm/tlb-r4k.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
arch/mips/mm/tlb-r4k.c +16 -2
@@ -12,6 +12,7 @@#include <linux/init.h> #include <linux/sched.h> #include <linux/smp.h> +#include <linux/memblock.h> #include <linux/mm.h> #include <linux/hugetlb.h> #include <linux/export.h>
@@ -512,17 +513,26 @@ static int r4k_vpn_cmp(const void *a, co* Initialise all TLB entries with unique values that do not clash with * what we have been handed over and what we'll be using ourselves. */ -static void r4k_tlb_uniquify (void ) +static void __ref r4k_tlb_uniquify (void ) { -unsigned long tlb_vpns[1 <<MIPS_CONF1_TLBS_SIZE ];int tlbsize = current_cpu_data.tlbsize; +bool use_slab =slab_is_available ();int start =num_wired_entries (); +phys_addr_t tlb_vpn_size; +unsigned long *tlb_vpns;unsigned long vpn_mask;int cnt, ent, idx, i; vpn_mask =GENMASK (cpu_vmbits -1 ,13 ); vpn_mask |=IS_ENABLED (CONFIG_64BIT ) ?3ULL <<62 :1 <<31 ; + tlb_vpn_size = tlbsize *sizeof (*tlb_vpns); + tlb_vpns = (use_slab ? +kmalloc (tlb_vpn_size,GFP_KERNEL ) : +memblock_alloc_raw (tlb_vpn_size,sizeof (*tlb_vpns))); +if (WARN_ON (!tlb_vpns)) +return ;/* Pray local_flush_tlb_all() is good enough. */ +htw_stop ();for (i = start, cnt =0 ; i < tlbsize; i++, cnt++) {
@@ -575,6 +585,10 @@ static void r4k_tlb_uniquify(void)tlbw_use_hazard ();htw_start ();flush_micro_tlb (); +if (use_slab) +kfree (tlb_vpns); +else +memblock_free (tlb_vpns, tlb_vpn_size); }/*
Greg Kroah-Hartman
maintainerPATCH 269/300 atm/fore200e: Fix possible data race in fore200e_open()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gui-Dong Han <[email protected]>
commit 82fca3d8a4a34667f01ec2351a607135249c9cff upstream.
Protect access to fore200e->available_cell_rate with rate_mtx lock in the error handling path of fore200e_open() to prevent a data race.
The field fore200e->available_cell_rate is a shared resource used to track available bandwidth. It is concurrently accessed by fore200e_open(), fore200e_close(), and fore200e_change_qos().
In fore200e_open(), the lock rate_mtx is correctly held when subtracting vcc->qos.txtp.max_pcr from available_cell_rate to reserve bandwidth. However, if the subsequent call to fore200e_activate_vcin() fails, the function restores the reserved bandwidth by adding back to available_cell_rate without holding the lock.
This introduces a race condition because available_cell_rate is a global device resource shared across all VCCs. If the error path in fore200e_open() executes concurrently with operations like fore200e_close() or fore200e_change_qos() on other VCCs, a read-modify-write race occurs.
Specifically, the error path reads the rate without the lock. If another CPU acquires the lock and modifies the rate (e.g., releasing bandwidth in fore200e_close()) between this read and the subsequent write, the error path will overwrite the concurrent update with a stale value. This results in incorrect bandwidth accounting.
--- drivers/atm/fore200e.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/atm/fore200e.c +2 -0
@@ -1379,7 +1379,9 @@ fore200e_open(struct atm_vcc *vcc) vcc->dev_data =NULL ; +mutex_lock (&fore200e->rate_mtx); fore200e->available_cell_rate += vcc->qos.txtp.max_pcr; +mutex_unlock (&fore200e->rate_mtx);kfree (fore200e_vcc);return -EINVAL ;
Greg Kroah-Hartman
maintainerPATCH 270/300 can: sja1000: fix max irq loop handling
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Mühlbacher <[email protected]>
commit 30db4451c7f6aabcada029b15859a76962ec0cf8 upstream.
Reading the interrupt register SJA1000_IR causes all of its bits to be reset. If we ever reach the condition of handling more than SJA1000_MAX_IRQ IRQs, we will have read the register and reset all its bits but without actually handling the interrupt inside of the loop body.
This may, among other issues, cause us to never netif_wake_queue() again after a transmission interrupt.
--- drivers/net/can/sja1000/sja1000.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/can/sja1000/sja1000.c +2 -2
@@ -511,8 +511,8 @@ irqreturn_t sja1000_interrupt(int irq, vif (priv->read_reg (priv,SJA1000_IER ) ==IRQ_OFF ) goto out; -while ((isrc = priv->read_reg (priv,SJA1000_IR )) && - (n <SJA1000_MAX_IRQ )) { +while ((n <SJA1000_MAX_IRQ ) && + (isrc = priv->read_reg (priv,SJA1000_IR ))) { status = priv->read_reg (priv,SJA1000_SR );/* check for absent controller due to hw unplug */
Greg Kroah-Hartman
maintainerPATCH 271/300 can: sun4i_can: sun4i_can_interrupt(): fix max irq loop handling
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Kleine-Budde <[email protected]>
commit 76544beea7cfe5bcce6d60f53811657b88ec8be1 upstream.
Reading the interrupt register SUN4I_REG_INT_ADDR causes all of its bits to be reset. If we ever reach the condition of handling more than SUN4I_CAN_MAX_IRQ IRQs, we will have read the register and reset all its bits but without actually handling the interrupt inside of the loop body.
This may, among other issues, cause us to never netif_wake_queue() again after a transmission interrupt.
--- drivers/net/can/sun4i_can.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/can/sun4i_can.c +2 -2
@@ -644,8 +644,8 @@ static irqreturn_t sun4i_can_interrupt(iu8 isrc, status;int n =0 ; -while ((isrc =readl (priv->base +SUN4I_REG_INT_ADDR )) && - (n <SUN4I_CAN_MAX_IRQ )) { +while ((n <SUN4I_CAN_MAX_IRQ ) && + (isrc =readl (priv->base +SUN4I_REG_INT_ADDR ))) { n++; status =readl (priv->base +SUN4I_REG_STA_ADDR );
Greg Kroah-Hartman
maintainerPATCH 272/300 dm-verity: fix unreliable memory allocation
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <[email protected]>
commit fe680d8c747f4e676ac835c8c7fb0f287cd98758 upstream.
GFP_NOWAIT allocation may fail anytime. It needs to be changed to GFP_NOIO. There's no need to handle an error because mempool_alloc with GFP_NOIO can't fail.
--- drivers/md/dm-verity-fec.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/md/dm-verity-fec.c +1 -5
@@ -314,11 +314,7 @@ static int fec_alloc_bufs(struct dm_veriif (fio->bufs[n])continue ; - fio->bufs[n] =mempool_alloc (&v->fec->prealloc_pool,GFP_NOWAIT ); -if (unlikely (!fio->bufs[n])) { -DMERR ("failed to allocate FEC buffer" ); -return -ENOMEM ; - } + fio->bufs[n] =mempool_alloc (&v->fec->prealloc_pool,GFP_NOIO ); }/* try to allocate the maximum number of buffers */
Greg Kroah-Hartman
maintainerPATCH 273/300 thunderbolt: Add support for Intel Wildcat Lake
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Borzeszkowski <[email protected]>
commit 3575254546a27210a4b661ea37fbbfb836c0815d upstream.
Intel Wildcat Lake derives its Thunderbolt/USB4 controller from Lunar Lake platform. Add Wildcat Lake PCI ID to the driver list of supported devices.
--- drivers/thunderbolt/nhi.c | 2 ++ drivers/thunderbolt/nhi.h | 1 + 2 files changed, 3 insertions(+)
drivers/thunderbolt/nhi.c +2 -0
@@ -1375,6 +1375,8 @@ static struct pci_device_id nhi_ids[] = .driver_data = (kernel_ulong_t)&icl_nhi_ops }, { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_PTL_P_NHI1), .driver_data = (kernel_ulong_t)&icl_nhi_ops }, + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_WCL_NHI0), + .driver_data = (kernel_ulong_t)&icl_nhi_ops }, { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_BARLOW_RIDGE_HOST_80G_NHI) }, { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_BARLOW_RIDGE_HOST_40G_NHI) },
drivers/thunderbolt/nhi.h +1 -0
@@ -75,6 +75,7 @@ extern const struct tb_nhi_ops icl_nhi_o#define PCI_DEVICE_ID_INTEL_TITAN_RIDGE_DD_BRIDGE 0x15ef#define PCI_DEVICE_ID_INTEL_ADL_NHI0 0x463e#define PCI_DEVICE_ID_INTEL_ADL_NHI1 0x466d +#define PCI_DEVICE_ID_INTEL_WCL_NHI0 0x4d33#define PCI_DEVICE_ID_INTEL_BARLOW_RIDGE_HOST_80G_NHI 0x5781#define PCI_DEVICE_ID_INTEL_BARLOW_RIDGE_HOST_40G_NHI 0x5784#define PCI_DEVICE_ID_INTEL_MTL_M_NHI0 0x7eb2
Greg Kroah-Hartman
maintainerPATCH 274/300 slimbus: ngd: Fix reference count leak in qcom_slim_ngd_notify_slaves
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miaoqian Lin <[email protected]>
commit 96cf8500934e0ce2a6c486f1dbc3b1fff12f7a5e upstream.
The function qcom_slim_ngd_notify_slaves() calls of_slim_get_device() which internally uses device_find_child() to obtain a device reference. According to the device_find_child() documentation,
the caller must drop the reference with put_device() after use.
Found via static analysis and this is similar to commit 4e65bda8273c ("ASoC: wcd934x: fix error handling in wcd934x_codec_parse_data()")
--- drivers/slimbus/qcom-ngd-ctrl.c | 1 + 1 file changed, 1 insertion(+)
drivers/slimbus/qcom-ngd-ctrl.c +1 -0
@@ -1149,6 +1149,7 @@ static void qcom_slim_ngd_notify_slaves(if (slim_get_logical_addr (sbdev))dev_err (ctrl->dev,"Failed to get logical address\n" ); +put_device (&sbdev->dev); } }
Greg Kroah-Hartman
maintainerPATCH 275/300 firmware: stratix10-svc: fix bug in saving controller data
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Khairul Anuar Romli <[email protected]>
commit d0fcf70c680e4d1669fcb3a8632f41400b9a73c2 upstream.
Fix the incorrect usage of platform_set_drvdata and dev_set_drvdata. They both are of the same data and overrides each other. This resulted in the rmmod of the svc driver to fail and throw a kernel panic for kthread_stop and fifo free.
--- drivers/firmware/stratix10-svc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/firmware/stratix10-svc.c +4 -3
@@ -127,6 +127,7 @@ struct stratix10_svc_data {* @complete_status: state for completion * @svc_fifo_lock: protect access to service message data queue * @invoke_fn: function to issue secure monitor call or hypervisor call +* @svc: manages the list of client svc drivers * * This struct is used to create communication channels for service clients, to * handle secure monitor or hypervisor call.
@@ -143,6 +144,7 @@ struct stratix10_svc_controller {struct completion complete_status;spinlock_t svc_fifo_lock;svc_invoke_fn *invoke_fn; +struct stratix10_svc *svc; };/**
@@ -1038,6 +1040,7 @@ static int stratix10_svc_drv_probe(struc ret = -ENOMEM ; goto err_free_kfifo; } + controller->svc = svc; svc->stratix10_svc_rsu =platform_device_alloc (STRATIX10_RSU ,0 );if (!svc->stratix10_svc_rsu) {
@@ -1050,8 +1053,6 @@ static int stratix10_svc_drv_probe(strucif (ret) goto err_put_device; -dev_set_drvdata (dev, svc); -pr_info ("Intel Service Layer Driver Initialized\n" );return 0 ;
@@ -1065,8 +1066,8 @@ err_free_kfifo:static int stratix10_svc_drv_remove (struct platform_device *pdev) { -struct stratix10_svc *svc =dev_get_drvdata (&pdev->dev);struct stratix10_svc_controller *ctrl =platform_get_drvdata (pdev); +struct stratix10_svc *svc = ctrl->svc;platform_device_unregister (svc->stratix10_svc_rsu);
Greg Kroah-Hartman
maintainerPATCH 276/300 serial: amba-pl011: prefer dma_mapping_error() over explicit address checking
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miaoqian Lin <[email protected]>
commit eb4917f557d43c7a1c805dd73ffcdfddb2aba39a upstream.
Check for returned DMA addresses using specialized dma_mapping_error() helper which is generally recommended for this purpose by Documentation/core-api/dma-api.rst:
"In some circumstances dma_map_single(), ...
will fail to create a mapping. A driver can check for these errors by testing the returned DMA address with dma_mapping_error()."
Found via static analysis and this is similar to commit fa0308134d26 ("ALSA: memalloc: prefer dma_mapping_error() over explicit address checking")
--- drivers/tty/serial/amba-pl011.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/amba-pl011.c +1 -1
@@ -636,7 +636,7 @@ static int pl011_dma_tx_refill(struct ua dmatx->len = count; dmatx->dma =dma_map_single (dma_dev->dev, dmatx->buf, count,DMA_TO_DEVICE ); -if (dmatx->dma ==DMA_MAPPING_ERROR ) { +if (dma_mapping_error (dma_dev->dev, dmatx->dma)) { uap->dmatx.queued = false;dev_dbg (uap->port.dev,"unable to map TX DMA\n" );return -EBUSY ;
Greg Kroah-Hartman
maintainerPATCH 277/300 most: usb: fix double free on late probe failure
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit baadf2a5c26e802a46573eaad331b427b49aaa36 upstream.
The MOST subsystem has a non-standard registration function which frees the interface on registration failures and on deregistration.
This unsurprisingly leads to bugs in the MOST drivers, and a couple of recent changes turned a reference underflow and use-after-free in the USB driver into several double free and a use-after-free on late probe failures.
--- drivers/most/most_usb.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/most/most_usb.c +5 -9
@@ -1058,7 +1058,7 @@ hdm_probe(struct usb_interface *interface, const struct usb_device_id *id) ret =most_register_interface (&mdev->iface);if (ret) - goto err_free_busy_urbs; +return ret;mutex_lock (&mdev->io_mutex); if (le16_to_cpu(usb_dev->descriptor.idProduct) == USB_DEV_ID_OS81118 ||
@@ -1068,8 +1068,7 @@ hdm_probe(struct usb_interface *interface, const struct usb_device_id *id)if (!mdev->dci) {mutex_unlock (&mdev->io_mutex);most_deregister_interface (&mdev->iface); - ret = -ENOMEM ; - goto err_free_busy_urbs; +return -ENOMEM ; } mdev->dci->dev.init_name ="dci" ;
@@ -1078,18 +1077,15 @@ hdm_probe(struct usb_interface *interface, const struct usb_device_id *id) mdev->dci->dev.release = release_dci;if (device_register (&mdev->dci->dev)) {mutex_unlock (&mdev->io_mutex); +put_device (&mdev->dci->dev);most_deregister_interface (&mdev->iface); - ret = -ENOMEM ; - goto err_free_dci; +return -ENOMEM ; } mdev->dci->usb_device = mdev->usb_device; }mutex_unlock (&mdev->io_mutex);return 0 ; -err_free_dci: -put_device (&mdev->dci->dev); -err_free_busy_urbs: -kfree (mdev->busy_urbs); + err_free_ep_address:kfree (mdev->ep_address); err_free_cap:
Signature · 1 line
2.52.0
Greg Kroah-Hartman
maintainerPATCH 278/300 usb: cdns3: Fix double resource release in cdns3_pci_probe
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miaoqian Lin <[email protected]>
commit 1ec39d2cd88dac2e7cdbac248762f1f057971c5d upstream.
The driver uses pcim_enable_device() to enable the PCI device, the device will be automatically disabled on driver detach through the managed device framework. The manual pci_disable_device() calls in the error paths are therefore redundant and should be removed.
Found via static anlaysis and this is similar to commit 99ca0b57e49f ("thermal: intel: int340x: processor: Fix warning during module unload").
--- drivers/usb/cdns3/cdns3-pci-wrap.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/usb/cdns3/cdns3-pci-wrap.c +1 -4
@@ -101,10 +101,8 @@ static int cdns3_pci_probe(struct pci_de wrap =pci_get_drvdata (func); }else { wrap =kzalloc (sizeof (*wrap),GFP_KERNEL ); -if (!wrap) { -pci_disable_device (pdev); +if (!wrap)return -ENOMEM ; - } } res = wrap->dev_res;
@@ -163,7 +161,6 @@ static int cdns3_pci_probe(struct pci_de/* register platform device */ wrap->plat_dev =platform_device_register_full (&plat_info);if (IS_ERR (wrap->plat_dev)) { -pci_disable_device (pdev); err =PTR_ERR (wrap->plat_dev);kfree (wrap);return err;
Greg Kroah-Hartman
maintainerPATCH 279/300 usb: gadget: f_eem: Fix memory leak in eem_unwrap
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuen-Han Tsai <[email protected]>
commit e4f5ce990818d37930cd9fb0be29eee0553c59d9 upstream.
The existing code did not handle the failure case of usb_ep_queue in the command path, potentially leading to memory leaks.
Improve error handling to free all allocated resources on usb_ep_queue failure. This patch continues to use goto logic for error handling, as the existing error handling is complex and not easily adaptable to auto-cleanup helpers.
kmemleak results:
unreferenced object 0xffffff895a512300 (size 240):
backtrace:
slab_post_alloc_hook+0xbc/0x3a4
kmem_cache_alloc+0x1b4/0x358
skb_clone+0x90/0xd8
eem_unwrap+0x1cc/0x36c
unreferenced object 0xffffff8a157f4000 (size 256):
backtrace:
slab_post_alloc_hook+0xbc/0x3a4
__kmem_cache_alloc_node+0x1b4/0x2dc
kmalloc_trace+0x48/0x140
dwc3_gadget_ep_alloc_request+0x58/0x11c
usb_ep_alloc_request+0x40/0xe4
eem_unwrap+0x204/0x36c
unreferenced object 0xffffff8aadbaac00 (size 128):
backtrace:
slab_post_alloc_hook+0xbc/0x3a4
__kmem_cache_alloc_node+0x1b4/0x2dc
__kmalloc+0x64/0x1a8
eem_unwrap+0x218/0x36c
unreferenced object 0xffffff89ccef3500 (size 64):
backtrace:
slab_post_alloc_hook+0xbc/0x3a4
__kmem_cache_alloc_node+0x1b4/0x2dc
kmalloc_trace+0x48/0x140
eem_unwrap+0x238/0x36c--- drivers/usb/gadget/function/f_eem.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/usb/gadget/function/f_eem.c +6 -1
@@ -479,8 +479,13 @@ static int eem_unwrap(struct gether *por req->complete = eem_cmd_complete; req->zero =1 ; req->context = ctx; -if (usb_ep_queue (port->in_ep, req,GFP_ATOMIC )) +if (usb_ep_queue (port->in_ep, req,GFP_ATOMIC )) {DBG (cdev,"echo response queue fail\n" ); +kfree (ctx); +kfree (req->buf); +usb_ep_free_request (ep, req); +dev_kfree_skb_any (skb2); + }break ;case 1 :/* echo response */
Greg Kroah-Hartman
maintainerPATCH 280/300 usb: storage: Fix memory leak in USB bulk transport
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Desnes Nunes <[email protected]>
commit 41e99fe2005182139b1058db71f0d241f8f0078c upstream.
A kernel memory leak was identified by the 'ioctl_sg01' test from Linux Test Project (LTP). The following bytes were mainly observed: 0x53425355.
When USB storage devices incorrectly skip the data phase with status data, the code extracts/validates the CSW from the sg buffer, but fails to clear it afterwards. This leaves status protocol data in srb's transfer buffer, such as the US_BULK_CS_SIGN 'USBS' signature observed here. Thus, this can lead to USB protocols leaks to user space through SCSI generic (/dev/sg*) interfaces, such as the one seen here when the LTP test requested 512 KiB.
Fix the leak by zeroing the CSW data in srb's transfer buffer immediately after the validation of devices that skip data phase.
Note: Differently from CVE-2018-1000204, which fixed a big leak by zero- ing pages at allocation time, this leak occurs after allocation, when USB protocol data is written to already-allocated sg pages.
--- drivers/usb/storage/transport.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/usb/storage/transport.c +16 -0
@@ -1199,7 +1199,23 @@ int usb_stor_Bulk_transport(struct scsi_ US_BULK_CS_WRAP_LEN && bcs->Signature == cpu_to_le32(US_BULK_CS_SIGN)) { +unsigned char buf[US_BULK_CS_WRAP_LEN ]; +usb_stor_dbg (us,"Device skipped data phase\n" ); + +/* +* Devices skipping data phase might leave CSW data in srb's +* transfer buffer. Zero it to prevent USB protocol leakage. +*/ + sg =NULL ; + offset =0 ; +memset (buf,0 ,sizeof (buf)); +if (usb_stor_access_xfer_buf (buf, +US_BULK_CS_WRAP_LEN , srb, &sg, + &offset,TO_XFER_BUF ) != +US_BULK_CS_WRAP_LEN ) +usb_stor_dbg (us,"Failed to clear CSW data\n" ); +scsi_set_resid (srb, transfer_length); goto skipped_data_phase; }
Greg Kroah-Hartman
maintainerPATCH 281/300 USB: storage: Remove subclass and protocol overrides from Novatek quirk
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit df5fde297e617041449f603ed5f646861c80000b upstream.
A report from Oleg Smirnov indicates that the unusual_devs quirks entry for the Novatek camera does not need to override the subclass and protocol parameters:
[3266355.209532] usb 1-3: new high-speed USB device number 10 using xhci_hcd
[3266355.333031] usb 1-3: New USB device found, idVendor=0603, idProduct=8611, bcdDevice= 1.00
[3266355.333040] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[3266355.333043] usb 1-3: Product: YICARCAM
[3266355.333045] usb 1-3: Manufacturer: XIAO-YI
[3266355.333047] usb 1-3: SerialNumber: 966110000000100
[3266355.338621] usb-storage 1-3:1.0: USB Mass Storage device detected
[3266355.338817] usb-storage 1-3:1.0: Quirks match for vid 0603 pid 8611: 4000
[3266355.338821] usb-storage 1-3:1.0: This device (0603,8611,0100 S 06 P 50) has unneeded SubClass and Protocol entries in unusual_devs.h (kernel 6.16.10-arch1-1)
Please send a copy of this message to<[email protected]> and <[email protected]>
The overrides are harmless but they do provoke the driver into logging this annoying message. Update the entry to remove the unneeded entries.
--- drivers/usb/storage/unusual_devs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/storage/unusual_devs.h +1 -1
@@ -938,7 +938,7 @@ UNUSUAL_DEV( 0x05e3, 0x0723, 0x9451, 0x9451,UNUSUAL_DEV (0x0603 ,0x8611 ,0x0000 ,0xffff ,"Novatek" ,"NTK96550-based camera" , -USB_SC_SCSI ,USB_PR_BULK ,NULL , +USB_SC_DEVICE ,USB_PR_DEVICE ,NULL , US_FL_BULK_IGNORE_TAG ),/*
Signature · 1 line
2.52.0
Greg Kroah-Hartman
maintainerPATCH 282/300 usb: storage: sddr55: Reject out-of-bound new_pba
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tianchu Chen <[email protected]>
commit b59d4fda7e7d0aff1043a7f742487cb829f5aac1 upstream.
Discovered by Atuin - Automated Vulnerability Discovery Engine.
new_pba comes from the status packet returned after each write. A bogus device could report values beyond the block count derived from info->capacity, letting the driver walk off the end of pba_to_lba[] and corrupt heap memory.
Reject PBAs that exceed the computed block count and fail the transfer so we avoid touching out-of-range mapping entries.
--- drivers/usb/storage/sddr55.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/usb/storage/sddr55.c +6 -0
@@ -469,6 +469,12 @@ static int sddr55_write_data(struct us_d new_pba = (status[3 ] + (status[4 ] <<8 ) + (status[5 ] <<16 )) >> info->blockshift; +/* check if device-reported new_pba is out of range */ +if (new_pba >= (info->capacity >> (info->blockshift + info->pageshift))) { + result =USB_STOR_TRANSPORT_FAILED ; + goto leave; + } +/* check status for error */ if (status[0 ] ==0xff && status[1 ] ==0x4 ) { info->pba_to_lba[new_pba] =BAD_BLOCK ;
Greg Kroah-Hartman
maintainerPATCH 283/300 usb: dwc3: Fix race condition between concurrent dwc3_remove_requests() call paths
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Manish Nagar <[email protected]>
commit e4037689a366743c4233966f0e74bc455820d316 upstream.
This patch addresses a race condition caused by unsynchronized execution of multiple call paths invoking dwc3_remove_requests(), leading to premature freeing of USB requests and subsequent crashes.
Three distinct execution paths interact with dwc3_remove_requests():
Path 1:
Triggered via dwc3_gadget_reset_interrupt() during USB reset handling. The call stack includes:
- dwc3_ep0_reset_state()
- dwc3_ep0_stall_and_restart()
- dwc3_ep0_out_start()
- dwc3_remove_requests()
- dwc3_gadget_del_and_unmap_request()
Path 2:
Also initiated from dwc3_gadget_reset_interrupt(), but through dwc3_stop_active_transfers(). The call stack includes:
- dwc3_stop_active_transfers()
- dwc3_remove_requests()
- dwc3_gadget_del_and_unmap_request()
Path 3:
Occurs independently during adb root execution, which triggers USB function unbind and bind operations. The sequence includes:
- gserial_disconnect()
- usb_ep_disable()
- dwc3_gadget_ep_disable()
- dwc3_remove_requests() with -ESHUTDOWN status
Path 3 operates asynchronously and lacks synchronization with Paths 1 and 2. When Path 3 completes, it disables endpoints and frees 'out' requests. If Paths 1 or 2 are still processing these requests, accessing freed memory leads to a crash due to use-after-free conditions.
To fix this added check for request completion and skip processing if already completed and added the request status for ep0 while queue.
--- drivers/usb/dwc3/ep0.c | 1 + drivers/usb/dwc3/gadget.c | 7 +++++++ 2 files changed, 8 insertions(+)
drivers/usb/dwc3/ep0.c +1 -0
@@ -92,6 +92,7 @@ static int __dwc3_gadget_ep0_queue(struc req->request.actual =0 ; req->request.status = -EINPROGRESS ; req->epnum = dep->number; + req->status =DWC3_REQUEST_STATUS_QUEUED ;list_add_tail (&req->list, &dep->pending_list);
drivers/usb/dwc3/gadget.c +7 -0
@@ -211,6 +211,13 @@ void dwc3_gadget_giveback(struct dwc3_ep {struct dwc3 *dwc = dep->dwc; +/* +* The request might have been processed and completed while the +* spinlock was released. Skip processing if already completed. +*/ +if (req->status ==DWC3_REQUEST_STATUS_COMPLETED ) +return ; +dwc3_gadget_del_and_unmap_request (dep, req, status); req->status =DWC3_REQUEST_STATUS_COMPLETED ;
Greg Kroah-Hartman
maintainerPATCH 284/300 xhci: dbgtty: Fix data corruption when transmitting data form DbC to host
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Nyman <[email protected]>
commit f6bb3b67be9af0cfb90075c60850b6af5338a508 upstream.
Data read from a DbC device may be corrupted due to a race between ongoing write and write request completion handler both queuing new transfer blocks (TRBs) if there are remining data in the kfifo.
TRBs may be in incorrct order compared to the data in the kfifo.
Driver fails to keep lock between reading data from kfifo into a dbc request buffer, and queuing the request to the transfer ring.
This allows completed request to re-queue itself in the middle of an ongoing transfer loop, forcing itself between a kfifo read and request TRB write of another request
cpu0 cpu1 (re-queue completed req2)
lock(port_lock)dbc_start_tx()kfifo_out(fifo, req1->buffer)unlock(port_lock)
lock(port_lock)
dbc_write_complete(req2)
dbc_start_tx()
kfifo_out(fifo, req2->buffer)
unlock(port_lock)
lock(port_lock)
req2->trb = ring->enqueue;
ring->enqueue++
unlock(port_lock)lock(port_lock)req1->trb = ring->enqueue;
ring->enqueue++unlock(port_lock)
In the above scenario a kfifo containing "12345678" would read "1234" to req1 and "5678" to req2, but req2 is queued before req1 leading to data being transmitted as "56781234"
Solve this by adding a flag that prevents starting a new tx if we are already mid dbc_start_tx() during the unlocked part.
The already running dbc_do_start_tx() will make sure the newly completed request gets re-queued as it is added to the request write_pool while holding the lock.
--- drivers/usb/host/xhci-dbgcap.h | 1 + drivers/usb/host/xhci-dbgtty.c | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-)
drivers/usb/host/xhci-dbgcap.h +1 -0
@@ -110,6 +110,7 @@ struct dbc_port {struct kfifo write_fifo;bool registered; +bool tx_running; };struct dbc_driver {
drivers/usb/host/xhci-dbgtty.c +16 -1
@@ -37,7 +37,7 @@ dbc_send_packet(struct dbc_port *port, creturn size; } -static int dbc_start_tx (struct dbc_port *port) +static int dbc_do_start_tx (struct dbc_port *port) __releases(&port->port_lock) __acquires(&port->port_lock) {
@@ -47,6 +47,8 @@ static int dbc_start_tx(struct dbc_portbool do_tty_wake = false;struct list_head *pool = &port->write_pool; + port->tx_running = true; +while (!list_empty (pool)) { req = list_entry(pool->next, struct dbc_request, list_pool); len =dbc_send_packet (port, req->buf,DBC_MAX_PACKET );
@@ -67,12 +69,25 @@ static int dbc_start_tx(struct dbc_port } } + port->tx_running = false; +if (do_tty_wake && port->port.tty)tty_wakeup (port->port.tty);return status; } +/* must be called with port->port_lock held */ +static int dbc_start_tx (struct dbc_port *port) +{ +lockdep_assert_held (&port->port_lock); + +if (port->tx_running) +return -EBUSY ; + +return dbc_do_start_tx (port); +} + static void dbc_start_rx(struct dbc_port *port) __releases(&port->port_lock) __acquires(&port->port_lock)
Greg Kroah-Hartman
maintainerPATCH 285/300 USB: serial: ftdi_sio: add support for u-blox EVK-M101
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleksandr Suvorov <[email protected]>
commit 2d8ab771d5316de64f3bb920b82575c58eb00b1b upstream.
The U-Blox EVK-M101 enumerates as 1546:0506 [1] with four FTDI interfaces:
- EVK-M101 current sensors
- EVK-M101 I2C
- EVK-M101 UART
- EVK-M101 port D
Only the third USB interface is a UART. This change lets ftdi_sio probe the VID/PID and registers only interface #3 as a TTY, leaving the rest available for other drivers.
[1]
usb 5-1.3: new high-speed USB device number 11 using xhci_hcd
usb 5-1.3: New USB device found, idVendor=1546, idProduct=0506, bcdDevice= 8.00 usb 5-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0 usb 5-1.3: Product: EVK-M101
usb 5-1.3: Manufacturer: u-blox AG
Datasheet: https://content.u-blox.com/sites/default/files/documents/EVK-M10_UserGuide_UBX-21003949.pdf
--- drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio_ids.h | 1 + 2 files changed, 2 insertions(+)
drivers/usb/serial/ftdi_sio.c +1 -0
@@ -1052,6 +1052,7 @@ static const struct usb_device_id id_tab/* U-Blox devices */ { USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ZED_PID) }, { USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ODIN_PID) }, + { USB_DEVICE_INTERFACE_NUMBER(UBLOX_VID, UBLOX_EVK_M101_PID, 2) },/* FreeCalypso USB adapters */ { USB_DEVICE(FTDI_VID, FTDI_FALCONIA_JTAG_BUF_PID), .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
drivers/usb/serial/ftdi_sio_ids.h +1 -0
@@ -1607,6 +1607,7 @@#define UBLOX_VID 0x1546#define UBLOX_C099F9P_ZED_PID 0x0502#define UBLOX_C099F9P_ODIN_PID 0x0503 +#define UBLOX_EVK_M101_PID 0x0506/* * GMC devices
Greg Kroah-Hartman
maintainerPATCH 286/300 USB: serial: option: add support for Rolling RW101R-GL
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vanillan Wang <[email protected]>
commit 523bf0a59e674b52e4b5607a2aba655fbfa20ff2 upstream.
- VID:PID 33f8:0301, RW101R-GL for laptop debug M.2 cards (with MBIM interface for Linux/Chrome OS)
0x0301: mbim, pipe
T: Bus=04 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#= 2 Spd=5000 MxCh= 0 D: Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs= 1 P: Vendor=33f8 ProdID=0301 Rev=05.04 S: Manufacturer=Rolling Wireless S.a.r.l. S: Product=Rolling RW101R-GL Module S: SerialNumber=3ec4efdf C: #Ifs= 3 Cfg#= 1 Atr=a0 MxPwr=896mA I: If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim E: Ad=81(I) Atr=03(Int.) MxPS= 64 Ivl=32ms I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim E: Ad=0f(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=8e(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=40 Driver=option E: Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=83(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
- VID:PID 33f8:01a8, RW101R-GL for laptop debug M.2 cards (with MBIM interface for Linux/Chrome OS)
0x01a8: mbim, diag, AT, ADB, pipe1, pipe2
T: Bus=04 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#= 2 Spd=5000 MxCh= 0 D: Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs= 1 P: Vendor=33f8 ProdID=01a8 Rev=05.04 S: Manufacturer=Rolling Wireless S.a.r.l. S: Product=Rolling RW101R-GL Module S: SerialNumber=3ec4efdf C: #Ifs= 7 Cfg#= 1 Atr=a0 MxPwr=896mA I: If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim E: Ad=81(I) Atr=03(Int.) MxPS= 64 Ivl=32ms I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim E: Ad=0f(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=8e(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option E: Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=83(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=84(I) Atr=03(Int.) MxPS= 10 Ivl=32ms I: If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none) E: Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=85(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms I: If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=40 Driver=option E: Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=86(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=87(I) Atr=03(Int.) MxPS= 10 Ivl=32ms I: If#= 6 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=40 Driver=option E: Ad=05(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=88(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=89(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
- VID:PID 33f8:0302, RW101R-GL for laptop debug M.2 cards (with MBIM interface for Linux/Chrome OS)
0x0302: mbim, pipe
T: Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 6 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=33f8 ProdID=0302 Rev=05.04 S: Manufacturer=Rolling Wireless S.a.r.l. S: Product=Rolling RW101R-GL Module S: SerialNumber=3ec4efdf C: #Ifs= 3 Cfg#= 1 Atr=a0 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim E: Ad=81(I) Atr=03(Int.) MxPS= 64 Ivl=32ms I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim E: Ad=0f(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=8e(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=40 Driver=option E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=83(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
- VID:PID 33f8:01a9, RW101R-GL for laptop debug M.2 cards (with MBIM interface for Linux/Chrome OS)
0x01a9: mbim, diag, AT, ADB, pipe1, pipe2
T: Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=33f8 ProdID=01a9 Rev=05.04 S: Manufacturer=Rolling Wireless S.a.r.l. S: Product=Rolling RW101R-GL Module S: SerialNumber=3ec4efdf C: #Ifs= 7 Cfg#= 1 Atr=a0 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim E: Ad=81(I) Atr=03(Int.) MxPS= 64 Ivl=32ms I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim E: Ad=0f(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=8e(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=84(I) Atr=03(Int.) MxPS= 10 Ivl=32ms I: If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none) E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=40 Driver=option E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=87(I) Atr=03(Int.) MxPS= 10 Ivl=32ms I: If#= 6 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=40 Driver=option E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=89(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
--- drivers/usb/serial/option.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/usb/serial/option.c +8 -2
@@ -2424,12 +2424,18 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1406, 0xff) }, /* GosunCn GM500 ECM/NCM */ { USB_DEVICE(0x33f8, 0x0104), /* Rolling RW101-GL (laptop RMNET) */ .driver_info = RSVD(4) | RSVD(5) }, + { USB_DEVICE_INTERFACE_CLASS(0x33f8, 0x0115, 0xff), /* Rolling RW135-GL (laptop MBIM) */ + .driver_info = RSVD(5) }, { USB_DEVICE_INTERFACE_CLASS(0x33f8, 0x01a2, 0xff) }, /* Rolling RW101-GL (laptop MBIM) */ { USB_DEVICE_INTERFACE_CLASS(0x33f8, 0x01a3, 0xff) }, /* Rolling RW101-GL (laptop MBIM) */ { USB_DEVICE_INTERFACE_CLASS(0x33f8, 0x01a4, 0xff), /* Rolling RW101-GL (laptop MBIM) */ .driver_info = RSVD(4) }, - { USB_DEVICE_INTERFACE_CLASS(0x33f8, 0x0115, 0xff), /* Rolling RW135-GL (laptop MBIM) */ - .driver_info = RSVD(5) }, + { USB_DEVICE_INTERFACE_CLASS(0x33f8, 0x01a8, 0xff), /* Rolling RW101R-GL (laptop MBIM) */ + .driver_info = RSVD(4) }, + { USB_DEVICE_INTERFACE_CLASS(0x33f8, 0x01a9, 0xff), /* Rolling RW101R-GL (laptop MBIM) */ + .driver_info = RSVD(4) }, + { USB_DEVICE_INTERFACE_CLASS(0x33f8, 0x0301, 0xff) }, /* Rolling RW101R-GL (laptop MBIM) */ + { USB_DEVICE_INTERFACE_CLASS(0x33f8, 0x0302, 0xff) }, /* Rolling RW101R-GL (laptop MBIM) */ { USB_DEVICE_INTERFACE_CLASS(0x33f8, 0x0802, 0xff), /* Rolling RW350-GL (laptop MBIM) */ .driver_info = RSVD(5) }, { USB_DEVICE_AND_INTERFACE_INFO(0x3731, 0x0100, 0xff, 0xff, 0x30) }, /* NetPrisma LCUK54-WWD for Global */
Signature · 1 line
2.52.0
Greg Kroah-Hartman
maintainerPATCH 287/300 drm: sti: fix device leaks at component probe
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 620a8f131154250f6a64a07d049a4f235d6451a5 upstream.
Make sure to drop the references taken to the vtg devices by of_find_device_by_node() when looking up their driver data during component probe.
Note that holding a reference to a platform device does not prevent its driver data from going away so there is no point in keeping the reference after the lookup helper returns.
--- drivers/gpu/drm/sti/sti_vtg.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/sti/sti_vtg.c +6 -1
@@ -143,12 +143,17 @@ struct sti_vtg {struct sti_vtg *of_vtg_find (struct device_node *np) {struct platform_device *pdev; +struct sti_vtg *vtg; pdev =of_find_device_by_node (np);if (!pdev)return NULL ; -return (struct sti_vtg *)platform_get_drvdata (pdev); + vtg =platform_get_drvdata (pdev); + +put_device (&pdev->dev); + +return vtg; }static void vtg_reset (struct sti_vtg *vtg)
Signature · 1 line
2.52.0
Greg Kroah-Hartman
maintainerPATCH 288/300 drm/amd/display: Check NULL before accessing
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Hung <[email protected]>
commit 3ce62c189693e8ed7b3abe551802bbc67f3ace54 upstream.
[WHAT]
IGT kms_cursor_legacy's long-nonblocking-modeset-vs-cursor-atomic fails with NULL pointer dereference. This can be reproduced with both an eDP panel and a DP monitors connected.
BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: Oops: 0000 [#1] SMP NOPTI CPU: 13 UID: 0 PID: 2960 Comm: kms_cursor_lega Not tainted 6.16.0-99-custom #8 PREEMPT(voluntary) Hardware name: AMD ........ RIP: 0010:dc_stream_get_scanoutpos+0x34/0x130 [amdgpu] Code: 57 4d 89 c7 41 56 49 89 ce 41 55 49 89 d5 41 54 49 89 fc 53 48 83 ec 18 48 8b 87 a0 64 00 00 48 89 75 d0 48 c7 c6 e0 41 30 c2 <48> 8b 38 48 8b 9f 68 06 00 00 e8 8d d7 fd ff 31 c0 48 81 c3 e0 02 RSP: 0018:ffffd0f3c2bd7608 EFLAGS: 00010292 RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffd0f3c2bd7668 RDX: ffffd0f3c2bd7664 RSI: ffffffffc23041e0 RDI: ffff8b32494b8000 RBP: ffffd0f3c2bd7648 R08: ffffd0f3c2bd766c R09: ffffd0f3c2bd7760 R10: ffffd0f3c2bd7820 R11: 0000000000000000 R12: ffff8b32494b8000 R13: ffffd0f3c2bd7664 R14: ffffd0f3c2bd7668 R15: ffffd0f3c2bd766c FS: 000071f631b68700(0000) GS:ffff8b399f114000(0000)
knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 00000001b8105000 CR4: 0000000000f50ef0
PKRU: 55555554
Call Trace: <TASK> dm_crtc_get_scanoutpos+0xd7/0x180 [amdgpu] amdgpu_display_get_crtc_scanoutpos+0x86/0x1c0 [amdgpu] ? __pfx_amdgpu_crtc_get_scanout_position+0x10/0x10[amdgpu] amdgpu_crtc_get_scanout_position+0x27/0x50 [amdgpu] drm_crtc_vblank_helper_get_vblank_timestamp_internal+0xf7/0x400 drm_crtc_vblank_helper_get_vblank_timestamp+0x1c/0x30 drm_crtc_get_last_vbltimestamp+0x55/0x90 drm_crtc_next_vblank_start+0x45/0xa0 drm_atomic_helper_wait_for_fences+0x81/0x1f0 ...
--- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +8 -3
@@ -586,9 +586,14 @@ bool dc_stream_get_scanoutpos(const stru {uint8_t i;bool ret = false; -struct dc *dc = stream->ctx->dc; -struct resource_context *res_ctx = - &dc->current_state->res_ctx; +struct dc *dc; +struct resource_context *res_ctx; + +if (!stream->ctx) +return false; + + dc = stream->ctx->dc; + res_ctx = &dc->current_state->res_ctx;for (i =0 ; i <MAX_PIPES ; i++) {struct timing_generator *tg = res_ctx->pipe_ctx[i].stream_res.tg;
Greg Kroah-Hartman
maintainerPATCH 289/300 libceph: fix potential use-after-free in have_mon_and_osd_map()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilya Dryomov <[email protected]>
commit 076381c261374c587700b3accf410bdd2dba334e upstream.
The wait loop in __ceph_open_session() can race with the client receiving a new monmap or osdmap shortly after the initial map is received. Both ceph_monc_handle_map() and handle_one_map() install a new map immediately after freeing the old one
kfree(monc->monmap);
monc->monmap = monmap;
ceph_osdmap_destroy(osdc->osdmap);
osdc->osdmap = newmap;under client->monc.mutex and client->osdc.lock respectively, but because neither is taken in have_mon_and_osd_map() it's possible for client->monc.monmap->epoch and client->osdc.osdmap->epoch arms in
client->monc.monmap && client->monc.monmap->epoch &&
client->osdc.osdmap && client->osdc.osdmap->epoch;condition to dereference an already freed map. This happens to be reproducible with generic/395 and generic/397 with KASAN enabled:
BUG: KASAN: slab-use-after-free in have_mon_and_osd_map+0x56/0x70
Read of size 4 at addr ffff88811012d810 by task mount.ceph/13305
CPU: 2 UID: 0 PID: 13305 Comm: mount.ceph Not tainted 6.14.0-rc2-build2+ #1266
...
Call Trace:
<TASK>
have_mon_and_osd_map+0x56/0x70
ceph_open_session+0x182/0x290
ceph_get_tree+0x333/0x680
vfs_get_tree+0x49/0x180
do_new_mount+0x1a3/0x2d0
path_mount+0x6dd/0x730
do_mount+0x99/0xe0
__do_sys_mount+0x141/0x180
do_syscall_64+0x9f/0x100
entry_SYSCALL_64_after_hwframe+0x76/0x7e
</TASK>
Allocated by task 13305:
ceph_osdmap_alloc+0x16/0x130
ceph_osdc_init+0x27a/0x4c0
ceph_create_client+0x153/0x190
create_fs_client+0x50/0x2a0
ceph_get_tree+0xff/0x680
vfs_get_tree+0x49/0x180
do_new_mount+0x1a3/0x2d0
path_mount+0x6dd/0x730
do_mount+0x99/0xe0
__do_sys_mount+0x141/0x180
do_syscall_64+0x9f/0x100
entry_SYSCALL_64_after_hwframe+0x76/0x7e
Freed by task 9475:
kfree+0x212/0x290
handle_one_map+0x23c/0x3b0
ceph_osdc_handle_map+0x3c9/0x590
mon_dispatch+0x655/0x6f0
ceph_con_process_message+0xc3/0xe0
ceph_con_v1_try_read+0x614/0x760
ceph_con_workfn+0x2de/0x650
process_one_work+0x486/0x7c0
process_scheduled_works+0x73/0x90
worker_thread+0x1c8/0x2a0
kthread+0x2ec/0x300
ret_from_fork+0x24/0x40
ret_from_fork_asm+0x1a/0x30Rewrite the wait loop to check the above condition directly with client->monc.mutex and client->osdc.lock taken as appropriate. While at it, improve the timeout handling (previously mount_timeout could be exceeded in case wait_event_interruptible_timeout() slept more than once) and access client->auth_err under client->monc.mutex to match how it's set in finish_auth().
monmap_show() and osdmap_show() now take the respective lock before accessing the map as well.
--- net/ceph/ceph_common.c | 53 +++++++++++++++++++++++++++++-------------------- net/ceph/debugfs.c | 14 +++++++++--- 2 files changed, 42 insertions(+), 25 deletions(-)
net/ceph/ceph_common.c +32 -21
@@ -750,41 +750,52 @@ void ceph_reset_client_addr(struct ceph_EXPORT_SYMBOL (ceph_reset_client_addr);/* -* true if we have the mon map (and have thus joined the cluster) -*/ -static bool have_mon_and_osd_map (struct ceph_client *client) -{ -return client->monc.monmap && client->monc.monmap->epoch && - client->osdc.osdmap && client->osdc.osdmap->epoch; -} - -/* * mount: join the ceph cluster, and open root directory. */ int __ceph_open_session (struct ceph_client *client,unsigned long started) { -unsigned long timeout = client->options->mount_timeout; -long err; +DEFINE_WAIT_FUNC (wait, woken_wake_function); +long timeout =ceph_timeout_jiffies (client->options->mount_timeout); +bool have_monmap, have_osdmap; +int err;/* open session, and wait for mon and osd maps */ err =ceph_monc_open_session (&client->monc);if (err <0 )return err; -while (!have_mon_and_osd_map (client)) { -if (timeout &&time_after_eq (jiffies, started + timeout)) -return -ETIMEDOUT ; +add_wait_queue (&client->auth_wq, &wait); +for (;;) { +mutex_lock (&client->monc.mutex); + err = client->auth_err; + have_monmap = client->monc.monmap && client->monc.monmap->epoch; +mutex_unlock (&client->monc.mutex); + +down_read (&client->osdc.lock); + have_osdmap = client->osdc.osdmap && client->osdc.osdmap->epoch; +up_read (&client->osdc.lock); + +if (err || (have_monmap && have_osdmap)) +break ; + +if (signal_pending (current)) { + err = -ERESTARTSYS ; +break ; + } + +if (!timeout) { + err = -ETIMEDOUT ; +break ; + }/* wait */ dout ("mount waiting for mon_map\n" ); - err =wait_event_interruptible_timeout (client->auth_wq, -have_mon_and_osd_map (client) || (client->auth_err <0 ), -ceph_timeout_jiffies (timeout)); -if (err <0 ) -return err; -if (client->auth_err <0 ) -return client->auth_err; + timeout =wait_woken (&wait,TASK_INTERRUPTIBLE , timeout); } +remove_wait_queue (&client->auth_wq, &wait); + +if (err) +return err;pr_info ("client%llu fsid %pU\n" ,ceph_client_gid (client), &client->fsid);
net/ceph/debugfs.c +10 -4
@@ -36,8 +36,9 @@ static int monmap_show(struct seq_file *int i;struct ceph_client *client = s->private; +mutex_lock (&client->monc.mutex);if (client->monc.monmap ==NULL ) -return 0 ; + goto out_unlock;seq_printf (s,"epoch %d\n" , client->monc.monmap->epoch);for (i =0 ; i < client->monc.monmap->num_mon; i++) {
@@ -48,6 +49,9 @@ static int monmap_show(struct seq_file *ENTITY_NAME (inst->name), ceph_pr_addr(&inst->addr)); } + +out_unlock: +mutex_unlock (&client->monc.mutex);return 0 ; }
@@ -56,13 +60,14 @@ static int osdmap_show(struct seq_file *int i;struct ceph_client *client = s->private;struct ceph_osd_client *osdc = &client->osdc; -struct ceph_osdmap *map = osdc->osdmap; +struct ceph_osdmap *map;struct rb_node *n; +down_read (&osdc->lock); + map = osdc->osdmap;if (map ==NULL ) -return 0 ; + goto out_unlock; -down_read (&osdc->lock);seq_printf (s,"epoch %u barrier %u flags 0x%x\n" , map->epoch, osdc->epoch_barrier, map->flags);
@@ -131,6 +136,7 @@ static int osdmap_show(struct seq_file *seq_printf (s,"]\n" ); } +out_unlock:up_read (&osdc->lock);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 290/300 fs: writeback: fix use-after-free in __mark_inode_dirty()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiufei Xue <[email protected]>
[ Upstream commit d02d2c98d25793902f65803ab853b592c7a96b29 ]
An use-after-free issue occurred when __mark_inode_dirty() get the bdi_writeback that was in the progress of switching.
CPU: 1 PID: 562 Comm: systemd-random- Not tainted 6.6.56-gb4403bd46a8e #1 ...... pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : __mark_inode_dirty+0x124/0x418 lr : __mark_inode_dirty+0x118/0x418 sp : ffffffc08c9dbbc0 ........ Call trace: __mark_inode_dirty+0x124/0x418 generic_update_time+0x4c/0x60 file_modified+0xcc/0xd0 ext4_buffered_write_iter+0x58/0x124 ext4_file_write_iter+0x54/0x704 vfs_write+0x1c0/0x308 ksys_write+0x74/0x10c __arm64_sys_write+0x1c/0x28 invoke_syscall+0x48/0x114 el0_svc_common.constprop.0+0xc0/0xe0 do_el0_svc+0x1c/0x28 el0_svc+0x40/0xe4 el0t_64_sync_handler+0x120/0x12c el0t_64_sync+0x194/0x198
Root cause is:
systemd-random-seed kworker
----------------------------------------------------------------------___mark_inode_dirty inode_switch_wbs_work_fn
spin_lock(&inode->i_lock);
inode_attach_wb
locked_inode_to_wb_and_lock_list
get inode->i_wb
spin_unlock(&inode->i_lock);
spin_lock(&wb->list_lock)
spin_lock(&inode->i_lock)
inode_io_list_move_locked
spin_unlock(&wb->list_lock)
spin_unlock(&inode->i_lock)
spin_lock(&old_wb->list_lock)
inode_do_switch_wbs
spin_lock(&inode->i_lock)
inode->i_wb = new_wb
spin_unlock(&inode->i_lock)
spin_unlock(&old_wb->list_lock)
wb_put_many(old_wb, nr_switched)
cgwb_release
old wb released
wb_wakeup_delayed() accesses wb,
then trigger the use-after-free
issueFix this race condition by holding inode spinlock until wb_wakeup_delayed() finished.
---
Backport fix for CVE-2025-39866
fs/fs-writeback.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
fs/fs-writeback.c +4 -3
@@ -2326,9 +2326,6 @@ void __mark_inode_dirty(struct inode *in wakeup_bdi =inode_io_list_move_locked (inode, wb, dirty_list); -spin_unlock (&wb->list_lock); -trace_writeback_dirty_inode_enqueue (inode); -/* * If this is the first dirty inode for this bdi, * we have to wake-up the corresponding bdi thread
@@ -2338,6 +2335,10 @@ void __mark_inode_dirty(struct inode *inif (wakeup_bdi && (wb->bdi->capabilities &BDI_CAP_WRITEBACK ))wb_wakeup_delayed (wb); + +spin_unlock (&wb->list_lock); +trace_writeback_dirty_inode_enqueue (inode); +return ; } }
Greg Kroah-Hartman
maintainerPATCH 291/300 Bluetooth: Add more enc key size check
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Lu <[email protected]>
[ Upstream commit 04a342cc49a8522e99c9b3346371c329d841dcd2 ]
When we are slave role and receives l2cap conn req when encryption has started, we should check the enc key size to avoid KNOB attack or BLUFFS attack.
Quoted 1 line
From SIG recommendation, implementations are advised to reject
service-level connections on an encrypted baseband link with key strengths below 7 octets.
A simple and clear way to achieve this is to place the enc key size check in hci_cc_read_enc_key_size()
The btmon log below shows the case that lacks enc key size check.
Quoted 1 line
HCI Event: Connect Request (
0x04) plen 10
Address: BB:22:33:44:55:99 (OUI BB-22-33)
Class: 0x480104
Major class: Computer (desktop, notebook, PDA, organizers) Minor class: Desktop workstation
Capturing (Scanner, Microphone)
Telephony (Cordless telephony, Modem, Headset)
Link type: ACL (0x01)
< HCI Command: Accept Connection Request (0x01|0x0009) plen 7
Address: BB:22:33:44:55:99 (OUI BB-22-33)
Role: Peripheral (0x01)Quoted 1 line
HCI Event: Command Status (
0x0f) plen 4
Accept Connection Request (0x01|0x0009) ncmd 2
Status: Success (0x00)Quoted 1 line
HCI Event: Connect Complete (
0x03) plen 11
Status: Success (0x00)
Handle: 1
Address: BB:22:33:44:55:99 (OUI BB-22-33)
Link type: ACL (0x01)
Encryption: Disabled (0x00)...
Quoted 1 line
HCI Event: Encryption Change (
0x08) plen 4
Status: Success (0x00)
Handle: 1 Address: BB:22:33:44:55:99 (OUI BB-22-33)
Encryption: Enabled with E0 (0x01)
< HCI Command: Read Encryption Key Size (0x05|0x0008) plen 2
Handle: 1 Address: BB:22:33:44:55:99 (OUI BB-22-33)Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 7
Read Encryption Key Size (0x05|0x0008) ncmd 2
Status: Success (0x00)
Handle: 1 Address: BB:22:33:44:55:99 (OUI BB-22-33)
Key size: 6// We should check the enc key size
...
Quoted 1 line
ACL Data RX: Handle 1 flags
0x02dlen 12
L2CAP: Connection Request (0x02) ident 3 len 4
PSM: 25 (0x0019)
Source CID: 64
< ACL Data TX: Handle 1 flags 0x00 dlen 16
L2CAP: Connection Response (0x03) ident 3 len 8
Destination CID: 64
Source CID: 64
Result: Connection pending (0x0001)
Status: Authorization pending (0x0002)Quoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5
Num handles: 1
Handle: 1 Address: BB:22:33:44:55:99 (OUI BB-22-33)
Count: 1
#35: len 16 (25 Kb/s)
Latency: 5 msec (2-7 msec ~4 msec)
< ACL Data TX: Handle 1 flags 0x00 dlen 16
L2CAP: Connection Response (0x03) ident 3 len 8
Destination CID: 64
Source CID: 64
Result: Connection successful (0x0000)
Status: No further information available (0x0000)[ Nazar Kalashnikov: change status torp_status due to function parameter conflict ]
---
Backport fix for CVE-2023-24023
net/bluetooth/hci_event.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-)
net/bluetooth/hci_event.c +19 -2
@@ -3043,6 +3043,7 @@ static void read_enc_key_size_complete(sconst struct hci_rp_read_enc_key_size *rp;struct hci_conn *conn;u16 handle; +u8 rp_status;BT_DBG ("%s status 0x%02x" , hdev->name, status);
@@ -3052,6 +3053,7 @@ static void read_enc_key_size_complete(s } rp = (void *)skb->data; + rp_status = rp->status; handle =le16_to_cpu (rp->handle);hci_dev_lock (hdev);
@@ -3064,15 +3066,30 @@ static void read_enc_key_size_complete(s* secure approach is to then assume the key size is 0 to force a * disconnection. */ -if (rp->status) { +if (rp_status) {bt_dev_err (hdev,"failed to read key size for handle %u" , handle); conn->enc_key_size =0 ; }else { conn->enc_key_size = rp->key_size; + rp_status =0 ; + +if (conn->enc_key_size < hdev->min_enc_key_size) { +/* As slave role, the conn->state has been set to +* BT_CONNECTED and l2cap conn req might not be received +* yet, at this moment the l2cap layer almost does +* nothing with the non-zero status. +* So we also clear encrypt related bits, and then the +* handler of l2cap conn req will get the right secure +* state at a later time. +*/ + rp_status =HCI_ERROR_AUTH_FAILURE ; +clear_bit (HCI_CONN_ENCRYPT , &conn->flags); +clear_bit (HCI_CONN_AES_CCM , &conn->flags); + } } -hci_encrypt_cfm (conn,0 ); +hci_encrypt_cfm (conn, rp_status); unlock:hci_dev_unlock (hdev);
Greg Kroah-Hartman
maintainerPATCH 292/300 netfilter: nf_set_pipapo: fix initial map fill
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <[email protected]>
[ Upstream commit 791a615b7ad2258c560f91852be54b0480837c93 ]
The initial buffer has to be inited to all-ones, but it must restrict it to the size of the first field, not the total field size.
After each round in the map search step, the result and the fill map are swapped, so if we have a set where f->bsize of the first element is smaller than m->bsize_max, those one-bits are leaked into future rounds result map.
This makes pipapo find an incorrect matching results for sets where first field size is not the largest.
Followup patch adds a test case to nft_concat_range.sh selftest script.
Thanks to Stefano Brivio for pointing out that we need to zero out the remainder explicitly, only correcting memset() argument isn't enough.
---
Backport fix for CVE-2024-57947
net/netfilter/nft_set_pipapo.c | 4 ++-- net/netfilter/nft_set_pipapo.h | 21 +++++++++++++++++++++ net/netfilter/nft_set_pipapo_avx2.c | 10 ++++++---- 3 files changed, 29 insertions(+), 6 deletions(-)
net/netfilter/nft_set_pipapo.c +2 -2
@@ -432,7 +432,7 @@ bool nft_pipapo_lookup(const struct net res_map = scratch->map + (map_index ? m->bsize_max :0 ); fill_map = scratch->map + (map_index ?0 : m->bsize_max); -memset (res_map,0xff , m->bsize_max *sizeof (*res_map)); +pipapo_resmap_init (m, res_map);nft_pipapo_for_each_field (f, i, m) {bool last = i == m->field_count -1 ;
@@ -536,7 +536,7 @@ static struct nft_pipapo_elem *pipapo_ge goto out; } -memset (res_map,0xff , m->bsize_max *sizeof (*res_map)); +pipapo_resmap_init (m, res_map);nft_pipapo_for_each_field (f, i, m) {bool last = i == m->field_count -1 ;
net/netfilter/nft_set_pipapo.h +21 -0
@@ -287,4 +287,25 @@ static u64 pipapo_estimate_size(const st return size; } +/** +* pipapo_resmap_init() - Initialise result map before first use +* @m: Matching data, including mapping table +* @res_map: Result map +* +* Initialize all bits covered by the first field to one, so that after +* the first step, only the matching bits of the first bit group remain. +* +* If other fields have a large bitmap, set remainder of res_map to 0. +*/ +static inline void pipapo_resmap_init (const struct nft_pipapo_match *m,unsigned long *res_map) +{ +const struct nft_pipapo_field *f = m->f; +int i; + +for (i =0 ; i < f->bsize; i++) + res_map[i] =ULONG_MAX ; + +for (i = f->bsize; i < m->bsize_max; i++) + res_map[i] =0ul ; +}#endif /* _NFT_SET_PIPAPO_H */
net/netfilter/nft_set_pipapo_avx2.c +6 -4
@@ -1028,6 +1028,7 @@ nothing:/** * nft_pipapo_avx2_lookup_slow() - Fallback function for uncommon field sizes +* @mdata: Matching data, including mapping table * @map: Previous match result, used as initial bitmap * @fill: Destination bitmap to be filled with current match result * @f: Field, containing lookup and mapping tables
@@ -1043,7 +1044,8 @@ nothing:* Return: -1 on no match, rule index of match if @last, otherwise first long * word index to be checked next (i.e. first filled word). */ -static int nft_pipapo_avx2_lookup_slow (unsigned long *map,unsigned long *fill, +static int nft_pipapo_avx2_lookup_slow (const struct nft_pipapo_match *mdata, +unsigned long *map,unsigned long *fill,struct nft_pipapo_field *f,int offset,const u8 *pkt,bool first,bool last) {
@@ -1053,7 +1055,7 @@ static int nft_pipapo_avx2_lookup_slow(u lt += offset *NFT_PIPAPO_LONGS_PER_M256 ;if (first) -memset (map,0xff , bsize *sizeof (*map)); +pipapo_resmap_init (mdata, map);for (i = offset; i < bsize; i++) {if (f->bb ==8 )
@@ -1181,7 +1183,7 @@ next_match: }else if (f->groups ==16 ) {NFT_SET_PIPAPO_AVX2_LOOKUP (8 ,16 ); }else { - ret =nft_pipapo_avx2_lookup_slow (res, fill, f, + ret =nft_pipapo_avx2_lookup_slow (m, res, fill, f, ret, rp, first, last); }
@@ -1197,7 +1199,7 @@ next_match: }else if (f->groups ==32 ) {NFT_SET_PIPAPO_AVX2_LOOKUP (4 ,32 ); }else { - ret =nft_pipapo_avx2_lookup_slow (res, fill, f, + ret =nft_pipapo_avx2_lookup_slow (m, res, fill, f, ret, rp, first, last); }
Greg Kroah-Hartman
maintainerPATCH 293/300 scsi: pm80xx: Set phy->enable_completion only when we
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Igor Pylypiv <[email protected]>
[ Upstream commit e4f949ef1516c0d74745ee54a0f4882c1f6c7aea ]
pm8001_phy_control() populates the enable_completion pointer with a stack address, sends a PHY_LINK_RESET / PHY_HARD_RESET, waits 300 ms, and returns. The problem arises when a phy control response comes late. After 300 ms the pm8001_phy_control() function returns and the passed enable_completion stack address is no longer valid. Late phy control response invokes complete() on a dangling enable_completion pointer which leads to a kernel crash.
---
Backport fix for CVE-2024-47666
drivers/scsi/pm8001/pm8001_sas.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/pm8001/pm8001_sas.c +3 -1
@@ -163,7 +163,6 @@ int pm8001_phy_control(struct asd_sas_phunsigned long flags; pm8001_ha = sas_phy->ha->lldd_ha; phy = &pm8001_ha->phy[phy_id]; - pm8001_ha->phy[phy_id].enable_completion = &completion;switch (func) {case PHY_FUNC_SET_LINK_RATE : rates = funcdata;
@@ -176,6 +175,7 @@ int pm8001_phy_control(struct asd_sas_ph rates->maximum_linkrate; }if (pm8001_ha->phy[phy_id].phy_state ==PHY_LINK_DISABLE ) { + pm8001_ha->phy[phy_id].enable_completion = &completion;PM8001_CHIP_DISP ->phy_start_req (pm8001_ha, phy_id);wait_for_completion (&completion); }
@@ -184,6 +184,7 @@ int pm8001_phy_control(struct asd_sas_phbreak ;case PHY_FUNC_HARD_RESET :if (pm8001_ha->phy[phy_id].phy_state ==PHY_LINK_DISABLE ) { + pm8001_ha->phy[phy_id].enable_completion = &completion;PM8001_CHIP_DISP ->phy_start_req (pm8001_ha, phy_id);wait_for_completion (&completion); }
@@ -192,6 +193,7 @@ int pm8001_phy_control(struct asd_sas_phbreak ;case PHY_FUNC_LINK_RESET :if (pm8001_ha->phy[phy_id].phy_state ==PHY_LINK_DISABLE ) { + pm8001_ha->phy[phy_id].enable_completion = &completion;PM8001_CHIP_DISP ->phy_start_req (pm8001_ha, phy_id);wait_for_completion (&completion); }
Greg Kroah-Hartman
maintainerPATCH 294/300 mptcp: Fix proto fallback detection with BPF
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiayuan Chen <[email protected]>
commit c77b3b79a92e3345aa1ee296180d1af4e7031f8f upstream.
The sockmap feature allows bpf syscall from userspace, or based on bpf sockops, replacing the sk_prot of sockets during protocol stack processing with sockmap's custom read/write interfaces.
'''tcp_rcv_state_process()
syn_recv_sock()/subflow_syn_recv_sock()
tcp_init_transfer(BPF_SOCK_OPS_PASSIVE_ESTABLISHED_CB)
bpf_skops_established <== sockops
bpf_sock_map_update(sk) <== call bpf helper
tcp_bpf_update_proto() <== update sk_prot'''
When the server has MPTCP enabled but the client sends a TCP SYN without MPTCP, subflow_syn_recv_sock() performs a fallback on the subflow, replacing the subflow sk's sk_prot with the native sk_prot. '''subflow_syn_recv_sock()
subflow_ulp_fallback()
subflow_drop_ctx()
mptcp_subflow_ops_undo_override()
'''
Then, this subflow can be normally used by sockmap, which replaces the native sk_prot with sockmap's custom sk_prot. The issue occurs when the user executes accept::mptcp_stream_accept::mptcp_fallback_tcp_ops(). Here, it uses sk->sk_prot to compare with the native sk_prot, but this is incorrect when sockmap is used, as we may incorrectly set sk->sk_socket->ops.
This fix uses the more generic sk_family for the comparison instead.
Additionally, this also prevents a WARNING from occurring:
result from ./scripts/decode_stacktrace.sh:
------------[ cut here ]------------ WARNING: CPU: 0 PID: 337 at net/mptcp/protocol.c:68 mptcp_stream_accept \ (net/mptcp/protocol.c:4005) Modules linked in:
...
PKRU: 55555554
Call Trace: <TASK>
do_accept (net/socket.c:1989)__sys_accept4 (net/socket.c:2028 net/socket.c:2057) __x64_sys_accept (net/socket.c:2067)x64_sys_call (arch/x86/entry/syscall_64.c:41)do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130)
RIP: 0033:0x7f87ac92b83d ---[ end trace 0000000000000000 ]---
[ Conflicts in protocol.c, because commit 8e2b8a9fa512 ("mptcp: don't
overwrite sock_ops in mptcp_is_tcpsk()") is not in this version. It changes the logic on how and where the sock_ops is overridden in case of passive fallback. To fix this, mptcp_is_tcpsk() is modified to use the family, but first, a check of the protocol is required to continue returning 'false' in case of MPTCP socket. ]
--- net/mptcp/protocol.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
net/mptcp/protocol.c +7 -2
@@ -56,8 +56,13 @@ static struct socket *__mptcp_nmpc_sockestatic bool mptcp_is_tcpsk (struct sock *sk) {struct socket *sock = sk->sk_socket; +unsigned short family; -if (unlikely (sk->sk_prot == &tcp_prot)) { +if (likely (sk->sk_protocol ==IPPROTO_MPTCP )) +return false; + + family =READ_ONCE (sk->sk_family); +if (unlikely (family ==AF_INET )) {/* we are being invoked after mptcp_accept() has * accepted a non-mp-capable flow: sk is a tcp_sk, * not an mptcp one.
@@ -68,7 +73,7 @@ static bool mptcp_is_tcpsk(struct sock * sock->ops = &inet_stream_ops;return true;#if IS_ENABLED (CONFIG_MPTCP_IPV6 ) - } else if (unlikely(sk->sk_prot == &tcpv6_prot)) { + } else if (unlikely(family == AF_INET6)) { sock->ops = &inet6_stream_ops;return true;#endif
Greg Kroah-Hartman
maintainerPATCH 295/300 smb: client: fix memory leak in cifs_construct_tcon()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <[email protected]>
[ Upstream commit 3184b6a5a24ec9ee74087b2a550476f386df7dc2 ]
When having a multiuser mount with domain= specified and using cifscreds, cifs_set_cifscreds() will end up setting @ctx->domainname, so it needs to be freed before leaving cifs_construct_tcon().
This fixes the following memory leak reported by kmemleak:
mount.cifs //srv/share /mnt -o domain=ZELDA,multiuser,... su - testuser
cifscreds add -d ZELDA -u testuser
...
ls /mnt/1
...
umount /mnt
echo scan > /sys/kernel/debug/kmemleak
cat /sys/kernel/debug/kmemleak
unreferenced object 0xffff8881203c3f08 (size 8):
comm "ls", pid 5060, jiffies 4307222943
hex dump (first 8 bytes):
5a 45 4c 44 41 00 cc cc ZELDA...
backtrace (crc d109a8cf):
__kmalloc_node_track_caller_noprof+0x572/0x710
kstrdup+0x3a/0x70
cifs_sb_tlink+0x1209/0x1770 [cifs]
cifs_get_fattr+0xe1/0xf50 [cifs]
cifs_get_inode_info+0xb5/0x240 [cifs]
cifs_revalidate_dentry_attr+0x2d1/0x470 [cifs]
cifs_getattr+0x28e/0x450 [cifs]
vfs_getattr_nosec+0x126/0x180
vfs_statx+0xf6/0x220
do_statx+0xab/0x110
__x64_sys_statx+0xd5/0x130
do_syscall_64+0xbb/0x380
entry_SYSCALL_64_after_hwframe+0x77/0x7f--- fs/cifs/connect.c | 1 + 1 file changed, 1 insertion(+)
fs/cifs/connect.c +1 -0
@@ -5162,6 +5162,7 @@ cifs_construct_tcon(struct cifs_sb_info out:kfree (vol_info->username); +kfree (vol_info->domainname);kfree_sensitive (vol_info->password);kfree (vol_info);
Greg Kroah-Hartman
maintainerPATCH 296/300 usb: typec: ucsi: psy: Set max current to zero when disconnected
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jameson Thies <[email protected]>
[ Upstream commit 23379a17334fc24c4a9cbd9967d33dcd9323cc7c ]
The ucsi_psy_get_current_max function defaults to 0.1A when it is not clear how much current the partner device can support. But this does not check the port is connected, and will report 0.1A max current when nothing is connected. Update ucsi_psy_get_current_max to report 0A when there is no connection.
Rule: add
--- drivers/usb/typec/ucsi/psy.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/usb/typec/ucsi/psy.c +5 -0
@@ -123,6 +123,11 @@ static int ucsi_psy_get_current_max(stru {u32 pdo; +if (!(con->status.flags &UCSI_CONSTAT_CONNECTED )) { + val->intval =0 ; +return 0 ; + } +switch (UCSI_CONSTAT_PWR_OPMODE (con->status.flags)) {case UCSI_CONSTAT_PWR_OPMODE_PD :if (con->num_pdos >0 ) {
Greg Kroah-Hartman
maintainerPATCH 297/300 usb: renesas_usbhs: Fix synchronous external abort on unbind
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Claudiu Beznea <[email protected]>
[ Upstream commit eb9ac779830b2235847b72cb15cf07c7e3333c5e ]
A synchronous external abort occurs on the Renesas RZ/G3S SoC if unbind is executed after the configuration sequence described above:
modprobe usb_f_ecm
modprobe libcomposite
modprobe configfs
cd /sys/kernel/config/usb_gadget
mkdir -p g1
cd g1
echo "0x1d6b" > idVendor
echo "0x0104" > idProduct
mkdir -p strings/0x409
echo "0123456789" > strings/0x409/serialnumber echo "Renesas." > strings/0x409/manufacturer echo "Ethernet Gadget" > strings/0x409/product mkdir -p functions/ecm.usb0
mkdir -p configs/c.1
mkdir -p configs/c.1/strings/0x409
echo "ECM" > configs/c.1/strings/0x409/configuration
if [ ! -L configs/c.1/ecm.usb0 ]; then
ln -s functions/ecm.usb0 configs/c.1
fi
echo 11e20000.usb > UDC
echo 11e20000.usb > /sys/bus/platform/drivers/renesas_usbhs/unbind
The displayed trace is as follows:
Internal error: synchronous external abort: 0000000096000010 [#1] SMP CPU: 0 UID: 0 PID: 188 Comm: sh Tainted: G M 6.17.0-rc7-next-20250922-00010-g41050493b2bd #55 PREEMPT Tainted: [M]=MACHINE_CHECK Hardware name: Renesas SMARC EVK version 2 based on r9a08g045s33 (DT) pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : usbhs_sys_function_pullup+0x10/0x40 [renesas_usbhs] lr : usbhsg_update_pullup+0x3c/0x68 [renesas_usbhs] sp : ffff8000838b3920 x29: ffff8000838b3920 x28: ffff00000d585780 x27: 0000000000000000 x26: 0000000000000000 x25: 0000000000000000 x24: ffff00000c3e3810 x23: ffff00000d5e5c80 x22: ffff00000d5e5d40 x21: 0000000000000000 x20: 0000000000000000 x19: ffff00000d5e5c80 x18: 0000000000000020 x17: 2e30303230316531 x16: 312d7968703a7968 x15: 3d454d414e5f4344 x14: 000000000000002c x13: 0000000000000000 x12: 0000000000000000 x11: ffff00000f358f38 x10: ffff00000f358db0 x9 : ffff00000b41f418 x8 : 0101010101010101 x7 : 7f7f7f7f7f7f7f7f x6 : fefefeff6364626d x5 : 8080808000000000 x4 : 000000004b5ccb9d x3 : 0000000000000000 x2 : 0000000000000000 x1 : ffff800083790000 x0 : ffff00000d5e5c80 Call trace: usbhs_sys_function_pullup+0x10/0x40 [renesas_usbhs] (P) usbhsg_pullup+0x4c/0x7c [renesas_usbhs] usb_gadget_disconnect_locked+0x48/0xd4 gadget_unbind_driver+0x44/0x114 device_remove+0x4c/0x80 device_release_driver_internal+0x1c8/0x224 device_release_driver+0x18/0x24 bus_remove_device+0xcc/0x10c device_del+0x14c/0x404 usb_del_gadget+0x88/0xc0 usb_del_gadget_udc+0x18/0x30 usbhs_mod_gadget_remove+0x24/0x44 [renesas_usbhs] usbhs_mod_remove+0x20/0x30 [renesas_usbhs] usbhs_remove+0x98/0xdc [renesas_usbhs] platform_remove+0x20/0x30 device_remove+0x4c/0x80 device_release_driver_internal+0x1c8/0x224 device_driver_detach+0x18/0x24 unbind_store+0xb4/0xb8 drv_attr_store+0x24/0x38 sysfs_kf_write+0x7c/0x94 kernfs_fop_write_iter+0x128/0x1b8 vfs_write+0x2ac/0x350 ksys_write+0x68/0xfc __arm64_sys_write+0x1c/0x28 invoke_syscall+0x48/0x110 el0_svc_common.constprop.0+0xc0/0xe0 do_el0_svc+0x1c/0x28 el0_svc+0x34/0xf0 el0t_64_sync_handler+0xa0/0xe4 el0t_64_sync+0x198/0x19c Code: 7100003f 1a9f07e1 531c6c22 f9400001 (79400021) ---[ end trace 0000000000000000 ]--- note: sh[188] exited with irqs disabled note: sh[188] exited with preempt_count 1
The issue occurs because usbhs_sys_function_pullup(), which accesses the IP registers, is executed after the USBHS clocks have been disabled. The problem is reproducible on the Renesas RZ/G3S SoC starting with the addition of module stop in the clock enable/disable APIs. With module stop functionality enabled, a bus error is expected if a master accesses a module whose clock has been stopped and module stop activated.
Disable the IP clocks at the end of remove.
--- drivers/usb/renesas_usbhs/common.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/usb/renesas_usbhs/common.c +7 -7
@@ -802,19 +802,19 @@ static int usbhs_remove(struct platform_flush_delayed_work (&priv->notify_hotplug_work); -/* power off */ -if (!usbhs_get_dparam (priv, runtime_pwctrl)) -usbhsc_power_ctrl (priv,0 ); - -pm_runtime_disable (&pdev->dev); -usbhs_platform_call (priv, hardware_exit, pdev); -usbhsc_clk_put (priv);reset_control_assert (priv->rsts);usbhs_mod_remove (priv);usbhs_fifo_remove (priv);usbhs_pipe_remove (priv); +/* power off */ +if (!usbhs_get_dparam (priv, runtime_pwctrl)) +usbhsc_power_ctrl (priv,0 ); + +usbhsc_clk_put (priv); +pm_runtime_disable (&pdev->dev); +return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 298/300 usb: uas: fix urb unmapping issue when the uas device is remove during ongoing data transfer
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Owen Gu <[email protected]>
[ Upstream commit 26d56a9fcb2014b99e654127960aa0a48a391e3c ]
When a UAS device is unplugged during data transfer, there is a probability of a system panic occurring. The root cause is an access to an invalid memory address during URB callback handling. Specifically, this happens when the dma_direct_unmap_sg() function is called within the usb_hcd_unmap_urb_for_dma() interface, but the sg->dma_address field is 0 and the sg data structure has already been freed.
The SCSI driver sends transfer commands by invoking uas_queuecommand_lck() in uas.c, using the uas_submit_urbs() function to submit requests to USB. Within the uas_submit_urbs() implementation, three URBs (sense_urb, data_urb, and cmd_urb) are sequentially submitted. Device removal may occur at any point during uas_submit_urbs execution, which may result in URB submission failure. However, some URBs might have been successfully submitted before the failure, and uas_submit_urbs will return the -ENODEV error code in this case. The current error handling directly calls scsi_done(). In the SCSI driver, this eventually triggers scsi_complete() to invoke scsi_end_request() for releasing the sgtable. The successfully submitted URBs, when being unlinked to giveback, call usb_hcd_unmap_urb_for_dma() in hcd.c, leading to exceptions during sg unmapping operations since the sg data structure has already been freed.
This patch modifies the error condition check in the uas_submit_urbs() function. When a UAS device is removed but one or more URBs have already been successfully submitted to USB, it avoids immediately invoking scsi_done() and save the cmnd to devinfo->cmnd array. If the successfully submitted URBs is completed before devinfo->resetting being set, then the scsi_done() function will be called within uas_try_complete() after all pending URB operations are finalized. Otherwise, the scsi_done() function will be called within uas_zap_pending(), which is executed after usb_kill_anchored_urbs().
The error handling only takes effect when uas_queuecommand_lck() calls uas_submit_urbs() and returns the error value -ENODEV . In this case, the device is disconnected, and the flow proceeds to uas_disconnect(), where uas_zap_pending() is invoked to call uas_try_complete().
--- drivers/usb/storage/uas.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/usb/storage/uas.c +6 -1
@@ -705,7 +705,11 @@ static int uas_queuecommand_lck(struct s* of queueing, no matter how fatal the error */ if (err == -ENODEV ) { -set_host_byte (cmnd,DID_ERROR ); +if (cmdinfo->state & (COMMAND_INFLIGHT |DATA_IN_URB_INFLIGHT | +DATA_OUT_URB_INFLIGHT )) + goto out; + +set_host_byte (cmnd,DID_NO_CONNECT ); cmnd->scsi_done (cmnd); goto zombie; }
@@ -718,6 +722,7 @@ static int uas_queuecommand_lck(struct suas_add_work (cmdinfo); } +out: devinfo->cmnd[idx] = cmnd; zombie:spin_unlock_irqrestore (&devinfo->lock, flags);
Greg Kroah-Hartman
maintainerPATCH 299/300 ovl: fix UAF in ovl_dentry_update_reval by moving dput() in ovl_link_up
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vasiliy Kovalev <[email protected]>
[ Upstream commit c84e125fff2615b4d9c259e762596134eddd2f27 ]
The issue was caused by dput(upper) being called before ovl_dentry_update_reval(), while upper->d_flags was still accessed in ovl_dentry_remote().
Move dput(upper) after its last use to prevent use-after-free.
BUG: KASAN: slab-use-after-free in ovl_dentry_remote fs/overlayfs/util.c:162 [inline] BUG: KASAN: slab-use-after-free in ovl_dentry_update_reval+0xd2/0xf0 fs/overlayfs/util.c:167 Call Trace: <TASK> __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 ovl_dentry_remote fs/overlayfs/util.c:162 [inline] ovl_dentry_update_reval+0xd2/0xf0 fs/overlayfs/util.c:167 ovl_link_up fs/overlayfs/copy_up.c:610 [inline] ovl_copy_up_one+0x2105/0x3490 fs/overlayfs/copy_up.c:1170 ovl_copy_up_flags+0x18d/0x200 fs/overlayfs/copy_up.c:1223 ovl_rename+0x39e/0x18c0 fs/overlayfs/dir.c:1136 vfs_rename+0xf84/0x20a0 fs/namei.c:4893 ... </TASK>
--- fs/overlayfs/copy_up.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/overlayfs/copy_up.c +1 -1
@@ -469,7 +469,6 @@ static int ovl_link_up(struct ovl_copy_u err =PTR_ERR (upper);if (!IS_ERR (upper)) { err =ovl_do_link (ovl_dentry_upper (c->dentry), udir, upper); -dput (upper);if (!err) {/* Restore timestamps on parent (best effort) */
@@ -477,6 +476,7 @@ static int ovl_link_up(struct ovl_copy_uovl_dentry_set_upper_alias (c->dentry);ovl_dentry_update_reval (c->dentry, upper); } +dput (upper); }inode_unlock (udir);if (err)
Greg Kroah-Hartman
maintainerPATCH 300/300 netfilter: nf_set_pipapo_avx2: fix initial map fill
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <[email protected]>
commit ea77c397bff8b6d59f6d83dae1425b08f465e8b5 upstream.
If the first field doesn't cover the entire start map, then we must zero out the remainder, else we leak those bits into the next match round map.
The early fix was incomplete and did only fix up the generic C implementation.
A followup patch adds a test case to nft_concat_range.sh.
--- net/netfilter/nft_set_pipapo_avx2.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)
net/netfilter/nft_set_pipapo_avx2.c +20 -1
@@ -1106,6 +1106,25 @@ bool nft_pipapo_avx2_estimate(const stru }/** +* pipapo_resmap_init_avx2() - Initialise result map before first use +* @m: Matching data, including mapping table +* @res_map: Result map +* +* Like pipapo_resmap_init() but do not set start map bits covered by the first field. +*/ +static inline void pipapo_resmap_init_avx2 (const struct nft_pipapo_match *m,unsigned long *res_map) +{ +const struct nft_pipapo_field *f = m->f; +int i; + +/* Starting map doesn't need to be set to all-ones for this implementation, +* but we do need to zero the remaining bits, if any. +*/ +for (i = f->bsize; i < m->bsize_max; i++) + res_map[i] =0ul ; +} + +/** * nft_pipapo_avx2_lookup() - Lookup function for AVX2 implementation * @net: Network namespace * @set: nftables API set representation
@@ -1158,7 +1177,7 @@ bool nft_pipapo_avx2_lookup(const struct res = scratch->map + (map_index ? m->bsize_max :0 ); fill = scratch->map + (map_index ?0 : m->bsize_max); -/* Starting map doesn't need to be set for this implementation */ +pipapo_resmap_init_avx2 (m, res);nft_pipapo_avx2_prepare ();
Hi!
Quoted 5 lines
This is the start of the stable review cycle for the 5.10.247 release. There are 300 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.
Quoted 8 lines
Responses should be made by Fri, 05 Dec 2025 15:23:16 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.247-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.10.y
and the diffstat can be found below.
Something tagged 5.10.247-rc1 has compile problems in our testing.
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/pipelines/2194166780
Gitlab says:
"Linux 5.10.247-rc1 (527f7b9e9a2b)
Retry
Failed
Created 1 hour ago by cip-ci, finished 39 minutes ago"
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/tree/linux-5.10.y
Best regards,
Pavel
CC drivers/soc/tegra/regulators-tegra30.o
2663drivers/soc/tegra/fuse/fuse-tegra30.c:250:3: error: 'const struct tegra_fuse_soc' has no member named 'cells' 2664
250 | .cells = tegra114_fuse_cells,
2665
| ^~~~~
2666drivers/soc/tegra/fuse/fuse-tegra30.c:250:11: error: initialization of 'const struct attribute_group *' from incompatible pointer type 'const struct nvmem_cell_info *' [-Werror=incompatible-pointer-types] 2667
250 | .cells = tegra114_fuse_cells,
2668
| ^~~~~~~~~~~~~~~~~~~
2669drivers/soc/tegra/fuse/fuse-tegra30.c:250:11: note: (near initialization for 'tegra114_fuse_soc.soc_attr_group') 2670drivers/soc/tegra/fuse/fuse-tegra30.c:251:3: error: 'const struct tegra_fuse_soc' has no member named 'num_cells' 2671
251 | .num_cells = ARRAY_SIZE(tegra114_fuse_cells),
2672
| ^~~~~~~~~
2673
In file included from ./include/asm-generic/bug.h:20,
2674
from ./arch/arm/include/asm/bug.h:60,
2675
from ./include/linux/bug.h:5,
2676
from ./include/linux/thread_info.h:12,2677
from ./include/asm-generic/current.h:5,
2678
from ./arch/arm/include/generated/asm/current.h:1,
2679
from ./include/linux/sched.h:12,
2680
from ./include/linux/ratelimit.h:6,
2681
from ./include/linux/dev_printk.h:16,
2682
from ./include/linux/device.h:15,2683
from drivers/soc/tegra/fuse/fuse-tegra30.c:6:
2684./include/linux/kernel.h:49:25: warning: excess elements in struct initializer 2685
49 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
2686
| ^
2687drivers/soc/tegra/fuse/fuse-tegra30.c:251:15: note: in expansion of macro 'ARRAY_SIZE' 2688
251 | .num_cells = ARRAY_SIZE(tegra114_fuse_cells),
2689
| ^~~~~~~~~~
2690./include/linux/kernel.h:49:25: note: (near initialization for 'tegra114_fuse_soc') 2691
49 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
2692
| ^
2693drivers/soc/tegra/fuse/fuse-tegra30.c:251:15: note: in expansion of macro 'ARRAY_SIZE' 2694
251 | .num_cells = ARRAY_SIZE(tegra114_fuse_cells),
2695
| ^~~~~~~~~~
2696
cc1: some warnings being treated as errors
2697
make[4]: *** [scripts/Makefile.build:286: drivers/soc/tegra/fuse/fuse-tegra30.o] Error 1 2698
make[4]: *** Waiting for unfinished jobs....
2699
CC drivers/soc/renesas/rcar-sysc.o
Quoted 1,251 lines
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:Greg Kroah-Hartman <[email protected]>
Linux 5.10.247-rc1Florian Westphal <[email protected]>
netfilter:nf_set_pipapo_avx2: fix initial map fillVasiliy Kovalev <[email protected]>
ovl: fix UAF inovl_dentry_update_revalby movingdput()inovl_link_upOwen Gu <[email protected]>
usb: uas: fix urb unmapping issue when the uas device is remove during ongoing data transferClaudiu Beznea <[email protected]>
usb:renesas_usbhs: Fix synchronous external abort on unbindJameson Thies <[email protected]>
usb: typec: ucsi: psy: Set max current to zero when disconnectedPaulo Alcantara <[email protected]>
smb: client: fix memory leak incifs_construct_tcon()Jiayuan Chen <[email protected]>
mptcp: Fix proto fallback detection with BPFIgor Pylypiv <[email protected]>
scsi: pm80xx: Set phy->enable_completion only when weFlorian Westphal <[email protected]>
netfilter:nf_set_pipapo: fix initial map fillAlex Lu <[email protected]>
Bluetooth: Add more enc key size checkJiufei Xue <[email protected]>
fs: writeback: fix use-after-free in__mark_inode_dirty()Ilya Dryomov <[email protected]>
libceph: fix potential use-after-free inhave_mon_and_osd_map()Alex Hung <[email protected]>
drm/amd/display: Check NULL before accessingJohan Hovold <[email protected]>
drm: sti: fix device leaks at component probeVanillan Wang <[email protected]>
USB: serial: option: add support for Rolling RW101R-GLOleksandr Suvorov <[email protected]>
USB: serial:ftdi_sio: add support for u-blox EVK-M101Mathias Nyman <[email protected]>
xhci: dbgtty: Fix data corruption when transmitting data form DbC to hostManish Nagar <[email protected]>
usb: dwc3: Fix race condition between concurrentdwc3_remove_requests()call pathsTianchu Chen <[email protected]>
usb: storage: sddr55: Reject out-of-boundnew_pbaAlan Stern <[email protected]>
USB: storage: Remove subclass and protocol overrides from Novatek quirkDesnes Nunes <[email protected]>
usb: storage: Fix memory leak in USB bulk transportKuen-Han Tsai <[email protected]>
usb: gadget:f_eem: Fix memory leak ineem_unwrapMiaoqian Lin <[email protected]>
usb: cdns3: Fix double resource release incdns3_pci_probeJohan Hovold <[email protected]>
most: usb: fix double free on late probe failureMiaoqian Lin <[email protected]>
serial: amba-pl011: preferdma_mapping_error()over explicit address checkingKhairul Anuar Romli <[email protected]>
firmware: stratix10-svc: fix bug in saving controller dataMiaoqian Lin <[email protected]>
slimbus: ngd: Fix reference count leak inqcom_slim_ngd_notify_slavesAlan Borzeszkowski <[email protected]>
thunderbolt: Add support for Intel Wildcat LakeMikulas Patocka <[email protected]>
dm-verity: fix unreliable memory allocationMarc Kleine-Budde <[email protected]>
can:sun4i_can:sun4i_can_interrupt(): fix max irq loop handlingThomas Mühlbacher <[email protected]>
can: sja1000: fix max irq loop handlingGui-Dong Han <[email protected]>
atm/fore200e: Fix possible data race infore200e_open()Thomas Bogendoerfer <[email protected]>
MIPS: mm: kmalloctlb_vpnarray to avoid stack overflowMaciej W. Rozycki <[email protected]>
MIPS: mm: Prevent a TLB shutdown on initial uniquificationChristophe JAILLET <[email protected]>
iio:common:ssp_sensors: Fix an error handling pathssp_probe()Francesco Lavra <[email protected]>
iio: imu:st_lsm6dsx: fix array size forst_lsm6dsx_settingsfieldsJiri Olsa <[email protected]>
Revert "perf/x86: Always store regs->ip in perf_callchain_kernel()"Hang Zhou <[email protected]>
spi: bcm63xx: fix premature CS deassertion on RX-only transactionsHaotian Zhang <[email protected]>
mailbox: mailbox-test: Fixdebugfs_create_direrror checkingJiefeng Zhang <[email protected]>
net: atlantic: fix fragment overflow handling in RX pathAlexey Kodanev <[email protected]>
net: sxgbe: fix potential NULL dereference insxgbe_rx()Danielle Costantino <[email protected]>
net/mlx5e: Fix validation logic in rate limitingKai-Heng Feng <[email protected]>
net: aquantia: Add missing descriptor cache invalidation on ATL2Luiz Augusto von Dentz <[email protected]>
Bluetooth: SMP: Fix not generating mackey and ltk when repairingSeungjin Bae <[email protected]>
can:kvaser_usb: leaf: Fix potential infinite loop in command parsersSeungjin Bae <[email protected]>
Input: pegasus-notetaker - fix potential out-of-bounds accessVincent Mailhol <[email protected]>
Input: remove third argument ofusb_maxpacket()Vincent Mailhol <[email protected]>
usb: deprecate the third argument ofusb_maxpacket()Paolo Abeni <[email protected]>
mptcp: do not fallback when OoO is presentEric Dumazet <[email protected]>
mptcp: fix a race inmptcp_pm_del_add_timer()Vlastimil Babka <[email protected]>
mm/mempool: fix poisoning order>0 pages with HIGHMEMFabio M. De Francesco <[email protected]>
mm/mempool: replacekmap_atomic()withkmap_local_page()Krzysztof Kozlowski <[email protected]>
dt-bindings: pinctrl: toshiba,visconti: Fix number of items in groupsEric Dumazet <[email protected]>
mptcp: fix race condition inmptcp_schedule_work()Paolo Abeni <[email protected]>
mptcp: introducemptcp_schedule_workNiklas Cassel <[email protected]>
ata: libata-scsi: Fix system suspend for a security locked driveSudeep Holla <[email protected]>
pmdomain: arm: scmi: Fix genpd leak on provider registration failureMiaoqian Lin <[email protected]>
pmdomain: imx: Fix reference count leak inimx_gpc_removeTakashi Iwai <[email protected]>
ALSA: usb-audio: Fix potential overflow of PCM transfer bufferBreno Leitao <[email protected]>
net: netpoll: fix incorrect refcount handling causing incorrect cleanupTrond Myklebust <[email protected]>
Revert "NFS: Don't setNFS_INO_REVAL_PAGECACHEin the inode cache validity"Nick Desaulniers <[email protected]>
Makefile.compiler: replace cc-ifversion with compiler-specific macrosNathan Chancellor <[email protected]>
net: qede: Initializeqede_ll_opswith designated initializerLong Li <[email protected]>
uio_hv_generic: Set event for all channels on the deviceNishanth Menon <[email protected]>
net: ethernet: ti: netcp: Standardizeknav_dma_open_channelto return NULL on errorRené Rebe <[email protected]>
ALSA: usb-audio: fix uac2 clock source at terminal parserIsaac J. Manjarres <[email protected]>
mm/mm_init: fix hash table order logging inalloc_large_system_hash()Jakub Horký <[email protected]>
kconfig/nconf: Initialize the default locale at startupJakub Horký <[email protected]>
kconfig/mconf: Initialize the default locale at startupShahar Shitrit <[email protected]>
net: tls: Cancel RX async resync request onrcd_deltaoverflowBart Van Assche <[email protected]>
scsi: core: Fix a regression triggered byscsi_host_busy()Michal Luczaj <[email protected]>
vsock: Ignore signal/timeout onconnect()if already establishedAleksei Nikiforov <[email protected]>
s390/ctcm: Fix double-kfreeIlya Maximets <[email protected]>
net: openvswitch: remove never-working support for setting nsh fieldsZilin Guan <[email protected]>
mlxsw: spectrum: Fix memory leak inmlxsw_sp_flower_stats()Ma Ke <[email protected]>
drm/tegra: dc: Fix reference leak integra_dc_couple()Maciej W. Rozycki <[email protected]>
MIPS: Malta: Fix !EVA SOC-it PCI MMIOHamza Mahfooz <[email protected]>
scsi: target:tcm_loop: Fix segfault intcm_loop_tpg_address_show()Bart Van Assche <[email protected]>
scsi: sg: Do not sleep in atomic contextEwan D. Milne <[email protected]>
nvme: nvme-fc: Ensure ->ioerr_work is cancelled in nvme_fc_delete_ctrl()Dan Carpenter <[email protected]>
Input:imx_sc_key- fix memory corruption on unloadTzung-Bi Shih <[email protected]>
Input:cros_ec_keyb- fix an invalid memory accessAndrey Vatoropin <[email protected]>
be2net: passwrb_paramsin case of OS2BMCYongpeng Yang <[email protected]>
exfat: check return value ofsb_min_blocksizeinexfat_read_boot_sectorNiravkumar L Rabara <[email protected]>
mtd: rawnand: cadence: fix DMA device NULL pointer dereferenceZhang Heng <[email protected]>
HID: quirks: work around VID/PID conflict for 0x4c4a/0x4155Abdun Nihaal <[email protected]>
isdn: mISDN: hfcsusb: fix memory leak inhfcsusb_probe()Niravkumar L Rabara <[email protected]>
EDAC/altera: Use INTTEST register for Ethernet and USB SBE injectionNiravkumar L Rabara <[email protected]>
EDAC/altera: Handle OCRAM ECC enable after warm resetHans de Goede <[email protected]>
spi: Try to get ACPI GPIO IRQ earlierWei Yang <[email protected]>
fs/proc: fix uaf inproc_readdir_de()Chuang Wang <[email protected]>
ipv4: route: Preventrt_bind_exception()from rebinding stale fnheNate Karstens <[email protected]>
strparser: Fix signed/unsigned mismatch bugPeter Oberparleiter <[email protected]>
gcov: add support for GCC 15Olga Kornievskaia <[email protected]>
NFSD: free copynotify stateid innfs4_free_ol_stateid()Masami Ichikawa <[email protected]>
HID: hid-ntrig: Prevent memory leak inntrig_report_version()Pablo Neira Ayuso <[email protected]>
netfilter:nf_tables: reject duplicate device on updatesDan Carpenter <[email protected]>
mtd: onenand: Pass correct pointer to IRQ handlerEric Biggers <[email protected]>
lib/crypto: arm/curve25519: Disable onCPU_BIG_ENDIANJakub Acs <[email protected]>
mm/ksm: fix flag-dropping behavior inksm_madviseChristoph Hellwig <[email protected]>
fsdax: mark the iomap argument todax_iomap_sectoras constHaein Lee <[email protected]>
ALSA: usb-audio: Fix NULL pointer dereference insnd_usb_mixer_controls_baddIan Forbes <[email protected]>
drm/vmwgfx: Validate command header size againstSVGA_CMD_MAX_DATASIZEHaotian Zhang <[email protected]>
ASoC: cs4271: Fix regulator leak on probe failureHaotian Zhang <[email protected]>
regulator: fixed: fix GPIO descriptor leak on register failureChris Morgan <[email protected]>
regulator: fixed: usedev_err_probefor registerShuai Xue <[email protected]>
acpi,srat: Fix incorrect device handle check for Generic InitiatorPauli Virtanen <[email protected]>
Bluetooth: L2CAP: exportl2cap_chan_holdfor modulesFelix Maurer <[email protected]>
hsr: Fix supervision frame sending on HSRv0Eric Dumazet <[email protected]>
net_sched: limittry_bulk_dequeue_skb()batchesGal Pressman <[email protected]>
net/mlx5e: Fix wraparound in rate limiting for values above 255 GbpsGal Pressman <[email protected]>
net/mlx5e: Fix maxrate wraparound in threshold between unitsRanganath V N <[email protected]>
net: sched:act_ife: initialize structtc_ifeto fix KMSAN kernel-infoleakBenjamin Berg <[email protected]>
wifi: mac80211: skip rate verification for not captured PSDUsBuday Csaba <[email protected]>
net: mdio: fix resource leak inmdiobus_register_device()Kuniyuki Iwashima <[email protected]>
tipc: Fix use-after-free intipc_mon_reinit_self().D. Wythe <[email protected]>
net/smc: fix mismatch between CLC header and proposalEric Dumazet <[email protected]>
sctp: prevent possible shift-out-of-bounds insctp_transport_update_rtoPauli Virtanen <[email protected]>
Bluetooth: 6lowpan: Don't hold spin lock over sleeping functionsPauli Virtanen <[email protected]>
Bluetooth: 6lowpan: fixBDADDR_LEvsADDR_LE_DEVaddress type confusionPauli Virtanen <[email protected]>
Bluetooth: 6lowpan: reset link-local header on ipv6 recv pathRaphael Pinsonneault-Thibeault <[email protected]>
Bluetooth: btusb: reorder cleanup inbtusb_disconnectto avoid UAFWei Fang <[email protected]>
net: fec: correctrx_bytesstatistic for the case SHIFT16 is setSharique Mohammad <[email protected]>
ASoC: max98090/91: fixed max98091 ALSA widget powering up/downTristan Lobb <[email protected]>
HID: quirks: avoid Cooler Master MM712 dongle wakeup bugJoshua Watt <[email protected]>
NFS4: Fix state renewals missing after bootDanil Skrebenkov <[email protected]>
RISC-V: clear hot-unplugged cores from all taskmm_cpumasksto avoid rfence errorsPeter Zijlstra <[email protected]>
compiler_types: Move unused static inline functions warning to W=2Krzysztof Kozlowski <[email protected]>
extcon: adc-jack: Cleanup wakeup source only if it was enabledNathan Chancellor <[email protected]>
lib/crypto: curve25519-hacl64: Fix older clang KASAN workaround for GCCZilin Guan <[email protected]>
tracing: Fix memory leaks increate_field_var()Qendrim Maxhuni <[email protected]>
net: usb:qmi_wwan: initialize MAC header offset inqmimux_rx_fixupStefan Wiehler <[email protected]>
sctp: Hold sock lock while iterating over address listXin Long <[email protected]>
sctp: hold endpoint before calling cb insctp_transport_lookup_processYajun Deng <[email protected]>
net: Usenlmsg_unicast()instead ofnetlink_unicast()Lu Wei <[email protected]>
net: sctp: Fix some typosStefan Wiehler <[email protected]>
sctp: Prevent TOCTOU out-of-bounds writeStefan Wiehler <[email protected]>
sctp: Hold RCU read lock while iterating over address listJonas Gorski <[email protected]>
net: dsa: b53: stop reading ARL entries if search is doneJonas Gorski <[email protected]>
net: dsa: b53: fix enabling ip multicastJonas Gorski <[email protected]>
net: dsa: b53: fix resetting speed and pause on forced linkHangbin Liu <[email protected]>
net: vlan: sync VLAN features with lower deviceJosephine Pfeiffer <[email protected]>
riscv: ptdump: useseq_puts()inpt_dump_seq_puts()macroKailang Yang <[email protected]>
ALSA: hda/realtek: Audio disappears on HP 15-fc000 after warm boot againViacheslav Dubeyko <[email protected]>
ceph: add checking ofwait_for_completion_killable()return valueValerio Setti <[email protected]>
ASoC: meson: aiu-encoder-i2s: fix bit clock polarityAlbin Babu Varghese <[email protected]>
fbdev: Add bounds checking inbit_putcsto fix vmalloc-out-of-boundsIan Rogers <[email protected]>
tools bitmap: Add missingasm-generic/bitsperlong.hincludeSakari Ailus <[email protected]>
ACPI: property: Return present device nodes only on fwnode interfaceRandall P. Embry <[email protected]>
9p:sysfs_init: don't hardcode error to ENOMEMRandall P. Embry <[email protected]>
9p: fix/sys/fs/9p/cachesoverwriting itselfNicolas Ferre <[email protected]>
ARM: at91: pm: save and restore ACR during PLL disable/enableTiwei Bie <[email protected]>
um: Fix help message for ssl-non-rawYikang Yue <[email protected]>
fs/hpfs: Fix error code fornew_inode()failure in mkdir/create/mknod/symlinkaustinchang <[email protected]>
btrfs: mark dirty extent range for out of bound prealloc extentsSaket Dumbre <[email protected]>
ACPICA: Updatedsmethod.cto get rid of unused variable warningMike Marshall <[email protected]>
orangefs: fix xattr related buffer overflow...Dragos Tatulea <[email protected]>
page_pool: Clamp pool size to max 16K pagesChi Zhiling <[email protected]>
exfat: limit log print for IO errorRoy Vegard Ovesen <[email protected]>
ALSA: usb-audio: add mono main switch to Presonus S1824cIvan Pravdin <[email protected]>
Bluetooth: bcsp: receive data only if registeredLuiz Augusto von Dentz <[email protected]>
Bluetooth: SCO: Fix UAF onsco_conn_freeThéo Lebrun <[email protected]>
net: macb: avoid dealing with endianness inmacb_set_hwaddr()chuguangqing <[email protected]>
fs: ext4: changeGFP_KERNELtoGFP_NOFSto avoid deadlockAl Viro <[email protected]>
nfs4_setup_readdir(): insufficient locking for ->d_parent->d_inode dereferencingAnthony Iliopoulos <[email protected]>
NFSv4.1: fix mount hang afterCREATE_SESSIONfailureOlga Kornievskaia <[email protected]>
NFSv4: handleERR_GRACEon delegation recallsStephan Gerhold <[email protected]>
remoteproc: qcom: q6v5: Avoid handling handover twiceKoakuma <[email protected]>
sparc/module: AddR_SPARC_UA64relocation handlingChen Wang <[email protected]>
PCI: cadence: Check for the existence ofcdns_pcie::opsbefore using itChunHao Lin <[email protected]>
r8169: set EEE speed down ratio to 1Brahmajit Das <[email protected]>
net: intel: fm10k: Fix parameter idx set but not usedLoic Poulain <[email protected]>
wifi: ath10k: Fix connection after GTK rekeyingShaurya Rane <[email protected]>
jfs: fix uninitialized waitqueue in transaction managerTetsuo Handa <[email protected]>
jfs: Verify inode mode when loading from diskEric Dumazet <[email protected]>
ipv6: np->rxpmtu race annotationKrishna Kurapati <[email protected]>
usb: xhci: plat: Facilitate using autosuspend for xhci plat devicesForest Crossman <[email protected]>
usb: mon: IncreaseBUFF_MAXto 64 MiB to support multi-MB URBsAl Viro <[email protected]>
allow finish_no_open(file, ERR_PTR(-E...))Justin Tee <[email protected]>
scsi: lpfc: Define size of debugfs entry for xri rebalancingNai-Chen Cheng <[email protected]>
selftests/Makefile: include $(INSTALL_DEP_TARGETS) in clean target to clean net/lib dependencyYafang Shao <[email protected]>
net/cls_cgroup: Fixtask_get_classid()during qdisc runAlok Tiwari <[email protected]>
udp_tunnel: usenetdev_warn()instead ofnetdev_WARN()David Ahern <[email protected]>
selftests: Replace sleep with slowwaitDaniel Palmer <[email protected]>
eth: 8139too: Make 8139TOO_PIO depend on !NO_IOPORT_MAPDavid Ahern <[email protected]>
selftests: Disable dad for ipv6 infcnal-test.shLi RongQing <[email protected]>
x86/kvm: Prefer native qspinlock for dedicated vCPUs irrespective ofPV_UNHALTIdo Schimmel <[email protected]>
selftests: traceroute: Userequire_command()Qianfeng Rong <[email protected]>
media: redrat3: use int type to store negative error codesNiklas Söderlund <[email protected]>
net:sh_eth: Disable WoL if system can not suspendHarikrishna Shenoy <[email protected]>
phy: cadence: cdns-dphy: Enable lower resolutions in dphyRohan G Thomas <[email protected]>
net: phy: marvell: Fix 88e1510 downshift counter errataWilliam Wu <[email protected]>
usb: gadget:f_hid: Fix zero length packet transferAshish Kalra <[email protected]>
iommu/amd: Skip enabling command/event buffers for kdumpEric Dumazet <[email protected]>
net: callcond_resched()less often in__release_sock()Cryolitia PukNgae <[email protected]>
ALSA: usb-audio: apply quirk for MOONDROP Quark2Juraj Šarinay <[email protected]>
net: nfc: nci: IncreaseNCI_DATA_TIMEOUTto 3000 msYue Haibing <[email protected]>
ipv6: Add sanity checks on ipv6_devconf.rpl_seg_enabledDevendra K Verma <[email protected]>
dmaengine: dw-edma: Set status forcallback_resultRosen Penev <[email protected]>
dmaengine:mv_xor: matchalloc_wcandfree_wcThomas Andreatta <[email protected]>
dmaengine: sh:setup_xreferror handlingQianfeng Rong <[email protected]>
scsi: pm8001: Use int instead of u32 to store error codesAleksander Jan Bajkowski <[email protected]>
mips: lantiq: xway: sysctrl: rename stp clockAleksander Jan Bajkowski <[email protected]>
mips: lantiq: danube: add missingdevice_typein pci nodeAleksander Jan Bajkowski <[email protected]>
mips: lantiq: danube: add missing properties to cpu nodeChelsy Ratnawat <[email protected]>
media: fix uninitialized symbol warningsAmber Lin <[email protected]>
drm/amdkfd: TieUNMAP_LATENCYtoqueue_preemptionKrzysztof Kozlowski <[email protected]>
extcon: adc-jack: Fix wakeup source leaks on device unbindFrancisco Gutierrez <[email protected]>
scsi: pm80xx: Fix race condition caused by static variablesUjwal Kundur <[email protected]>
rds: Fix endianness annotation forRDS_MPATH_HASHTakashi Iwai <[email protected]>
ALSA: usb-audio: Add validation of UAC2/UAC3 effect unitsSungho Kim <[email protected]>
PCI/P2PDMA: Fix incorrect pointer usage indevm_kfree()callKuniyuki Iwashima <[email protected]>
net: Calltrace_sock_exceed_buf_limit()for memcg failure withSK_MEM_RECV.Christoph Paasch <[email protected]>
net: When removing nexthops, don't callsynchronize_netif it is not necessaryZijun Hu <[email protected]>
char: misc: Does not request module for miscdevice with dynamic minorraub camaioni <[email protected]>
usb: gadget:f_ncm: Fix MAC assignment NCM ethernetRodrigo Gobbi <[email protected]>
iio: adc:spear_adc: maskSPEAR_ADC_STATUSchannel and avg sample before setting registerDmitry Baryshkov <[email protected]>
drm/bridge: display-connector: don't setOP_DETECTfor DisplayPortsTetsuo Handa <[email protected]>
media: imon: makesend_packet()more robustCharalampos Mitrodimas <[email protected]>
net: ipv6: fix field-spanning memcpy warning in AH outputIdo Schimmel <[email protected]>
bridge: Redirect to backup port when port is administratively downNiklas Schnelle <[email protected]>
powerpc/eeh: Use result oferror_detected()in ueventTiezhu Yang <[email protected]>
net: stmmac: Checkstmmac_hw_setup()instmmac_resume()Kirill A. Shutemov <[email protected]>
x86/vsyscall: Do not requireX86_PF_INSTRto emulate vsyscallTomi Valkeinen <[email protected]>
drm/tidss: Use the crtc_* timings when programming the HWLaurent Pinchart <[email protected]>
media: pci: ivtv: Don't create fakev4l2_fhGeoffrey McRae <[email protected]>
drm/amdkfd: return-ENOTTYfor unsupported IOCTLsWake Liu <[email protected]>
selftests/net: Ensureassert()triggers inpsock_tpacket.cWake Liu <[email protected]>
selftests/net: Replace non-standard__WORDSIZEwith sizeof(long) * 8Marcos Del Sol Vives <[email protected]>
PCI: Disable MSI on RDC PCI to PCIe bridgesSeyediman Seyedarab <[email protected]>
drm/nouveau: replacesnprintf()withscnprintf()innvkm_snprintbf()Sathishkumar S <[email protected]>
drm/amdgpu/jpeg: Holdpg_lockbefore jpeg poweroffLijo Lazar <[email protected]>
drm/amd/pm: Use cached metrics data on arcturusJens Kehne <[email protected]>
mfd: da9063: Split chip variant reading in two bus transactionsArnd Bergmann <[email protected]>
mfd: madera: Work around false-positive -Wininitialized warningAlexander Stein <[email protected]>
mfd: stmpe-i2c: Add missingMODULE_LICENSEAlexander Stein <[email protected]>
mfd: stmpe: Remove IRQ domain upon removalLen Brown <[email protected]>
tools/powerx86_energy_perf_policy: Prefer driver HWP limitsLen Brown <[email protected]>
tools/powerx86_energy_perf_policy: Enhance HWP enableKaushlendra Kumar <[email protected]>
tools/powerx86_energy_perf_policy: Fix incorrect fopen mode usageKaushlendra Kumar <[email protected]>
tools/cpupower: Fix incorrect size incpuidle_state_disable()Armin Wolf <[email protected]>
hwmon: (dell-smm) Add support for Dell OptiPlex 7040Jiri Olsa <[email protected]>
uprobe: Do not emulate/sstep original instruction when ip is changedDaniel Lezcano <[email protected]>
clocksource/drivers/vf-pit: Replace raw_readl/writel to readl/writelRafael J. Wysocki <[email protected]>
cpuidle: Fail cpuidle device registration if there is one alreadySvyatoslav Ryhel <[email protected]>
video: backlight:lp855x_bl: Set correct EPROM start for LP8556Daniel Wagner <[email protected]>
nvme-fc: use lock accessingport_stateand rport stateAmirreza Zarrabi <[email protected]>
tee: allow a driver to allocate atee_devicewithout a poolHans de Goede <[email protected]>
ACPICA: dispatcher: Useacpi_ds_clear_operands()inacpi_ds_call_control_method()Sarthak Garg <[email protected]>
mmc: sdhci-msm: Enable tuning for SDR50 mode for SD cardSvyatoslav Ryhel <[email protected]>
soc/tegra: fuse: Add Tegra114 nvmem cells and fuse lookupsChristian Bruel <[email protected]>
irqchip/gic-v2m: Handle Multiple MSI base IRQ AlignmentKees Cook <[email protected]>
arc: Fix__fls()const-foldability via__builtin_clzl()Dennis Beier <[email protected]>
cpufreq/longhaul: handle NULL policy inlonghaul_exitRicardo B. Marlière <[email protected]>
selftests/bpf: Fixbpf_prog_detach2usage intest_lirc_mode2Mario Limonciello (AMD) <[email protected]>
ACPI: video: force native for Lenovo 82K8Jiayi Li <[email protected]>
memstick: Add timeout to prevent indefinite waitingBiju Das <[email protected]>
mmc: host:renesas_sdhi: Fix the actual clockChi Zhang <[email protected]>
pinctrl: single: fix bias pull up/down handling inpin_config_setThomas Weißschuh <[email protected]>
bpf: Don't use %pK through printkThomas Weißschuh <[email protected]>
soc: ti: pruss: don't use %pK through printkThomas Weißschuh <[email protected]>
spi: loopback-test: Don't use %pK through printkJens Reidel <[email protected]>
soc: qcom: smem: Fix endian-unaware access ofnum_entriesDamien Le Moal <[email protected]>
block: makeREQ_OP_ZONE_OPENa write operationOwen Gu <[email protected]>
usb: gadget:f_fs: Fix epfile null pointer access after ep enable.Matthieu Baerts (NGI0) <[email protected]>
tracing: fix declaration-after-statement warningMatthieu Baerts (NGI0) <[email protected]>
arch: back to -std=gnu89 in < v5.18Alexey Dobriyan <[email protected]>
x86/boot: Compile boot code with -std=gnu11 tooBabu Moger <[email protected]>
x86/resctrl: Fix miscount of bandwidth event when reactivating previously unavailable RMIDArtem Shimko <[email protected]>
serial: 8250_dw: handle reset control deassert errorAndy Shevchenko <[email protected]>
serial: 8250_dw: Use devm_add_action_or_reset()Celeste Liu <[email protected]>
can:gs_usb: increase max interface toU8_MAXMaarten Lankhorst <[email protected]>
devcoredump: Fix circular locking dependency with devcd->mutex.Darrick J. Wong <[email protected]>
xfs: always warn about deprecated mount optionsLad Prabhakar <[email protected]>
net: ravb: Enforce descriptor type orderingEmanuele Ghidoli <[email protected]>
net: phy: dp83867: Disable EEE support as not implementedAlexey Klimov <[email protected]>
regmap: slimbus: fixbus_contextpointer in regmap init callsDamien Le Moal <[email protected]>
block: fixop_is_zone_mgmt()to handleREQ_OP_ZONE_RESET_ALLJohn Smith <[email protected]>
drm/amd/pm/powerplay/smumgr: Fix PCIeBootLinkLevel value on IcelandJohn Smith <[email protected]>
drm/amd/pm/powerplay/smumgr: Fix PCIeBootLinkLevel value on FijiYang Wang <[email protected]>
drm/amd/pm: fix smu table id bound check issue insmu_cmn_update_table()Tomeu Vizoso <[email protected]>
drm/etnaviv: fix flush sequence logicLizhi Xu <[email protected]>
usbnet: Prevents free active keventNoorain Eqbal <[email protected]>
bpf: Sync pending IRQ work before freeing ring bufferRoy Vegard Ovesen <[email protected]>
ALSA: usb-audio: fix control pipe directionAkhil P Oommen <[email protected]>
drm/msm/a6xx: Fix GMU firmware parserLoic Poulain <[email protected]>
wifi: ath10k: Fix memory leak on unsupported WMI commandSrinivas Kandagatla <[email protected]>
ASoC: qdsp6: q6asm: do not sleep while atomicMiaoqian Lin <[email protected]>
fbdev: valkyriefb: Fix reference count leak invalkyriefb_initFlorian Fuchs <[email protected]>
fbdev: pvr2fb: Fix leftover reference toONCHIP_NR_DMA_CHANNELSGokul Sivakumar <[email protected]>
wifi: brcmfmac: fix crash while sending Action Frames in standalone AP ModeJunjie Cao <[email protected]>
fbdev: bitblit: bound-check glyph index in bit_putcs*Yuhao Jiang <[email protected]>
ACPI: video: Fix use-after-free inacpi_video_switch_brightness()Daniel Palmer <[email protected]>
fbdev: atyfb: Check if pll_ops->init_pll failedMiaoqian Lin <[email protected]>
net: usb:asix_devices: Check return value ofusbnet_get_endpointsChuck Lever <[email protected]>
NFSD: Fix crash innfsd4_read_release()Filipe Manana <[email protected]>
btrfs: usesmp_mb__after_atomic()when forcing COW increate_pending_snapshot()Filipe Manana <[email protected]>
btrfs: always drop log root tree reference inbtrfs_replay_log()David Kaplan <[email protected]>
x86/bugs: Fix reporting of LFENCE retpolineXiang Mei <[email protected]>
net/sched:sch_qfq: Fix null-deref inagg_dequeue-------------
Diffstat:
.../bindings/pinctrl/toshiba,visconti-pinctrl.yaml | 26 ++-- Documentation/kbuild/makefiles.rst | 29 +++-- Makefile | 8 +- arch/arc/include/asm/bitops.h | 2 + arch/arm/crypto/Kconfig | 2 +- arch/arm/mach-at91/pm_suspend.S | 8 +- arch/mips/boot/dts/lantiq/danube.dtsi | 6 + arch/mips/lantiq/xway/sysctrl.c | 2 +- arch/mips/loongson64/Platform | 2 +- arch/mips/mm/tlb-r4k.c | 118 ++++++++++++------ arch/mips/mti-malta/malta-init.c | 20 +-- arch/parisc/boot/compressed/Makefile | 2 +- arch/powerpc/Makefile | 4 +- arch/powerpc/kernel/eeh_driver.c | 2 +- arch/riscv/kernel/cpu-hotplug.c | 1 + arch/riscv/mm/ptdump.c | 2 +- arch/s390/Makefile | 6 +- arch/s390/purgatory/Makefile | 2 +- arch/sparc/include/asm/elf_64.h | 1 + arch/sparc/kernel/module.c | 1 + arch/um/drivers/ssl.c | 5 +- arch/x86/Makefile | 2 +- arch/x86/boot/compressed/Makefile | 2 +- arch/x86/entry/vsyscall/vsyscall_64.c | 17 ++- arch/x86/events/core.c | 10 +- arch/x86/kernel/cpu/bugs.c | 5 +- arch/x86/kernel/cpu/resctrl/monitor.c | 10 +- arch/x86/kernel/kvm.c | 20 +-- drivers/acpi/acpi_video.c | 4 +- drivers/acpi/acpica/dsmethod.c | 10 +- drivers/acpi/numa/srat.c | 2 +- drivers/acpi/property.c | 24 +++- drivers/acpi/video_detect.c | 8 ++ drivers/ata/libata-scsi.c | 8 ++ drivers/atm/fore200e.c | 2 + drivers/base/devcoredump.c | 138 +++++++++++++-------- drivers/base/regmap/regmap-slimbus.c | 6 +- drivers/bluetooth/btusb.c | 13 +- drivers/bluetooth/hci_bcsp.c | 3 + drivers/char/misc.c | 8 +- drivers/clocksource/timer-vf-pit.c | 22 ++-- drivers/cpufreq/longhaul.c | 3 + drivers/cpuidle/cpuidle.c | 8 +- drivers/dma/dw-edma/dw-edma-core.c | 22 ++++ drivers/dma/mv_xor.c | 4 +- drivers/dma/sh/shdma-base.c | 25 +++- drivers/dma/sh/shdmac.c | 17 ++- drivers/edac/altera_edac.c | 22 +++- drivers/extcon/extcon-adc-jack.c | 2 + drivers/firmware/arm_scmi/scmi_pm_domain.c | 13 +- drivers/firmware/efi/libstub/Makefile | 2 +- drivers/firmware/stratix10-svc.c | 7 +- drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | 6 +- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 8 +- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 9 +- drivers/gpu/drm/amd/display/dc/calcs/Makefile | 2 +- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 11 +- drivers/gpu/drm/amd/display/dc/dcn20/Makefile | 2 +- drivers/gpu/drm/amd/display/dc/dcn21/Makefile | 2 +- drivers/gpu/drm/amd/display/dc/dcn30/Makefile | 2 +- drivers/gpu/drm/amd/display/dc/dml/Makefile | 2 +- drivers/gpu/drm/amd/display/dc/dsc/Makefile | 2 +- .../gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c | 2 +- .../drm/amd/pm/powerplay/smumgr/iceland_smumgr.c | 2 +- drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 2 +- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 2 +- drivers/gpu/drm/bridge/display-connector.c | 3 +- drivers/gpu/drm/etnaviv/etnaviv_buffer.c | 2 +- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 5 +- drivers/gpu/drm/nouveau/nvkm/core/enum.c | 2 +- drivers/gpu/drm/sti/sti_vtg.c | 7 +- drivers/gpu/drm/tegra/dc.c | 1 + drivers/gpu/drm/tidss/tidss_crtc.c | 2 +- drivers/gpu/drm/tidss/tidss_dispc.c | 16 +-- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 5 + drivers/hid/hid-ids.h | 7 +- drivers/hid/hid-ntrig.c | 7 +- drivers/hid/hid-quirks.c | 14 ++- drivers/hwmon/dell-smm-hwmon.c | 7 ++ drivers/iio/adc/spear_adc.c | 9 +- drivers/iio/common/ssp_sensors/ssp_dev.c | 4 +- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | 22 ++-- drivers/input/keyboard/cros_ec_keyb.c | 6 + drivers/input/keyboard/imx_sc_key.c | 2 +- drivers/input/misc/ati_remote2.c | 2 +- drivers/input/misc/cm109.c | 2 +- drivers/input/misc/powermate.c | 2 +- drivers/input/misc/yealink.c | 2 +- drivers/input/tablet/acecad.c | 2 +- drivers/input/tablet/pegasus_notetaker.c | 11 +- drivers/iommu/amd/init.c | 28 +++-- drivers/irqchip/irq-gic-v2m.c | 13 +- drivers/isdn/hardware/mISDN/hfcsusb.c | 18 ++- drivers/mailbox/mailbox-test.c | 2 +- drivers/md/dm-verity-fec.c | 6 +- drivers/media/i2c/ir-kbd-i2c.c | 6 +- drivers/media/pci/ivtv/ivtv-alsa-pcm.c | 2 - drivers/media/pci/ivtv/ivtv-driver.h | 3 +- drivers/media/pci/ivtv/ivtv-fileops.c | 18 +-- drivers/media/pci/ivtv/ivtv-irq.c | 4 +- drivers/media/rc/imon.c | 61 +++++---- drivers/media/rc/redrat3.c | 2 +- drivers/media/tuners/xc4000.c | 8 +- drivers/media/tuners/xc5000.c | 12 +- drivers/memstick/core/memstick.c | 8 +- drivers/mfd/da9063-i2c.c | 27 +++- drivers/mfd/madera-core.c | 4 +- drivers/mfd/stmpe-i2c.c | 1 + drivers/mfd/stmpe.c | 3 + drivers/mmc/host/renesas_sdhi_core.c | 6 +- drivers/mmc/host/sdhci-msm.c | 15 +++ drivers/most/most_usb.c | 14 +-- drivers/mtd/nand/onenand/onenand_samsung.c | 2 +- drivers/mtd/nand/raw/cadence-nand-controller.c | 3 +- drivers/net/can/sja1000/sja1000.c | 4 +- drivers/net/can/sun4i_can.c | 4 +- drivers/net/can/usb/gs_usb.c | 23 ++-- drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 4 +- drivers/net/dsa/b53/b53_common.c | 15 ++- drivers/net/dsa/b53/b53_regs.h | 3 +- .../net/ethernet/aquantia/atlantic/aq_hw_utils.c | 22 ++++ .../net/ethernet/aquantia/atlantic/aq_hw_utils.h | 1 + drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 5 + .../ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 19 +-- .../ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c | 2 +- drivers/net/ethernet/cadence/macb_main.c | 4 +- drivers/net/ethernet/emulex/benet/be_main.c | 7 +- drivers/net/ethernet/freescale/fec_main.c | 2 + drivers/net/ethernet/intel/fm10k/fm10k_common.c | 5 +- drivers/net/ethernet/intel/fm10k/fm10k_common.h | 2 +- drivers/net/ethernet/intel/fm10k/fm10k_pf.c | 2 +- drivers/net/ethernet/intel/fm10k/fm10k_vf.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c | 15 ++- .../net/ethernet/mellanox/mlxsw/spectrum_flower.c | 6 +- drivers/net/ethernet/qlogic/qede/qede_main.c | 2 +- drivers/net/ethernet/realtek/Kconfig | 2 +- drivers/net/ethernet/realtek/r8169_main.c | 6 +- drivers/net/ethernet/renesas/ravb_main.c | 16 ++- drivers/net/ethernet/renesas/sh_eth.c | 4 + drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 4 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 9 +- drivers/net/ethernet/ti/netcp_core.c | 10 +- drivers/net/phy/dp83867.c | 6 + drivers/net/phy/marvell.c | 39 +++++- drivers/net/phy/mdio_bus.c | 5 +- drivers/net/usb/asix_devices.c | 12 +- drivers/net/usb/qmi_wwan.c | 6 + drivers/net/usb/usbnet.c | 2 + drivers/net/wireless/ath/ath10k/mac.c | 12 +- drivers/net/wireless/ath/ath10k/wmi.c | 1 + .../broadcom/brcm80211/brcmfmac/cfg80211.c | 3 +- .../net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 28 ++--- .../net/wireless/broadcom/brcm80211/brcmfmac/p2p.h | 3 +- drivers/nvme/host/fc.c | 12 +- drivers/pci/controller/cadence/pcie-cadence-host.c | 2 +- drivers/pci/controller/cadence/pcie-cadence.c | 4 +- drivers/pci/controller/cadence/pcie-cadence.h | 6 +- drivers/pci/p2pdma.c | 2 +- drivers/pci/quirks.c | 1 + drivers/phy/cadence/cdns-dphy.c | 4 +- drivers/pinctrl/pinctrl-single.c | 4 +- drivers/regulator/fixed.c | 6 +- drivers/remoteproc/qcom_q6v5.c | 5 + drivers/s390/net/ctcm_mpc.c | 1 - drivers/scsi/hosts.c | 5 +- drivers/scsi/lpfc/lpfc_debugfs.h | 3 + drivers/scsi/pm8001/pm8001_ctl.c | 24 ++-- drivers/scsi/pm8001/pm8001_init.c | 1 + drivers/scsi/pm8001/pm8001_sas.c | 4 +- drivers/scsi/pm8001/pm8001_sas.h | 4 + drivers/scsi/sg.c | 10 +- drivers/slimbus/qcom-ngd-ctrl.c | 1 + drivers/soc/imx/gpc.c | 2 + drivers/soc/qcom/smem.c | 2 +- drivers/soc/tegra/fuse/fuse-tegra30.c | 122 ++++++++++++++++++ drivers/soc/ti/knav_dma.c | 14 +-- drivers/soc/ti/pruss.c | 2 +- drivers/spi/spi-bcm63xx.c | 14 +++ drivers/spi/spi-loopback-test.c | 12 +- drivers/spi/spi.c | 10 ++ drivers/target/loopback/tcm_loop.c | 3 + drivers/tee/tee_core.c | 2 +- drivers/thunderbolt/nhi.c | 2 + drivers/thunderbolt/nhi.h | 1 + drivers/tty/serial/8250/8250_dw.c | 67 +++++----- drivers/tty/serial/amba-pl011.c | 2 +- drivers/uio/uio_hv_generic.c | 21 +++- drivers/usb/cdns3/cdns3-pci-wrap.c | 5 +- drivers/usb/dwc3/ep0.c | 1 + drivers/usb/dwc3/gadget.c | 7 ++ drivers/usb/gadget/function/f_eem.c | 7 +- drivers/usb/gadget/function/f_fs.c | 8 +- drivers/usb/gadget/function/f_hid.c | 4 +- drivers/usb/gadget/function/f_ncm.c | 3 +- drivers/usb/host/xhci-dbgcap.h | 1 + drivers/usb/host/xhci-dbgtty.c | 17 ++- drivers/usb/host/xhci-plat.c | 1 + drivers/usb/mon/mon_bin.c | 14 ++- drivers/usb/renesas_usbhs/common.c | 14 +-- drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio_ids.h | 1 + drivers/usb/serial/option.c | 10 +- drivers/usb/storage/sddr55.c | 6 + drivers/usb/storage/transport.c | 16 +++ drivers/usb/storage/uas.c | 7 +- drivers/usb/storage/unusual_devs.h | 2 +- drivers/usb/typec/ucsi/psy.c | 5 + drivers/video/backlight/lp855x_bl.c | 2 +- drivers/video/fbdev/aty/atyfb_base.c | 8 +- drivers/video/fbdev/core/bitblit.c | 33 ++++- drivers/video/fbdev/pvr2fb.c | 2 +- drivers/video/fbdev/valkyriefb.c | 2 + fs/9p/v9fs.c | 9 +- fs/btrfs/disk-io.c | 2 +- fs/btrfs/file.c | 10 ++ fs/btrfs/transaction.c | 2 +- fs/btrfs/tree-log.c | 1 - fs/ceph/locks.c | 5 +- fs/cifs/connect.c | 1 + fs/dax.c | 2 +- fs/exfat/fatent.c | 11 +- fs/exfat/super.c | 5 +- fs/ext4/xattr.c | 2 +- fs/fs-writeback.c | 7 +- fs/hpfs/namei.c | 18 ++- fs/jfs/inode.c | 8 +- fs/jfs/jfs_txnmgr.c | 9 +- fs/nfs/inode.c | 6 +- fs/nfs/nfs4client.c | 1 + fs/nfs/nfs4proc.c | 7 +- fs/nfs/nfs4state.c | 3 + fs/nfsd/nfs4proc.c | 7 +- fs/nfsd/nfs4state.c | 3 +- fs/open.c | 10 +- fs/orangefs/xattr.c | 12 +- fs/overlayfs/copy_up.c | 2 +- fs/proc/generic.c | 12 +- fs/xfs/xfs_super.c | 33 +++-- include/linux/ata.h | 1 + include/linux/blk_types.h | 11 +- include/linux/compiler_types.h | 5 +- include/linux/filter.h | 2 +- include/linux/mm.h | 2 +- include/linux/shdma-base.h | 2 +- include/linux/usb.h | 16 +-- include/net/cls_cgroup.h | 2 +- include/net/nfc/nci_core.h | 2 +- include/net/pkt_sched.h | 25 +++- include/net/sctp/sctp.h | 3 +- include/net/tls.h | 6 + kernel/bpf/ringbuf.c | 2 + kernel/events/uprobes.c | 7 ++ kernel/gcov/gcc_4_7.c | 4 +- kernel/trace/trace_events_hist.c | 6 +- kernel/trace/trace_events_synth.c | 3 +- lib/crypto/Makefile | 2 +- mm/mempool.c | 32 ++++- mm/page_alloc.c | 2 +- net/8021q/vlan.c | 2 + net/bluetooth/6lowpan.c | 103 ++++++++++----- net/bluetooth/hci_event.c | 21 +++- net/bluetooth/l2cap_core.c | 1 + net/bluetooth/sco.c | 7 ++ net/bluetooth/smp.c | 31 ++--- net/bridge/br_forward.c | 3 +- net/ceph/ceph_common.c | 53 ++++---- net/ceph/debugfs.c | 16 ++- net/core/netpoll.c | 7 +- net/core/page_pool.c | 6 +- net/core/sock.c | 15 ++- net/hsr/hsr_device.c | 3 + net/ipv4/fib_frontend.c | 2 +- net/ipv4/inet_diag.c | 5 +- net/ipv4/nexthop.c | 6 + net/ipv4/raw_diag.c | 7 +- net/ipv4/route.c | 5 + net/ipv4/udp_diag.c | 6 +- net/ipv4/udp_tunnel_nic.c | 2 +- net/ipv6/addrconf.c | 4 +- net/ipv6/ah6.c | 50 +++++--- net/ipv6/raw.c | 2 +- net/ipv6/udp.c | 2 +- net/mac80211/rx.c | 10 +- net/mptcp/mptcp_diag.c | 6 +- net/mptcp/pm.c | 3 +- net/mptcp/pm_netlink.c | 20 +-- net/mptcp/protocol.c | 59 ++++++--- net/mptcp/protocol.h | 1 + net/netfilter/nf_tables_api.c | 15 +++ net/netfilter/nft_set_pipapo.c | 4 +- net/netfilter/nft_set_pipapo.h | 21 ++++ net/netfilter/nft_set_pipapo_avx2.c | 31 ++++- net/netlink/af_netlink.c | 2 +- net/openvswitch/actions.c | 68 +--------- net/openvswitch/flow_netlink.c | 64 ++-------- net/openvswitch/flow_netlink.h | 2 - net/rds/rds.h | 2 +- net/sched/act_ife.c | 12 +- net/sched/sch_api.c | 10 -- net/sched/sch_generic.c | 17 +-- net/sched/sch_hfsc.c | 16 --- net/sched/sch_qfq.c | 2 +- net/sctp/diag.c | 73 ++++++----- net/sctp/sm_make_chunk.c | 2 +- net/sctp/socket.c | 24 ++-- net/sctp/transport.c | 13 +- net/smc/smc_clc.c | 1 + net/strparser/strparser.c | 2 +- net/tipc/net.c | 2 + net/tls/tls_device.c | 4 +- net/unix/diag.c | 6 +- net/vmw_vsock/af_vsock.c | 40 ++++-- scripts/Kbuild.include | 10 +- scripts/kconfig/mconf.c | 3 + scripts/kconfig/nconf.c | 3 + sound/pci/hda/patch_realtek.c | 17 +-- sound/soc/codecs/cs4271.c | 10 +- sound/soc/codecs/max98090.c | 6 +- sound/soc/meson/aiu-encoder-i2s.c | 9 +- sound/soc/qcom/qdsp6/q6asm.c | 2 +- sound/usb/endpoint.c | 5 + sound/usb/mixer.c | 11 +- sound/usb/mixer_s1810c.c | 28 ++++- sound/usb/validate.c | 9 +- tools/include/linux/bitmap.h | 1 + tools/power/cpupower/lib/cpuidle.c | 5 +- .../x86_energy_perf_policy.c | 30 +++-- tools/testing/selftests/Makefile | 2 +- tools/testing/selftests/bpf/test_lirc_mode2_user.c | 2 +- tools/testing/selftests/net/fcnal-test.sh | 4 +- tools/testing/selftests/net/psock_tpacket.c | 4 +- tools/testing/selftests/net/traceroute.sh | 13 +- 332 files changed, 2243 insertions(+), 1164 deletions(-)
Signature · 2 lines
In cooperation with DENX Software Engineering GmbH, HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.247 release. There are 300 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 Fri, 05 Dec 2025 15:23:16 +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/v5.x/stable-review/patch-5.10.247-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.10.y
and the diffstat can be found below.thanks,
greg k-h
MIPS fails to build with:
arch/mips/mm/tlb-r4k.c: In function 'r4k_tlb_uniquify':arch/mips/mm/tlb-r4k.c:591:17: error: passing argument 1 of 'memblock_free' makes integer from pointer without a cast [-Werror=int-conversion]
memblock_free(tlb_vpns, tlb_vpn_size);
^~~~~~~~
In file included from arch/mips/mm/tlb-r4k.c:15:
./include/linux/memblock.h:107:31: note: expected 'phys_addr_t' {aka 'unsigned int'} but argument is of type 'long unsigned int *'
int memblock_free(phys_addr_t base, phys_addr_t size);
~~~~~~~~~~~~^~~~cc1: all warnings being treated as errors
host-make[4]: *** [scripts/Makefile.build:286: arch/mips/mm/tlb-r4k.o] Error 1 host-make[4]: *** Waiting for unfinished jobs....
Caused by:
commit 97ddb0e2389b4a53d395ed47ea83540ff495d1b6
Author: Thomas Bogendoerfer <[email protected]> Date: Fri Nov 28 16:53:46 2025 +0000
MIPS: mm: kmalloc tlb_vpn array to avoid stack overflow
It seems like we might have to cast to a phys_addr_t before passing that to memblock_free().
Signature · 1 line
Florian
Jon Hunter
maintainerQuoted 20 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.247 release. There are 300 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 Fri, 05 Dec 2025 15:23:16 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.247-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.10.y
and the diffstat can be found below.thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
...
Quoted 5 lines
Vlastimil Babka <[email protected]>
mm/mempool: fix poisoning order>0 pages with HIGHMEMFabio M. De Francesco <[email protected]>
mm/mempool: replacekmap_atomic()withkmap_local_page()
The above two commits are causing the following build errors and I needed to revert both ...
mm/mempool.c: In function ‘check_element’:mm/mempool.c:68:17: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
68 | for (int i = 0; i < (1 << order); i++) {
| ^~~
mm/mempool.c:68:17: note: use option ‘-std=c99’, ‘-std=gnu99’, ‘-std=c11’ or ‘-std=gnu11’ to compile your code
CC fs/open.o
mm/mempool.c:70:38: error: implicit declaration of function ‘kmap_local_page’; did you mean ‘kmap_to_page’? [-Werror=implicit-function-declaration]
70 | void *addr = kmap_local_page(page + i);
| ^~~~~~~~~~~~~~~
| kmap_to_page
mm/mempool.c:70:38: warning: initialisation of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
mm/mempool.c:73:25: error: implicit declaration of function ‘kunmap_local’ [-Werror=implicit-function-declaration]
73 | kunmap_local(addr);
| ^~~~~~~~~~~~
mm/mempool.c: In function ‘poison_element’:
mm/mempool.c:101:17: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
101 | for (int i = 0; i < (1 << order); i++) {
| ^~~
mm/mempool.c:103:38: warning: initialisation of ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
103 | void *addr = kmap_local_page(page + i);
| ^~~~~~~~~~~~~~~ CC arch/arm/mach-tegra/pm-tegra20.o
Cheers,
Jon
Signature · 1 line
nvpublic
Greg Kroah-Hartman wrote on Wed, Dec 03, 2025 at 04:23:24PM +0100:
Quoted 5 lines
This is the start of the stable review cycle for the 5.10.247 release. There are 300 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.
Quoted 8 lines
Responses should be made by Fri, 05 Dec 2025 15:23:16 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.247-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.10.y
and the diffstat can be found below.
Tested d50f2a03a87b ("Linux 5.10.247-rc1") on:
- arm i.MX6ULL (Armadillo 640)
- arm64 i.MX8MP (Armadillo G4)
No obvious regression in dmesg or basic tests:
Signature · 1 line
Dominique Martinet
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.247 release. There are 300 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 Fri, 05 Dec 2025 15:23:16 +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/v5.x/stable-review/patch-5.10.247-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.10.y
and the diffstat can be found below.thanks,
greg k-h
The arm, mips and powerpc builds failed on the stable-rc 5.10.247-rc1
Build regressions: arm, fuse-tegra30.c:250:10: error: 'const struct tegra_fuse_soc' has no member named 'cells'
Build regressions: arm, fuse-tegra30.c:250:18: error: initialization of 'const struct attribute_group *' from incompatible pointer type 'const struct nvmem_cell_info *' [-Werror=incompatible-pointer-types] Build regressions: arm, fuse-tegra30.c:251:10: error: 'const struct tegra_fuse_soc' has no member named 'num_cells'
Build regressions: mips, mips/mm/tlb-r4k.c:591:31: error: passing argument 1 of 'memblock_free' makes integer from pointer without a cast [-Werror=int-conversion]
Build regressions: powerpc, mm/mempool.c:68:17: error: 'for' loop initial declarations are only allowed in C99 or C11 mode Build regressions: powerpc, mm/mempool.c:70:38: error: implicit declaration of function 'kmap_local_page'; did you mean 'kmap_to_page'? [-Werror=implicit-function-declaration] Build regressions: powerpc, mm/mempool.c:73:25: error: implicit declaration of function 'kunmap_local' [-Werror=implicit-function-declaration]
Build regressions: powerpc, mm/mempool.c:101:17: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
Arm build regressions are due to,
soc/tegra: fuse: Add Tegra114 nvmem cells and fuse lookups [ Upstream commit b9c01adedf38c69abb725a60a05305ef70dbce03 ]
MIPS build regressions are due to,
MIPS: mm: kmalloc tlb_vpn array to avoid stack overflow commit 841ecc979b18d3227fad5e2d6a1e6f92688776b5 upstream.
Powerpc build regressions are due to,
mm/mempool: replace kmap_atomic() with kmap_local_page() [ Upstream commit f2bcc99a5e901a13b754648d1dbab60f4adf9375 ]
### arm build error drivers/soc/tegra/fuse/fuse-tegra30.c:250:10: error: 'const struct tegra_fuse_soc' has no member named 'cells'
250 | .cells = tegra114_fuse_cells,
| ^~~~~
drivers/soc/tegra/fuse/fuse-tegra30.c:250:18: error: initialization of 'const struct attribute_group *' from incompatible pointer type 'const struct nvmem_cell_info *' [-Werror=incompatible-pointer-types]
250 | .cells = tegra114_fuse_cells,
| ^~~~~~~~~~~~~~~~~~~
drivers/soc/tegra/fuse/fuse-tegra30.c:250:18: note: (near initialization for 'tegra114_fuse_soc.soc_attr_group') drivers/soc/tegra/fuse/fuse-tegra30.c:251:10: error: 'const struct tegra_fuse_soc' has no member named 'num_cells'
251 | .num_cells = ARRAY_SIZE(tegra114_fuse_cells),
| ^~~~~~~~~
### mips Build errorarch/mips/mm/tlb-r4k.c: In function 'r4k_tlb_uniquify':arch/mips/mm/tlb-r4k.c:591:31: error: passing argument 1 of 'memblock_free' makes integer from pointer without a cast [-Werror=int-conversion]
591 | memblock_free(tlb_vpns, tlb_vpn_size);
| ^~~~~~~~
| |
| long unsigned int *
In file included from arch/mips/mm/tlb-r4k.c:15:
include/linux/memblock.h:106:31: note: expected 'phys_addr_t' {aka
'unsigned int'} but argument is of type 'long unsigned int *'
106 | int memblock_free(phys_addr_t base, phys_addr_t size);
| ~~~~~~~~~~~~^~~~cc1: all warnings being treated as errors
### powerpc build errorbuilds/linux/mm/mempool.c: In function 'check_element':mm/mempool.c:68:17: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
68 | for (int i = 0; i < (1 << order); i++) {
| ^~~mm/mempool.c:68:17: note: use option '-std=c99', '-std=gnu99', '-std=c11' or '-std=gnu11' to compile your code mm/mempool.c:70:38: error: implicit declaration of function 'kmap_local_page'; did you mean 'kmap_to_page'? [-Werror=implicit-function-declaration]
70 | void *addr = kmap_local_page(page + i);
| ^~~~~~~~~~~~~~~
| kmap_to_pagemm/mempool.c:70:38: warning: initialization of 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion] mm/mempool.c:73:25: error: implicit declaration of function 'kunmap_local' [-Werror=implicit-function-declaration]
73 | kunmap_local(addr);
| ^~~~~~~~~~~~
mm/mempool.c: In function 'poison_element':
mm/mempool.c:101:17: error: 'for' loop initial declarations are only
allowed in C99 or C11 mode
101 | for (int i = 0; i < (1 << order); i++) {
| ^~~
mm/mempool.c:103:38: warning: initialization of 'void *' from 'int'
makes pointer from integer without a cast [-Wint-conversion]
103 | void *addr = kmap_local_page(page + i);
| ^~~~~~~~~~~~~~~cc1: some warnings being treated as errors
## Build
* kernel: 5.10.247-rc1
* git: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
* git commit: d50f2a03a87b402853207713f5e83c7f07c7ddab
* git describe: v5.10.246-301-gd50f2a03a87b
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.10.y/build/v5.10.246-301-gd50f2a03a87b
## Test Regressions (compared to v5.10.245-326-g98417fb6195f)
* arm, build
- clang-21-defconfig
- clang-21-lkftconfig
- clang-21-lkftconfig-no-kselftest-frag
- gcc-12-defconfig
- gcc-12-lkftconfig
- gcc-12-lkftconfig-debug
- gcc-12-lkftconfig-kasan
- gcc-12-lkftconfig-kunit
- gcc-12-lkftconfig-libgpiod
- gcc-12-lkftconfig-no-kselftest-frag
- gcc-12-lkftconfig-perf
- gcc-12-lkftconfig-rcutorture
- gcc-8-defconfig
* mips, build
- clang-21-allnoconfig
- clang-21-defconfig
- clang-21-tinyconfig
- gcc-12-allnoconfig
- gcc-12-ath79_defconfig
- gcc-12-bcm47xx_defconfig
- gcc-12-bcm63xx_defconfig
- gcc-12-cavium_octeon_defconfig
- gcc-12-defconfig
- gcc-12-e55_defconfig
- gcc-12-malta_defconfig
- gcc-12-rt305x_defconfig
- gcc-12-tinyconfig
- gcc-8-allnoconfig
- gcc-8-ath79_defconfig
- gcc-8-bcm47xx_defconfig
- gcc-8-bcm63xx_defconfig
- gcc-8-cavium_octeon_defconfig
- gcc-8-defconfig
- gcc-8-malta_defconfig
- gcc-8-rt305x_defconfig
- gcc-8-tinyconfig
* powerpc, build
- gcc-12-ppc6xx_defconfig
- gcc-8-ppc6xx_defconfig
## Metric Regressions (compared to v5.10.245-326-g98417fb6195f)
## Test Fixes (compared to v5.10.245-326-g98417fb6195f)
## Metric Fixes (compared to v5.10.245-326-g98417fb6195f)
## Test result summary
total: 28943, pass: 21942, fail: 2265, skip: 4545, xfail: 191
## Build Summary
* arc: 5 total, 5 passed, 0 failed
* arm: 100 total, 86 passed, 14 failed
* arm64: 28 total, 28 passed, 0 failed
* i386: 20 total, 20 passed, 0 failed
* mips: 22 total, 0 passed, 22 failed
* parisc: 3 total, 0 passed, 3 failed
* powerpc: 21 total, 19 passed, 2 failed
* riscv: 9 total, 9 passed, 0 failed
* s390: 9 total, 9 passed, 0 failed
* sh: 10 total, 10 passed, 0 failed
* sparc: 6 total, 6 passed, 0 failed
* x86_64: 24 total, 24 passed, 0 failed
## Test suites summary
* boot
* kselftest-arm64
* kselftest-breakpoints
* kselftest-capabilities
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-exec
* kselftest-fpu
* kselftest-futex
* kselftest-intel_pstate
* kselftest-kcmp
* kselftest-livepatch
* kselftest-membarrier
* kselftest-mincore
* kselftest-mqueue
* kselftest-openat2
* kselftest-ptrace
* kselftest-rseq
* kselftest-rtc
* kselftest-sigaltstack
* kselftest-size
* kselftest-timers
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user_events
* kselftest-vDSO
* kselftest-x86
* kunit
* lava
* libgpiod
* libhugetlbfs
* log-parser-boot
* log-parser-build-clang
* log-parser-build-gcc
* log-parser-test
* ltp-capability
* ltp-commands
* ltp-containers
* ltp-controllers
* ltp-cpuhotplug
* ltp-crypto
* ltp-cve
* ltp-dio
* ltp-fcntl-locktests
* ltp-fs
* ltp-fs_bind
* ltp-fs_perms_simple
* ltp-hugetlb
* ltp-math
* ltp-mm
* ltp-nptl
* ltp-pty
* ltp-sched
* ltp-smoke
* ltp-syscalls
* ltp-tracing
* perf
* rcutorture
--
Linaro LKFT
https://lkft.linaro.org
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.247 release. There are 300 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.