5.10.221-rc1 review
Subsystems (5)
Greg Kroah-Hartman
maintainerPATCH 1/290 tracing/selftests: Fix kprobe event name test for .isra. functions
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steven Rostedt (Google) <[email protected]>
commit 23a4b108accc29a6125ed14de4a044689ffeda78 upstream.
The kprobe_eventname.tc test checks if a function with .isra. can have a kprobe attached to it. It loops through the kallsyms file for all the functions that have the .isra. name, and checks if it exists in the available_filter_functions file, and if it does, it uses it to attach a kprobe to it.
The issue is that kprobes can not attach to functions that are listed more than once in available_filter_functions. With the latest kernel, the function that is found is: rapl_event_update.isra.0
# grep rapl_event_update.isra.0 /sys/kernel/tracing/available_filter_functions rapl_event_update.isra.0 rapl_event_update.isra.0
It is listed twice. This causes the attached kprobe to it to fail which in turn fails the test. Instead of just picking the function function that is found in available_filter_functions, pick the first one that is listed only once in available_filter_functions.
--- tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc +2 -1
@@ -30,7 +30,8 @@ find_dot_func() { fi grep " [tT] .*\.isra\..*" /proc/kallsyms | cut -f 3 -d " " | while read f; do - if grep -s $f available_filter_functions; then + cnt=`grep -s $f available_filter_functions | wc -l`; + if [ $cnt -eq 1 ]; then echo $f break fi
Greg Kroah-Hartman
maintainerPATCH 10/290 wifi: mac80211: correctly parse Spatial Reuse Parameter Set element
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lingbo Kong <[email protected]>
[ Upstream commit a26d8dc5227f449a54518a8b40733a54c6600a8b ]
Currently, the way of parsing Spatial Reuse Parameter Set element is incorrect and some members of struct ieee80211_he_obss_pd are not assigned.
To address this issue, it must be parsed in the order of the elements of Spatial Reuse Parameter Set defined in the IEEE Std 802.11ax specification.
The diagram of the Spatial Reuse Parameter Set element (IEEE Std 802.11ax -2021-9.4.2.252).
-------------------------------------------------------------------------
| | | | |Non-SRG| SRG | SRG | SRG | SRG | |Element|Length| Element | SR |OBSS PD|OBSS PD|OBSS PD| BSS |Partial| | ID | | ID |Control| Max | Min | Max |Color | BSSID | | | |Extension| | Offset| Offset|Offset |Bitmap|Bitmap |
-------------------------------------------------------------------------
--- net/mac80211/he.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
net/mac80211/he.c +8 -2
@@ -127,15 +127,21 @@ ieee80211_he_spr_ie_to_bss_conf(struct ieee80211_vif *vif,if (!he_spr_ie_elem)return ; + + he_obss_pd->sr_ctrl = he_spr_ie_elem->he_sr_control; data = he_spr_ie_elem->optional;if (he_spr_ie_elem->he_sr_control &IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT ) - data++; + he_obss_pd->non_srg_max_offset = *data++; +if (he_spr_ie_elem->he_sr_control &IEEE80211_HE_SPR_SRG_INFORMATION_PRESENT ) { - he_obss_pd->max_offset = *data++; he_obss_pd->min_offset = *data++; + he_obss_pd->max_offset = *data++; +memcpy (he_obss_pd->bss_color_bitmap, data,8 ); + data +=8 ; +memcpy (he_obss_pd->partial_bssid_bitmap, data,8 ); he_obss_pd->enable = true; } }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 11/290 net/ncsi: add NCSI Intel OEM command to keep PHY up
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ivan Mikhaylov <[email protected]>
[ Upstream commit abd2fddc94a619b96bf41c60429d4c32bd118e17 ]
This allows to keep PHY link up and prevents any channel resets during the host load.
It is KEEP_PHY_LINK_UP option(Veto bit) in i210 datasheet which block PHY reset and power state changes.
Stable-dep-of: e85e271dec02 ("net/ncsi: Fix the multi thread manner of NCSI driver")
--- net/ncsi/Kconfig | 6 ++++++ net/ncsi/internal.h | 5 +++++ net/ncsi/ncsi-manage.c | 45 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+)
net/ncsi/Kconfig +6 -0
@@ -17,3 +17,9 @@ config NCSI_OEM_CMD_GET_MAC help This allows to get MAC address from NCSI firmware and set them back to controller. +config NCSI_OEM_CMD_KEEP_PHY + bool "Keep PHY Link up" + depends on NET_NCSI + help + This allows to keep PHY link up and prevents any channel resets during + the host load.
net/ncsi/internal.h +5 -0
@@ -78,6 +78,9 @@ enum {/* OEM Vendor Manufacture ID */ #define NCSI_OEM_MFR_MLX_ID 0x8119#define NCSI_OEM_MFR_BCM_ID 0x113d +#define NCSI_OEM_MFR_INTEL_ID 0x157 +/* Intel specific OEM command */ +#define NCSI_OEM_INTEL_CMD_KEEP_PHY 0x20/* CMD ID for Keep PHY up */ /* Broadcom specific OEM Command */ #define NCSI_OEM_BCM_CMD_GMA 0x01/* CMD ID for Get MAC */ /* Mellanox specific OEM Command */
@@ -86,6 +89,7 @@ enum {#define NCSI_OEM_MLX_CMD_SMAF 0x01/* CMD ID for Set MC Affinity */ #define NCSI_OEM_MLX_CMD_SMAF_PARAM 0x07/* Parameter for SMAF */ /* OEM Command payload lengths*/ +#define NCSI_OEM_INTEL_CMD_KEEP_PHY_LEN 7#define NCSI_OEM_BCM_CMD_GMA_LEN 12#define NCSI_OEM_MLX_CMD_GMA_LEN 8#define NCSI_OEM_MLX_CMD_SMAF_LEN 60
@@ -274,6 +278,7 @@ enum { ncsi_dev_state_probe_mlx_gma, ncsi_dev_state_probe_mlx_smaf, ncsi_dev_state_probe_cis, + ncsi_dev_state_probe_keep_phy, ncsi_dev_state_probe_gvi, ncsi_dev_state_probe_gc, ncsi_dev_state_probe_gls,
net/ncsi/ncsi-manage.c +45 -0
59 lines not on this page · raw message
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 12/290 net/ncsi: Simplify Kconfig/dts control flow
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Delevoryas <[email protected]>
[ Upstream commit c797ce168930ce3d62a9b7fc4d7040963ee6a01e ]
Background:
1. CONFIG_NCSI_OEM_CMD_KEEP_PHY
If this is enabled, we send an extra OEM Intel command in the probe sequence immediately after discovering a channel (e.g. after "Clear Initial State").
2. CONFIG_NCSI_OEM_CMD_GET_MAC
If this is enabled, we send one of 3 OEM "Get MAC Address" commands from Broadcom, Mellanox (Nvidida), and Intel in the *configuration* sequence for a channel.
3. mellanox,multi-host (or mlx,multi-host)
Introduced by this patch:
https://lore.kernel.org/all/[email protected]/
Which was actually originally from [email protected]:
https://github.com/facebook/openbmc-linux/commit/9f132a10ec48db84613519258cd8a317fb9c8f1b
Cosmo claimed that the Nvidia ConnectX-4 and ConnectX-6 NIC's don't respond to Get Version ID, et. al in the probe sequence unless you send the Set MC Affinity command first.
Problem Statement:
We've been using a combination of #ifdef code blocks and IS_ENABLED() conditions to conditionally send these OEM commands.
It makes adding any new code around these commands hard to understand.
Solution:
In this patch, I just want to remove the conditionally compiled blocks of code, and always use IS_ENABLED(...) to do dynamic control flow.
I don't think the small amount of code this adds to non-users of the OEM Kconfigs is a big deal.
Stable-dep-of: e85e271dec02 ("net/ncsi: Fix the multi thread manner of NCSI driver")
--- net/ncsi/ncsi-manage.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-)
net/ncsi/ncsi-manage.c +3 -17
@@ -689,8 +689,6 @@ static int set_one_vid(struct ncsi_dev_priv *ndp, struct ncsi_channel *nc,return 0 ; } -#if IS_ENABLED (CONFIG_NCSI_OEM_CMD_KEEP_PHY ) -static int ncsi_oem_keep_phy_intel (struct ncsi_cmd_arg *nca) {unsigned char data[NCSI_OEM_INTEL_CMD_KEEP_PHY_LEN ];
@@ -716,10 +714,6 @@ static int ncsi_oem_keep_phy_intel(struct ncsi_cmd_arg *nca)return ret; } -#endif - -#if IS_ENABLED (CONFIG_NCSI_OEM_CMD_GET_MAC ) -/* NCSI OEM Command APIs */ static int ncsi_oem_gma_handler_bcm (struct ncsi_cmd_arg *nca) {
@@ -833,8 +827,6 @@ static int ncsi_gma_handler(struct ncsi_cmd_arg *nca, unsigned int mf_id)return nch->handler (nca); } -#endif /* CONFIG_NCSI_OEM_CMD_GET_MAC */ -/* Determine if a given channel from the channel_queue should be used for Tx */ static bool ncsi_channel_is_tx (struct ncsi_dev_priv *ndp,struct ncsi_channel *nc)
@@ -1016,20 +1008,18 @@ static void ncsi_configure_channel(struct ncsi_dev_priv *ndp) goto error; } - nd->state = ncsi_dev_state_config_oem_gma; + nd->state =IS_ENABLED (CONFIG_NCSI_OEM_CMD_GET_MAC ) + ? ncsi_dev_state_config_oem_gma + : ncsi_dev_state_config_clear_vids;break ;case ncsi_dev_state_config_oem_gma: nd->state = ncsi_dev_state_config_clear_vids; - ret =-1 ; -#if IS_ENABLED (CONFIG_NCSI_OEM_CMD_GET_MAC ) nca.type =NCSI_PKT_CMD_OEM ; nca.package = np->id; nca.channel = nc->id; ndp->pending_req_num =1 ; ret =ncsi_gma_handler (&nca, nc->version.mf_id); -#endif /* CONFIG_NCSI_OEM_CMD_GET_MAC */ -if (ret <0 )schedule_work (&ndp->work);
@@ -1381,7 +1371,6 @@ static void ncsi_probe_channel(struct ncsi_dev_priv *ndp)schedule_work (&ndp->work);break ; -#if IS_ENABLED (CONFIG_NCSI_OEM_CMD_GET_MAC )case ncsi_dev_state_probe_mlx_gma: ndp->pending_req_num =1 ;
@@ -1406,7 +1395,6 @@ static void ncsi_probe_channel(struct ncsi_dev_priv *ndp) nd->state = ncsi_dev_state_probe_cis;break ; -#endif /* CONFIG_NCSI_OEM_CMD_GET_MAC */ case ncsi_dev_state_probe_cis: ndp->pending_req_num =NCSI_RESERVED_CHANNEL ;
@@ -1424,7 +1412,6 @@ static void ncsi_probe_channel(struct ncsi_dev_priv *ndp)if (IS_ENABLED (CONFIG_NCSI_OEM_CMD_KEEP_PHY )) nd->state = ncsi_dev_state_probe_keep_phy;break ; -#if IS_ENABLED (CONFIG_NCSI_OEM_CMD_KEEP_PHY )case ncsi_dev_state_probe_keep_phy: ndp->pending_req_num =1 ;
@@ -1437,7 +1424,6 @@ static void ncsi_probe_channel(struct ncsi_dev_priv *ndp) nd->state = ncsi_dev_state_probe_gvi;break ; -#endif /* CONFIG_NCSI_OEM_CMD_KEEP_PHY */ case ncsi_dev_state_probe_gvi:case ncsi_dev_state_probe_gc:case ncsi_dev_state_probe_gls:
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 13/290 net/ncsi: Fix the multi thread manner of NCSI driver
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: DelphineCCChiu <[email protected]>
[ Upstream commit e85e271dec0270982afed84f70dc37703fcc1d52 ]
Currently NCSI driver will send several NCSI commands back to back without waiting the response of previous NCSI command or timeout in some state when NIC have multi channel. This operation against the single thread manner defined by NCSI SPEC(section 6.3.2.3 in DSP0222_1.1.1)
According to NCSI SPEC(section 6.2.13.1 in DSP0222_1.1.1), we should probe one channel at a time by sending NCSI commands (Clear initial state, Get version ID, Get capabilities...), than repeat this steps until the max number of channels which we got from NCSI command (Get capabilities) has been probed.
--- net/ncsi/internal.h | 2 ++ net/ncsi/ncsi-manage.c | 73 +++++++++++++++++++++--------------------- net/ncsi/ncsi-rsp.c | 4 ++- 3 files changed, 41 insertions(+), 38 deletions(-)
net/ncsi/internal.h +2 -0
@@ -322,6 +322,7 @@ struct ncsi_dev_priv {spinlock_t lock;/* Protect the NCSI device */ unsigned int package_probe_id;/* Current ID during probe */ unsigned int package_num;/* Number of packages */ +unsigned int channel_probe_id;/* Current cahnnel ID during probe */ struct list_head packages;/* List of packages */ struct ncsi_channel *hot_channel;/* Channel was ever active */ struct ncsi_request requests[256 ];/* Request table */
@@ -340,6 +341,7 @@ struct ncsi_dev_priv {bool multi_package;/* Enable multiple packages */ bool mlx_multi_host;/* Enable multi host Mellanox */ u32 package_whitelist;/* Packages to configure */ +unsigned char channel_count;/* Num of channels to probe */ };struct ncsi_cmd_arg {
net/ncsi/ncsi-manage.c +36 -37
128 lines not on this page · raw message
net/ncsi/ncsi-rsp.c +3 -1
@@ -795,12 +795,13 @@ static int ncsi_rsp_handler_gc(struct ncsi_request *nr)struct ncsi_rsp_gc_pkt *rsp;struct ncsi_dev_priv *ndp = nr->ndp;struct ncsi_channel *nc; +struct ncsi_package *np;size_t size;/* Find the channel */ rsp = (struct ncsi_rsp_gc_pkt *)skb_network_header (nr->rsp);ncsi_find_package_and_channel (ndp, rsp->rsp.common.channel, -NULL , &nc); + &np, &nc);if (!nc)return -ENODEV ;
@@ -835,6 +836,7 @@ static int ncsi_rsp_handler_gc(struct ncsi_request *nr)*/ nc->vlan_filter.bitmap =U64_MAX ; nc->vlan_filter.n_vids = rsp->vlan_cnt; + np->ndp->channel_count = rsp->channel_cnt;return 0 ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 14/290 ipv6: sr: block BH in seg6_output_core() and seg6_input_core()
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 c0b98ac1cc104f48763cdb27b1e9ac25fd81fc90 ]
As explained in commit 1378817486d6 ("tipc: block BH before using dst_cache"), net/core/dst_cache.c helpers need to be called with BH disabled.
Disabling preemption in seg6_output_core() is not good enough, because seg6_output_core() is called from process context, lwtunnel_output() only uses rcu_read_lock().
We might be interrupted by a softirq, re-enter seg6_output_core() and corrupt dst_cache data structures.
Fix the race by using local_bh_disable() instead of preempt_disable().
Apply a similar change in seg6_input_core().
--- net/ipv6/seg6_iptunnel.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
net/ipv6/seg6_iptunnel.c +6 -8
@@ -325,9 +325,8 @@ static int seg6_input(struct sk_buff *skb) slwt =seg6_lwt_lwtunnel (orig_dst->lwtstate); -preempt_disable (); +local_bh_disable (); dst =dst_cache_get (&slwt->cache); -preempt_enable ();skb_dst_drop (skb);
@@ -335,14 +334,13 @@ static int seg6_input(struct sk_buff *skb)ip6_route_input (skb); dst =skb_dst (skb);if (!dst->error) { -preempt_disable ();dst_cache_set_ip6 (&slwt->cache, dst, &ipv6_hdr (skb)->saddr); -preempt_enable (); } }else {skb_dst_set (skb, dst); } +local_bh_enable (); err =skb_cow_head (skb,LL_RESERVED_SPACE (dst->dev));if (unlikely (err))
@@ -364,9 +362,9 @@ static int seg6_output(struct net *net, struct sock *sk, struct sk_buff *skb) slwt =seg6_lwt_lwtunnel (orig_dst->lwtstate); -preempt_disable (); +local_bh_disable (); dst =dst_cache_get (&slwt->cache); -preempt_enable (); +local_bh_enable ();if (unlikely (!dst)) {struct ipv6hdr *hdr =ipv6_hdr (skb);
@@ -386,9 +384,9 @@ static int seg6_output(struct net *net, struct sock *sk, struct sk_buff *skb) goto drop; } -preempt_disable (); +local_bh_disable ();dst_cache_set_ip6 (&slwt->cache, dst, &fl6.saddr); -preempt_enable (); +local_bh_enable (); }skb_dst_drop (skb);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 15/290 net: sched: sch_multiq: fix possible OOB write in multiq_tune()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hangyu Hua <[email protected]>
[ Upstream commit affc18fdc694190ca7575b9a86632a73b9fe043d ]
q->bands will be assigned to qopt->bands to execute subsequent code logic after kmalloc. So the old q->bands should not be used in kmalloc. Otherwise, an out-of-bounds write will occur.
--- net/sched/sch_multiq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sched/sch_multiq.c +1 -1
@@ -185,7 +185,7 @@ static int multiq_tune(struct Qdisc *sch, struct nlattr *opt, qopt->bands =qdisc_dev (sch)->real_num_tx_queues; - removed =kmalloc (sizeof (*removed) * (q->max_bands - q->bands), + removed =kmalloc (sizeof (*removed) * (q->max_bands - qopt->bands),GFP_KERNEL );if (!removed)return -ENOMEM ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 16/290 vxlan: Fix regression when dropping packets due to invalid src addresses
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <[email protected]>
[ Upstream commit 1cd4bc987abb2823836cbb8f887026011ccddc8a ]
Commit f58f45c1e5b9 ("vxlan: drop packets from invalid src-address") has recently been added to vxlan mainly in the context of source address snooping/learning so that when it is enabled, an entry in the FDB is not being created for an invalid address for the corresponding tunnel endpoint.
Before commit f58f45c1e5b9 vxlan was similarly behaving as geneve in that it passed through whichever macs were set in the L2 header. It turns out that this change in behavior breaks setups, for example, Cilium with netkit in L3 mode for Pods as well as tunnel mode has been passing before the change in f58f45c1e5b9 for both vxlan and geneve. After mentioned change it is only passing for geneve as in case of vxlan packets are dropped due to vxlan_set_mac() returning false as source and destination macs are zero which for E/W traffic via tunnel is totally fine.
Fix it by only opting into the is_valid_ether_addr() check in vxlan_set_mac() when in fact source address snooping/learning is actually enabled in vxlan. This is done by moving the check into vxlan_snoop(). With this change, the Cilium connectivity test suite passes again for both tunnel flavors.
--- drivers/net/vxlan/vxlan_core.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/vxlan/vxlan_core.c +4 -0
@@ -1492,6 +1492,10 @@ static bool vxlan_snoop(struct net_device *dev,struct vxlan_fdb *f;u32 ifindex =0 ; +/* Ignore packets from invalid src-address */ +if (!is_valid_ether_addr (src_mac)) +return true; +#if IS_ENABLED (CONFIG_IPV6 )if (src_ip->sa.sa_family ==AF_INET6 && (ipv6_addr_type (&src_ip->sin6.sin6_addr) &IPV6_ADDR_LINKLOCAL ))
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 17/290 tcp: count CLOSE-WAIT sockets for TCP_MIB_CURRESTAB
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason Xing <[email protected]>
[ Upstream commit a46d0ea5c94205f40ecf912d1bb7806a8a64704f ]
According to RFC 1213, we should also take CLOSE-WAIT sockets into consideration:
"tcpCurrEstab OBJECT-TYPE
...
The number of TCP connections for which the current state is either ESTABLISHED or CLOSE- WAIT."
After this, CurrEstab counter will display the total number of ESTABLISHED and CLOSE-WAIT sockets.
The logic of counting
When we increment the counter?
a) if we change the state to ESTABLISHED.
b) if we change the state from SYN-RECEIVED to CLOSE-WAIT.
When we decrement the counter?
a) if the socket leaves ESTABLISHED and will never go into CLOSE-WAIT, say, on the client side, changing from ESTABLISHED to FIN-WAIT-1.
b) if the socket leaves CLOSE-WAIT, say, on the server side, changing from CLOSE-WAIT to LAST-ACK.
Please note: there are two chances that old state of socket can be changed to CLOSE-WAIT in tcp_fin(). One is SYN-RECV, the other is ESTABLISHED. So we have to take care of the former case.
--- net/ipv4/tcp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
net/ipv4/tcp.c +5 -1
@@ -2420,6 +2420,10 @@ void tcp_set_state(struct sock *sk, int state)if (oldstate !=TCP_ESTABLISHED )TCP_INC_STATS (sock_net (sk),TCP_MIB_CURRESTAB );break ; +case TCP_CLOSE_WAIT : +if (oldstate ==TCP_SYN_RECV ) +TCP_INC_STATS (sock_net (sk),TCP_MIB_CURRESTAB ); +break ;case TCP_CLOSE :if (oldstate ==TCP_CLOSE_WAIT || oldstate ==TCP_ESTABLISHED )
@@ -2431,7 +2435,7 @@ void tcp_set_state(struct sock *sk, int state)inet_put_port (sk); fallthrough;default : -if (oldstate ==TCP_ESTABLISHED ) +if (oldstate ==TCP_ESTABLISHED || oldstate ==TCP_CLOSE_WAIT )TCP_DEC_STATS (sock_net (sk),TCP_MIB_CURRESTAB ); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 2/290 null_blk: Print correct max open zones limit in null_init_zoned_dev()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Damien Le Moal <[email protected]>
commit 233e27b4d21c3e44eb863f03e566d3a22e81a7ae upstream.
When changing the maximum number of open zones, print that number instead of the total number of zones.
--- drivers/block/null_blk/zoned.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/null_blk/zoned.c +1 -1
@@ -81,7 +81,7 @@ int null_init_zoned_dev(struct nullb_devif (dev->zone_max_active && dev->zone_max_open > dev->zone_max_active) { dev->zone_max_open = dev->zone_max_active;pr_info ("changed the maximum number of open zones to %u\n" , - dev->nr_zones); + dev->zone_max_open); }else if (dev->zone_max_open >= dev->nr_zones - dev->zone_nr_conv) { dev->zone_max_open =0 ;pr_info ("zone_max_open limit disabled, limit >= zone count\n" );
Greg Kroah-Hartman
maintainerPATCH 3/290 wifi: mac80211: mesh: Fix leak of mesh_preq_queue objects
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolas Escande <[email protected]>
[ Upstream commit b7d7f11a291830fdf69d3301075dd0fb347ced84 ]
The hwmp code use objects of type mesh_preq_queue, added to a list in ieee80211_if_mesh, to keep track of mpath we need to resolve. If the mpath gets deleted, ex mesh interface is removed, the entries in that list will never get cleaned. Fix this by flushing all corresponding items of the preq_queue in mesh_path_flush_pending().
This should take care of KASAN reports like this:
unreferenced object 0xffff00000668d800 (size 128):
comm "kworker/u8:4", pid 67, jiffies 4295419552 (age 1836.444s) hex dump (first 32 bytes):
00 1f 05 09 00 00 ff ff 00 d5 68 06 00 00 ff ff ..........h.....
8e 97 ea eb 3e b8 01 00 00 00 00 00 00 00 00 00 ....>...........
backtrace:
[<000000007302a0b6>] __kmem_cache_alloc_node+0x1e0/0x35c
[<00000000049bd418>] kmalloc_trace+0x34/0x80
[<0000000000d792bb>] mesh_queue_preq+0x44/0x2a8
[<00000000c99c3696>] mesh_nexthop_resolve+0x198/0x19c
[<00000000926bf598>] ieee80211_xmit+0x1d0/0x1f4
[<00000000fc8c2284>] __ieee80211_subif_start_xmit+0x30c/0x764
[<000000005926ee38>] ieee80211_subif_start_xmit+0x9c/0x7a4
[<000000004c86e916>] dev_hard_start_xmit+0x174/0x440
[<0000000023495647>] __dev_queue_xmit+0xe24/0x111c
[<00000000cfe9ca78>] batadv_send_skb_packet+0x180/0x1e4
[<000000007bacc5d5>] batadv_v_elp_periodic_work+0x2f4/0x508
[<00000000adc3cd94>] process_one_work+0x4b8/0xa1c
[<00000000b36425d1>] worker_thread+0x9c/0x634
[<0000000005852dd5>] kthread+0x1bc/0x1c4
[<000000005fccd770>] ret_from_fork+0x10/0x20
unreferenced object 0xffff000009051f00 (size 128):
comm "kworker/u8:4", pid 67, jiffies 4295419553 (age 1836.440s)
hex dump (first 32 bytes):
90 d6 92 0d 00 00 ff ff 00 d8 68 06 00 00 ff ff ..........h.....
36 27 92 e4 02 e0 01 00 00 58 79 06 00 00 ff ff 6'.......Xy.....
backtrace:
[<000000007302a0b6>] __kmem_cache_alloc_node+0x1e0/0x35c
[<00000000049bd418>] kmalloc_trace+0x34/0x80
[<0000000000d792bb>] mesh_queue_preq+0x44/0x2a8
[<00000000c99c3696>] mesh_nexthop_resolve+0x198/0x19c
[<00000000926bf598>] ieee80211_xmit+0x1d0/0x1f4
[<00000000fc8c2284>] __ieee80211_subif_start_xmit+0x30c/0x764
[<000000005926ee38>] ieee80211_subif_start_xmit+0x9c/0x7a4
[<000000004c86e916>] dev_hard_start_xmit+0x174/0x440
[<0000000023495647>] __dev_queue_xmit+0xe24/0x111c
[<00000000cfe9ca78>] batadv_send_skb_packet+0x180/0x1e4
[<000000007bacc5d5>] batadv_v_elp_periodic_work+0x2f4/0x508
[<00000000adc3cd94>] process_one_work+0x4b8/0xa1c
[<00000000b36425d1>] worker_thread+0x9c/0x634
[<0000000005852dd5>] kthread+0x1bc/0x1c4
[<000000005fccd770>] ret_from_fork+0x10/0x20--- net/mac80211/mesh_pathtbl.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
net/mac80211/mesh_pathtbl.c +13 -0
@@ -723,10 +723,23 @@ void mesh_path_discard_frame(struct ieee80211_sub_if_data *sdata,*/ void mesh_path_flush_pending (struct mesh_path *mpath) { +struct ieee80211_sub_if_data *sdata = mpath->sdata; +struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; +struct mesh_preq_queue *preq, *tmp;struct sk_buff *skb;while ((skb =skb_dequeue (&mpath->frame_queue)) !=NULL )mesh_path_discard_frame (mpath->sdata, skb); + +spin_lock_bh (&ifmsh->mesh_preq_queue_lock); +list_for_each_entry_safe (preq, tmp, &ifmsh->preq_queue.list, list) { +if (ether_addr_equal (mpath->dst, preq->dst)) { +list_del (&preq->list); +kfree (preq); + --ifmsh->preq_queue_len; + } + } +spin_unlock_bh (&ifmsh->mesh_preq_queue_lock); }/**
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 4/290 wifi: mac80211: Fix deadlock in ieee80211_sta_ps_deliver_wakeup()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Remi Pommarel <[email protected]>
[ Upstream commit 44c06bbde6443de206b30f513100b5670b23fc5e ]
The ieee80211_sta_ps_deliver_wakeup() function takes sta->ps_lock to synchronizes with ieee80211_tx_h_unicast_ps_buf() which is called from softirq context. However using only spin_lock() to get sta->ps_lock in ieee80211_sta_ps_deliver_wakeup() does not prevent softirq to execute on this same CPU, to run ieee80211_tx_h_unicast_ps_buf() and try to take this same lock ending in deadlock. Below is an example of rcu stall that arises in such situation.
rcu: INFO: rcu_sched self-detected stall on CPU rcu: 2-....: (42413413 ticks this GP) idle=b154/1/0x4000000000000000 softirq=1763/1765 fqs=21206996 rcu: (t=42586894 jiffies g=2057 q=362405 ncpus=4) CPU: 2 PID: 719 Comm: wpa_supplicant Tainted: G W 6.4.0-02158-g1b062f552873 #742 Hardware name: RPT (r1) (DT) pstate: 00000005 (nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : queued_spin_lock_slowpath+0x58/0x2d0 lr : invoke_tx_handlers_early+0x5b4/0x5c0 sp : ffff00001ef64660 x29: ffff00001ef64660 x28: ffff000009bc1070 x27: ffff000009bc0ad8 x26: ffff000009bc0900 x25: ffff00001ef647a8 x24: 0000000000000000 x23: ffff000009bc0900 x22: ffff000009bc0900 x21: ffff00000ac0e000 x20: ffff00000a279e00 x19: ffff00001ef646e8 x18: 0000000000000000 x17: ffff800016468000 x16: ffff00001ef608c0 x15: 0010533c93f64f80 x14: 0010395c9faa3946 x13: 0000000000000000 x12: 00000000fa83b2da x11: 000000012edeceea x10: ffff0000010fbe00 x9 : 0000000000895440 x8 : 000000000010533c x7 : ffff00000ad8b740 x6 : ffff00000c350880 x5 : 0000000000000007 x4 : 0000000000000001 x3 : 0000000000000000 x2 : 0000000000000000 x1 : 0000000000000001 x0 : ffff00000ac0e0e8 Call trace: queued_spin_lock_slowpath+0x58/0x2d0 ieee80211_tx+0x80/0x12c ieee80211_tx_pending+0x110/0x278 tasklet_action_common.constprop.0+0x10c/0x144 tasklet_action+0x20/0x28 _stext+0x11c/0x284 ____do_softirq+0xc/0x14 call_on_irq_stack+0x24/0x34 do_softirq_own_stack+0x18/0x20 do_softirq+0x74/0x7c __local_bh_enable_ip+0xa0/0xa4 _ieee80211_wake_txqs+0x3b0/0x4b8 __ieee80211_wake_queue+0x12c/0x168 ieee80211_add_pending_skbs+0xec/0x138 ieee80211_sta_ps_deliver_wakeup+0x2a4/0x480 ieee80211_mps_sta_status_update.part.0+0xd8/0x11c ieee80211_mps_sta_status_update+0x18/0x24 sta_apply_parameters+0x3bc/0x4c0 ieee80211_change_station+0x1b8/0x2dc nl80211_set_station+0x444/0x49c genl_family_rcv_msg_doit.isra.0+0xa4/0xfc genl_rcv_msg+0x1b0/0x244 netlink_rcv_skb+0x38/0x10c genl_rcv+0x34/0x48 netlink_unicast+0x254/0x2bc netlink_sendmsg+0x190/0x3b4 ____sys_sendmsg+0x1e8/0x218 ___sys_sendmsg+0x68/0x8c __sys_sendmsg+0x44/0x84 __arm64_sys_sendmsg+0x20/0x28 do_el0_svc+0x6c/0xe8 el0_svc+0x14/0x48 el0t_64_sync_handler+0xb0/0xb4 el0t_64_sync+0x14c/0x150
Using spin_lock_bh()/spin_unlock_bh() instead prevents softirq to raise on the same CPU that is holding the lock.
--- net/mac80211/sta_info.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/mac80211/sta_info.c +2 -2
@@ -1343,7 +1343,7 @@ void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta)skb_queue_head_init (&pending);/* sync with ieee80211_tx_h_unicast_ps_buf */ -spin_lock (&sta->ps_lock); +spin_lock_bh (&sta->ps_lock);/* Send all buffered frames to the station */ for (ac =0 ; ac <IEEE80211_NUM_ACS ; ac++) {int count =skb_queue_len (&pending), tmp;
@@ -1372,7 +1372,7 @@ void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta)*/ clear_sta_flag (sta,WLAN_STA_PSPOLL );clear_sta_flag (sta,WLAN_STA_UAPSD ); -spin_unlock (&sta->ps_lock); +spin_unlock_bh (&sta->ps_lock);atomic_dec (&ps->num_sta_ps);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 5/290 wifi: cfg80211: pmsr: use correct nla_get_uX functions
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lin Ma <[email protected]>
[ Upstream commit ab904521f4de52fef4f179d2dfc1877645ef5f5c ]
The commit 9bb7e0f24e7e ("cfg80211: add peer measurement with FTM initiator API") defines four attributes NL80211_PMSR_FTM_REQ_ATTR_ {NUM_BURSTS_EXP}/{BURST_PERIOD}/{BURST_DURATION}/{FTMS_PER_BURST} in following ways.
static const struct nla_policy
nl80211_pmsr_ftm_req_attr_policy[NL80211_PMSR_FTM_REQ_ATTR_MAX + 1] = {
...
[NL80211_PMSR_FTM_REQ_ATTR_NUM_BURSTS_EXP] =
NLA_POLICY_MAX(NLA_U8, 15),
[NL80211_PMSR_FTM_REQ_ATTR_BURST_PERIOD] = { .type = NLA_U16 },
[NL80211_PMSR_FTM_REQ_ATTR_BURST_DURATION] =
NLA_POLICY_MAX(NLA_U8, 15),
[NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST] =
NLA_POLICY_MAX(NLA_U8, 31),
...
};That is, those attributes are expected to be NLA_U8 and NLA_U16 types. However, the consumers of these attributes in pmsr_parse_ftm blindly all use nla_get_u32, which is incorrect and causes functionality issues on little-endian platforms. Hence, fix them with the correct nla_get_u8 and nla_get_u16 functions.
--- net/wireless/pmsr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
net/wireless/pmsr.c +4 -4
@@ -58,7 +58,7 @@ static int pmsr_parse_ftm(struct cfg80211_registered_device *rdev, out->ftm.burst_period =0 ;if (tb[NL80211_PMSR_FTM_REQ_ATTR_BURST_PERIOD ]) out->ftm.burst_period = -nla_get_u32 (tb[NL80211_PMSR_FTM_REQ_ATTR_BURST_PERIOD ]); +nla_get_u16 (tb[NL80211_PMSR_FTM_REQ_ATTR_BURST_PERIOD ]); out->ftm.asap = !!tb[NL80211_PMSR_FTM_REQ_ATTR_ASAP ];if (out->ftm.asap && !capa->ftm.asap) {
@@ -77,7 +77,7 @@ static int pmsr_parse_ftm(struct cfg80211_registered_device *rdev, out->ftm.num_bursts_exp =0 ;if (tb[NL80211_PMSR_FTM_REQ_ATTR_NUM_BURSTS_EXP ]) out->ftm.num_bursts_exp = -nla_get_u32 (tb[NL80211_PMSR_FTM_REQ_ATTR_NUM_BURSTS_EXP ]); +nla_get_u8 (tb[NL80211_PMSR_FTM_REQ_ATTR_NUM_BURSTS_EXP ]);if (capa->ftm.max_bursts_exponent >=0 && out->ftm.num_bursts_exp > capa->ftm.max_bursts_exponent) {
@@ -90,7 +90,7 @@ static int pmsr_parse_ftm(struct cfg80211_registered_device *rdev, out->ftm.burst_duration =15 ;if (tb[NL80211_PMSR_FTM_REQ_ATTR_BURST_DURATION ]) out->ftm.burst_duration = -nla_get_u32 (tb[NL80211_PMSR_FTM_REQ_ATTR_BURST_DURATION ]); +nla_get_u8 (tb[NL80211_PMSR_FTM_REQ_ATTR_BURST_DURATION ]); out->ftm.ftms_per_burst =0 ;if (tb[NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST ])
@@ -109,7 +109,7 @@ static int pmsr_parse_ftm(struct cfg80211_registered_device *rdev, out->ftm.ftmr_retries =3 ;if (tb[NL80211_PMSR_FTM_REQ_ATTR_NUM_FTMR_RETRIES ]) out->ftm.ftmr_retries = -nla_get_u32 (tb[NL80211_PMSR_FTM_REQ_ATTR_NUM_FTMR_RETRIES ]); +nla_get_u8 (tb[NL80211_PMSR_FTM_REQ_ATTR_NUM_FTMR_RETRIES ]); out->ftm.request_lci = !!tb[NL80211_PMSR_FTM_REQ_ATTR_REQUEST_LCI ];if (out->ftm.request_lci && !capa->ftm.request_lci) {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 6/290 wifi: iwlwifi: mvm: revert gen2 TX A-MPDU size to 64
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
[ Upstream commit 4a7aace2899711592327463c1a29ffee44fcc66e ]
We don't actually support >64 even for HE devices, so revert back to 64. This fixes an issue where the session is refused because the queue is configured differently from the actual session later.
--- drivers/net/wireless/intel/iwlwifi/mvm/rs.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/rs.h +2 -7
@@ -133,13 +133,8 @@ enum {#define LINK_QUAL_AGG_FRAME_LIMIT_DEF (63)#define LINK_QUAL_AGG_FRAME_LIMIT_MAX (63) -/* -* FIXME - various places in firmware API still use u8, -* e.g. LQ command and SCD config command. -* This should be 256 instead. -*/ -#define LINK_QUAL_AGG_FRAME_LIMIT_GEN2_DEF (255) -#define LINK_QUAL_AGG_FRAME_LIMIT_GEN2_MAX (255) +#define LINK_QUAL_AGG_FRAME_LIMIT_GEN2_DEF (64) +#define LINK_QUAL_AGG_FRAME_LIMIT_GEN2_MAX (64)#define LINK_QUAL_AGG_FRAME_LIMIT_MIN (0)#define LQ_SIZE 2/* 2 mode tables: "Active" and "Search" */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 7/290 wifi: iwlwifi: dbg_ini: move iwl_dbg_tlv_free outside of debugfs ifdef
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shahar S Matityahu <[email protected]>
[ Upstream commit 87821b67dea87addbc4ab093ba752753b002176a ]
The driver should call iwl_dbg_tlv_free even if debugfs is not defined since ini mode does not depend on debugfs ifdef.
--- drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/iwl-drv.c +1 -1
@@ -1699,8 +1699,8 @@ struct iwl_drv *iwl_drv_start(struct iwl_trans *trans) err_fw:#ifdef CONFIG_IWLWIFI_DEBUGFS debugfs_remove_recursive (drv->dbgfs_drv); -iwl_dbg_tlv_free (drv->trans);#endif +iwl_dbg_tlv_free (drv->trans);kfree (drv); err:return ERR_PTR (ret);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 8/290 wifi: iwlwifi: mvm: check n_ssids before accessing the ssids
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miri Korenblit <[email protected]>
[ Upstream commit 60d62757df30b74bf397a2847a6db7385c6ee281 ]
In some versions of cfg80211, the ssids poinet might be a valid one even though n_ssids is 0. Accessing the pointer in this case will cuase an out-of-bound access. Fix this by checking n_ssids first.
--- drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/scan.c +2 -2
@@ -1354,7 +1354,7 @@ static void iwl_mvm_scan_umac_dwell(struct iwl_mvm *mvm,if (IWL_MVM_ADWELL_MAX_BUDGET ) cmd->v7.adwell_max_budget =cpu_to_le16 (IWL_MVM_ADWELL_MAX_BUDGET ); -else if (params->ssids && params->ssids[0 ].ssid_len) +else if (params->n_ssids && params->ssids[0 ].ssid_len) cmd->v7.adwell_max_budget =cpu_to_le16 (IWL_SCAN_ADWELL_MAX_BUDGET_DIRECTED_SCAN );else
@@ -1456,7 +1456,7 @@ iwl_mvm_scan_umac_dwell_v10(struct iwl_mvm *mvm,if (IWL_MVM_ADWELL_MAX_BUDGET ) general_params->adwell_max_budget =cpu_to_le16 (IWL_MVM_ADWELL_MAX_BUDGET ); -else if (params->ssids && params->ssids[0 ].ssid_len) +else if (params->n_ssids && params->ssids[0 ].ssid_len) general_params->adwell_max_budget =cpu_to_le16 (IWL_SCAN_ADWELL_MAX_BUDGET_DIRECTED_SCAN );else
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 9/290 wifi: iwlwifi: mvm: dont read past the mfuart notifcation
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Emmanuel Grumbach <[email protected]>
[ Upstream commit 4bb95f4535489ed830cf9b34b0a891e384d1aee4 ]
In case the firmware sends a notification that claims it has more data than it has, we will read past that was allocated for the notification. Remove the print of the buffer, we won't see it by default. If needed, we can see the content with tracing.
This was reported by KFENCE.
--- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 10 ---------- 1 file changed, 10 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +0 -10
@@ -196,20 +196,10 @@ void iwl_mvm_mfu_assert_dump_notif(struct iwl_mvm *mvm, {struct iwl_rx_packet *pkt =rxb_addr (rxb);struct iwl_mfu_assert_dump_notif *mfu_dump_notif = (void *)pkt->data; -__le32 *dump_data = mfu_dump_notif->data; -int n_words =le32_to_cpu (mfu_dump_notif->data_size) /sizeof (__le32); -int i;if (mfu_dump_notif->index_num ==0 )IWL_INFO (mvm,"MFUART assert id 0x%x occurred\n" ,le32_to_cpu (mfu_dump_notif->assert_id)); - -for (i =0 ; i < n_words; i++) -IWL_DEBUG_INFO (mvm, -"MFUART assert dump, dword %u: 0x%08x\n" , -le16_to_cpu (mfu_dump_notif->index_num) * - n_words + i, -le32_to_cpu (dump_data[i])); } static bool iwl_alive_fn(struct iwl_notif_wait_data *notif_wait,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainercover 5.10.221-rc1 review
This is the start of the stable review cycle for the 5.10.221 release. There are 290 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 Jul 2024 10:28:12 +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.221-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.10.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 5.10.221-rc1
Sebastian Andrzej Siewior <[email protected]>
xdp: xdp_mem_allocator can be NULL in trace_mem_connect().
Alex Bee <[email protected]>
arm64: dts: rockchip: Add sound-dai-cells for RK3368
Johan Jonker <[email protected]>
ARM: dts: rockchip: rk3066a: add #sound-dai-cells to hdmi node
Marc Zyngier <[email protected]>
KVM: arm64: vgic-v4: Make the doorbell request robust w.r.t preemption
Ard Biesheuvel <[email protected]>
efi/x86: Free EFI memory map only when installing a new one.
Ard Biesheuvel <[email protected]>
efi: xen: Set EFI_PARAVIRT for Xen dom0 boot on all architectures
Ard Biesheuvel <[email protected]>
efi: memmap: Move manipulation routines into x86 arch tree
Liu Zixian <[email protected]>
efi: Correct comment on efi_memmap_alloc
Zheng Zhi Yuan <[email protected]>
drivers: fix typo in firmware/efi/memmap.c
Kuniyuki Iwashima <[email protected]>
tcp: Fix data races around icsk->icsk_af_ops.
Kuniyuki Iwashima <[email protected]>
ipv6: Fix data races around sk->sk_prot.
Eric Dumazet <[email protected]>
ipv6: annotate some data-races around sk->sk_prot
Matthew Wilcox (Oracle) <[email protected]>
nfs: Leave pages in the pagecache if readpage failed
Uwe Kleine-König <[email protected]>
pwm: stm32: Refuse too small period requests
Jaime Liao <[email protected]>
mtd: spinand: macronix: Add support for serial NAND flash
Arnd Bergmann <[email protected]>
syscalls: fix compat_sys_io_pgetevents_time64 usage
Arnd Bergmann <[email protected]>
ftruncate: pass a signed offset
Niklas Cassel <[email protected]>
ata: libata-core: Fix double free on error
Niklas Cassel <[email protected]>
ata: ahci: Clean up sysfs file on error
Sven Eckelmann <[email protected]>
batman-adv: Don't accept TT entries for out-of-spec VIDs
Ma Ke <[email protected]>
drm/nouveau/dispnv04: fix null pointer dereference in nv17_tv_get_hd_modes
Janusz Krzysztofik <[email protected]>
drm/i915/gt: Fix potential UAF by revoke of fence registers
Ma Ke <[email protected]>
drm/nouveau/dispnv04: fix null pointer dereference in nv17_tv_get_ld_modes
Arnd Bergmann <[email protected]>
hexagon: fix fadvise64_64 calling conventions
Arnd Bergmann <[email protected]>
csky, hexagon: fix broken sys_sync_file_range
Arnd Bergmann <[email protected]>
sh: rework sync_file_range ABI
Dragan Simic <[email protected]>
kbuild: Install dtb files as 0644 in Makefile.dtbinst
Oleksij Rempel <[email protected]>
net: can: j1939: enhanced error handling for tightly received RTS messages in xtp_rx_rts_session_new
Oleksij Rempel <[email protected]>
net: can: j1939: recover socket queue on CAN bus error during BAM transmission
Shigeru Yoshida <[email protected]>
net: can: j1939: Initialize unused data in j1939_send_one()
Jean-Michel Hautbois <[email protected]>
tty: mcf: MCF54418 has 10 UARTS
Stefan Eichenberger <[email protected]>
serial: imx: set receiver level before starting uart
Udit Kumar <[email protected]>
serial: 8250_omap: Implementation of Errata i2310
Nikita Zhandarovich <[email protected]>
usb: atm: cxacru: fix endpoint checking in cxacru_bind()
Dan Carpenter <[email protected]>
usb: musb: da8xx: fix a resource leak in probe()
Oliver Neukum <[email protected]>
usb: gadget: printer: fix races against disable
Oliver Neukum <[email protected]>
usb: gadget: printer: SS+ support
Jose Ignacio Tornos Martinez <[email protected]>
net: usb: ax88179_178a: improve link status logs
Vasileios Amoiridis <[email protected]>
iio: chemical: bme680: Fix sensor data read operation
Vasileios Amoiridis <[email protected]>
iio: chemical: bme680: Fix overflows in compensate() functions
Vasileios Amoiridis <[email protected]>
iio: chemical: bme680: Fix calibration data variable
Vasileios Amoiridis <[email protected]>
iio: chemical: bme680: Fix pressure value output
Fernando Yang <[email protected]>
iio: adc: ad7266: Fix variable checking bug
David Lechner <[email protected]>
counter: ti-eqep: enable clock at probe
Adrian Hunter <[email protected]>
mmc: sdhci: Do not lock spinlock around mmc_gpio_get_ro()
Adrian Hunter <[email protected]>
mmc: sdhci: Do not invert write-protect twice
Ilpo Järvinen <[email protected]>
mmc: sdhci-pci: Convert PCIBIOS_* return codes to errnos
Jan Kara <[email protected]>
ocfs2: fix DIO failure due to insufficient transaction credits
Linus Torvalds <[email protected]>
x86: stop playing stack games in profile_pc()
Kent Gibson <[email protected]>
gpiolib: cdev: Disallow reconfiguration without direction (uAPI v1)
Aleksandr Mishin <[email protected]>
gpio: davinci: Validate the obtained number of IRQs
Liu Ying <[email protected]>
drm/panel: simple: Add missing display timing flags for KOE TX26D202VM0BWA
Hannes Reinecke <[email protected]>
nvme: fixup comment for nvme RDMA Provider Type
Erick Archer <[email protected]>
drm/radeon/radeon_display: Decrease the size of allocated memory
Andrew Davis <[email protected]>
soc: ti: wkup_m3_ipc: Send NULL dummy message instead of pointer message
Ricardo Ribalda <[email protected]>
media: dvbdev: Initialize sbuf
Oswald Buddenhagen <[email protected]>
ALSA: emux: improve patch ioctl data validation
Dawei Li <[email protected]>
net/dpaa2: Avoid explicit cpumask var allocation on stack
Dawei Li <[email protected]>
net/iucv: Avoid explicit cpumask var allocation on stack
Anton Protopopov <[email protected]>
bpf: Add a check for struct bpf_fib_lookup size
Denis Arefev <[email protected]>
mtd: partitions: redboot: Added conversion of operands to a larger type
Laurent Pinchart <[email protected]>
drm/panel: ilitek-ili9881c: Fix warning with GPIO controllers that sleep
Yunseong Kim <[email protected]>
tracing/net_sched: NULL pointer dereference in perf_trace_qdisc_reset()
Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: fully validate NFT_DATA_VALUE on store to data registers
Arnd Bergmann <[email protected]>
parisc: use correct compat recv/recvfrom syscalls
Arnd Bergmann <[email protected]>
sparc: fix compat recv/recvfrom syscalls
Arnd Bergmann <[email protected]>
sparc: fix old compat_sys_select()
Daniil Dulov <[email protected]>
xdp: Remove WARN() from __xdp_reg_mem_model()
Toke Høiland-Jørgensen <[email protected]>
xdp: Allow registering memory model without rxq reference
Jakub Kicinski <[email protected]>
xdp: Move the rxq_info.mem clearing to unreg_mem_model()
Enguerrand de Ribaucourt <[email protected]>
net: phy: micrel: add Microchip KSZ 9477 to the device table
Tristram Ha <[email protected]>
net: dsa: microchip: fix initial port flush problem
Elinor Montmasson <[email protected]>
ASoC: fsl-asoc-card: set priv->pdev before using it
Jeff Layton <[email protected]>
nfsd: hold a lighter-weight client reference over CB_RECALL_ANY
Chuck Lever <[email protected]>
SUNRPC: Fix svcxdr_init_encode's buflen calculation
Chuck Lever <[email protected]>
SUNRPC: Fix svcxdr_init_decode's end-of-buffer calculation
Chuck Lever <[email protected]>
SUNRPC: Fix a NULL pointer deref in trace_svc_stats_latency()
Yunjian Wang <[email protected]>
SUNRPC: Fix null pointer dereference in svc_rqst_free()
Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: validate family when identifying table via handle
Alex Deucher <[email protected]>
drm/amdgpu: fix UBSAN warning in kv_dpm.c
Huang-Huang Bao <[email protected]>
pinctrl: rockchip: fix pinmux reset in rockchip_pmx_set
Huang-Huang Bao <[email protected]>
pinctrl: rockchip: use dedicated pinctrl type for RK3328
Jianqun Xu <[email protected]>
pinctrl/rockchip: separate struct rockchip_pin_bank to a head file
Huang-Huang Bao <[email protected]>
pinctrl: rockchip: fix pinmux bits for RK3328 GPIO3-B pins
Huang-Huang Bao <[email protected]>
pinctrl: rockchip: fix pinmux bits for RK3328 GPIO2-B pins
Hagar Hemdan <[email protected]>
pinctrl: fix deadlock in create_pinctrl() when handling -EPROBE_DEFER
John Keeping <[email protected]>
Input: ili210x - fix ili251x_read_touch_data() return value
Mario Limonciello <[email protected]>
ACPI: x86: Force StorageD3Enable on more products
Mario Limonciello <[email protected]>
ACPI: x86: utils: Add Picasso to the list for forcing StorageD3Enable
Mario Limonciello <[email protected]>
ACPI: x86: utils: Add Cezanne to the list for forcing StorageD3Enable
Mario Limonciello <[email protected]>
ACPI: x86: Add another system to quirk list for forcing StorageD3Enable
Mario Limonciello <[email protected]>
ACPI: x86: Add a quirk for Dell Inspiron 14 2-in-1 for StorageD3Enable
Mario Limonciello <[email protected]>
ACPI: Add quirks for AMD Renoir/Lucienne CPUs to force the D3 hint
Jan Beulich <[email protected]>
x86/mm/numa: Use NUMA_NO_NODE when calling memblock_set_node()
Enzo Matsumiya <[email protected]>
smb: client: fix deadlock in smb2_find_smb_tcon()
Shyam Prasad N <[email protected]>
cifs: missed ref-counting smb session in find
Yazen Ghannam <[email protected]>
x86/amd_nb: Check for invalid SMN reads
Naveen Naidu <[email protected]>
PCI: Add PCI_ERROR_RESPONSE and related definitions
Haifeng Xu <[email protected]>
perf/core: Fix missing wakeup when waiting for context reference
Matthias Maennich <[email protected]>
kheaders: explicitly define file modes for archived headers
Masahiro Yamada <[email protected]>
Revert "kheaders: substituting --sort in archive creation"
Ken Milmore <[email protected]>
r8169: Fix possible ring buffer corruption on fragmented Tx packets.
Heiner Kallweit <[email protected]>
r8169: remove not needed check in rtl8169_start_xmit
Heiner Kallweit <[email protected]>
r8169: remove nr_frags argument from rtl_tx_slots_avail
Heiner Kallweit <[email protected]>
r8169: improve rtl8169_start_xmit
Heiner Kallweit <[email protected]>
r8169: improve rtl_tx
Heiner Kallweit <[email protected]>
r8169: remove unneeded memory barrier in rtl_tx
Tony Luck <[email protected]>
x86/cpu: Fix x86_match_cpu() to match just X86_VENDOR_INTEL
Tony Luck <[email protected]>
x86/cpu/vfm: Add new macros to work with (vendor/family/model) values
Jeff Johnson <[email protected]>
tracing: Add MODULE_DESCRIPTION() to preemptirq_delay_test
Harald Freudenberger <[email protected]>
s390/cpacf: Make use of invalid opcode produce a link error
Matthew Mirvish <[email protected]>
bcache: fix variable length array abuse in btree_iter
Vamshi Gajjela <[email protected]>
spmi: hisi-spmi-controller: Do not override device identifier
Trond Myklebust <[email protected]>
knfsd: LOOKUP can return an illegal error value
Tomi Valkeinen <[email protected]>
pmdomain: ti-sci: Fix duplicate PD referrals
Bitterblue Smith <[email protected]>
wifi: rtlwifi: rtl8192de: Fix 5 GHz TX power
Kees Cook <[email protected]>
rtlwifi: rtl8192de: Style clean-ups
Krzysztof Kozlowski <[email protected]>
ARM: dts: samsung: smdk4412: fix keypad no-autorepeat
Krzysztof Kozlowski <[email protected]>
ARM: dts: samsung: exynos4412-origen: fix keypad no-autorepeat
Krzysztof Kozlowski <[email protected]>
ARM: dts: samsung: smdkv310: fix keypad no-autorepeat
Martin Leung <[email protected]>
drm/amd/display: revert Exit idle optimizations before HDCP execution
Krzysztof Kozlowski <[email protected]>
dt-bindings: i2c: google,cros-ec-i2c-tunnel: correct path to i2c-controller schema
Grygorii Tertychnyi <[email protected]>
i2c: ocores: set IACK bit after core is enabled
Aleksandr Nogikh <[email protected]>
kcov: don't lose track of remote references during softirqs
Peter Oberparleiter <[email protected]>
gcov: add support for GCC 14
Alex Deucher <[email protected]>
drm/radeon: fix UBSAN warning in kv_dpm.c
Edson Juliano Drosdeck <[email protected]>
ALSA: hda/realtek: Limit mic boost on N14AP7
Patrisious Haddad <[email protected]>
RDMA/mlx5: Add check for srq max_sge attribute
Raju Rangoju <[email protected]>
ACPICA: Revert "ACPICA: avoid Info: mapping multiple BARs. Your kernel is fine."
Nikita Shubin <[email protected]>
dmaengine: ioatdma: Fix missing kmem_cache_destroy()
Nikita Shubin <[email protected]>
dmaengine: ioatdma: Fix kmemleak in ioat_pci_probe()
Nikita Shubin <[email protected]>
dmaengine: ioatdma: Fix error path in ioat3_dma_probe()
Bjorn Helgaas <[email protected]>
dmaengine: ioat: use PCI core macros for PCIe Capability
Nikita Shubin <[email protected]>
dmaengine: ioatdma: Fix leaking on version mismatch
Bjorn Helgaas <[email protected]>
dmaengine: ioat: Drop redundant pci_enable_pcie_error_reporting()
Qing Wang <[email protected]>
dmaengine: ioat: switch from 'pci_' to 'dma_' API
Biju Das <[email protected]>
regulator: core: Fix modpost error "regulator_get_regmap" undefined
Oliver Neukum <[email protected]>
net: usb: rtl8150 fix unintiatilzed variables in rtl8150_get_link_ksettings
Jozsef Kadlecsik <[email protected]>
netfilter: ipset: Fix suspicious rcu_dereference_protected()
Heng Qi <[email protected]>
virtio_net: checksum offloading handling fix
Xiaolei Wang <[email protected]>
net: stmmac: No need to calculate speed divider when offload is disabled
Xin Long <[email protected]>
sched: act_ct: add netns into the key of tcf_ct_flow_table
Vlad Buslov <[email protected]>
net/sched: act_ct: set 'net' pointer when creating new nf_flow_table
Xin Long <[email protected]>
tipc: force a dst refcount before doing decryption
David Ruth <[email protected]>
net/sched: act_api: fix possible infinite loop in tcf_idr_check_alloc()
Pedro Tammela <[email protected]>
net/sched: act_api: rely on rcu in tcf_idr_check_alloc
Stefan Wahren <[email protected]>
qca_spi: Make interrupt remembering atomic
Yue Haibing <[email protected]>
netns: Make get_net_ns() handle zero refcount net
Eric Dumazet <[email protected]>
xfrm6: check ip6_dst_idev() return value in xfrm6_get_saddr()
Eric Dumazet <[email protected]>
ipv6: prevent possible NULL dereference in rt6_probe()
Eric Dumazet <[email protected]>
ipv6: prevent possible NULL deref in fib6_nh_init()
Gavrilov Ilia <[email protected]>
netrom: Fix a memory leak in nr_heartbeat_expiry()
Ondrej Mosnacek <[email protected]>
cipso: fix total option length computation
Masami Hiramatsu (Google) <[email protected]>
tracing: Build event generation tests only as modules
Christian Marangi <[email protected]>
mips: bmips: BCM6358: make sure CBR is correctly set
Ilpo Järvinen <[email protected]>
MIPS: Routerboard 532: Fix vendor retry check code
Parker Newman <[email protected]>
serial: exar: adding missing CTI and Exar PCI ids
Songyang Li <[email protected]>
MIPS: Octeon: Add PCIe link status check
Mario Limonciello <[email protected]>
PCI/PM: Avoid D3cold for HP Pavilion 17 PC/1972 PCIe Ports
Roman Smirnov <[email protected]>
udf: udftime: prevent overflow in udf_disk_stamp_to_time()
Alex Henrie <[email protected]>
usb: misc: uss720: check for incompatible versions of the Belkin F5U002
Yunlei He <[email protected]>
f2fs: remove clear SB_INLINECRYPT flag in default_options
Aleksandr Aprelkov <[email protected]>
iommu/arm-smmu-v3: Free MSIs in case of ENOMEM
Tzung-Bi Shih <[email protected]>
power: supply: cros_usbpd: provide ID table for avoiding fallback match
Michael Ellerman <[email protected]>
powerpc/io: Avoid clang null pointer arithmetic warnings
Nathan Lynch <[email protected]>
powerpc/pseries: Enforce hcall result buffer validity and size
Erico Nunes <[email protected]>
drm/lima: mask irqs in timeout path before hard reset
Erico Nunes <[email protected]>
drm/lima: add mask irq callback to gp and pp
Pierre-Louis Bossart <[email protected]>
ASoC: Intel: sof_sdw: add JD2 quirk for HP Omen 14
Nicholas Kazlauskas <[email protected]>
drm/amd/display: Exit idle optimizations before HDCP execution
Uri Arev <[email protected]>
Bluetooth: ath3k: Fix multiple issues reported by checkpatch.pl
Takashi Iwai <[email protected]>
ACPI: video: Add backlight=native quirk for Lenovo Slim 7 16ARH7
Sean O'Brien <[email protected]>
HID: Add quirk for Logitech Casa touchpad
Breno Leitao <[email protected]>
netpoll: Fix race condition in netpoll_owner_active
Kunwu Chan <[email protected]>
kselftest: arm64: Add a null pointer check
Manish Rangankar <[email protected]>
scsi: qedi: Fix crash while reading debugfs attribute
Wander Lairson Costa <[email protected]>
drop_monitor: replace spin_lock by raw_spin_lock
Eric Dumazet <[email protected]>
af_packet: avoid a false positive warning in packet_setsockopt()
Arnd Bergmann <[email protected]>
wifi: ath9k: work around memset overflow warning
Eric Dumazet <[email protected]>
batman-adv: bypass empty buckets in batadv_purge_orig_ref()
Yonghong Song <[email protected]>
selftests/bpf: Fix flaky test btf_map_in_map/lookup_update
Alessandro Carminati (Red Hat) <[email protected]>
selftests/bpf: Prevent client connect before server bind in test_tc_tunnel.sh
Justin Stitt <[email protected]>
block/ioctl: prefer different overflow check
Zqiang <[email protected]>
rcutorture: Fix invalid context warning when enable srcu barrier testing
Paul E. McKenney <[email protected]>
rcutorture: Fix rcu_torture_one_read() pipe_count overflow comment
Herbert Xu <[email protected]>
padata: Disable BH when taking works lock on MT path
Oleg Nesterov <[email protected]>
zap_pid_ns_processes: clear TIF_NOTIFY_SIGNAL along with TIF_SIGPENDING
Jean Delvare <[email protected]>
i2c: designware: Fix the functionality flags of the slave-only interface
Jean Delvare <[email protected]>
i2c: at91: Fix the functionality flags of the slave-only interface
Shichao Lai <[email protected]>
usb-storage: alauda: Check whether the media is initialized
Sicong Huang <[email protected]>
greybus: Fix use-after-free bug in gb_interface_release due to race condition.
Beleswar Padhi <[email protected]>
remoteproc: k3-r5: Jump to error handling labels in start/stop errors
YonglongLi <[email protected]>
mptcp: pm: update add_addr counters after connect
YonglongLi <[email protected]>
mptcp: pm: inc RmAddr MIB counter once per RM_ADDR ID
Paolo Abeni <[email protected]>
mptcp: ensure snd_una is properly initialized on connect
Matthias Goergens <[email protected]>
hugetlb_encode.h: fix undefined behaviour (34 << 26)
Doug Brown <[email protected]>
serial: 8250_pxa: Configure tx_loadsz to match FIFO IRQ level
Oleg Nesterov <[email protected]>
tick/nohz_full: Don't abuse smp_call_function_single() in tick_setup_device()
Ryusuke Konishi <[email protected]>
nilfs2: fix potential kernel bug due to lack of writeback flag waiting
Alexander Shishkin <[email protected]>
intel_th: pci: Add Lunar Lake support
Alexander Shishkin <[email protected]>
intel_th: pci: Add Meteor Lake-S support
Alexander Shishkin <[email protected]>
intel_th: pci: Add Sapphire Rapids SOC support
Alexander Shishkin <[email protected]>
intel_th: pci: Add Granite Rapids SOC support
Alexander Shishkin <[email protected]>
intel_th: pci: Add Granite Rapids support
Beleswar Padhi <[email protected]>
remoteproc: k3-r5: Do not allow core1 to power up before core0 via sysfs
Nuno Sa <[email protected]>
dmaengine: axi-dmac: fix possible race in remove()
Rick Wertenbroek <[email protected]>
PCI: rockchip-ep: Remove wrong mask on subsys_vendor_id
Su Yue <[email protected]>
ocfs2: fix races between hole punching and AIO+DIO
Su Yue <[email protected]>
ocfs2: use coarse time for new created files
Rik van Riel <[email protected]>
fs/proc: fix softlockup in __read_vmcore
Hagar Gamal Halim Hemdan <[email protected]>
vmci: prevent speculation leaks by sanitizing event in event_deliver()
Marek Szyprowski <[email protected]>
drm/exynos: hdmi: report safe 640x480 mode as a fallback when no EDID found
Jani Nikula <[email protected]>
drm/exynos/vidi: fix memory leak in .get_modes()
Dirk Behme <[email protected]>
drivers: core: synchronize really_probe() and dev_uevent()
Jean-Baptiste Maneyrol <[email protected]>
iio: imu: inv_icm42600: delete unneeded update watermark call
Marc Ferland <[email protected]>
iio: dac: ad5592r: fix temperature channel scaling value
David Lechner <[email protected]>
iio: adc: ad9467: fix scan type sign
Taehee Yoo <[email protected]>
ionic: fix use after netif_napi_del()
Petr Pavlu <[email protected]>
net/ipv6: Fix the RT cache flush via sysctl using a previous delay
Xiaolei Wang <[email protected]>
net: stmmac: replace priv->speed with the portTransmitRate from the tc-cbs parameters
Jozsef Kadlecsik <[email protected]>
netfilter: ipset: Fix race between namespace cleanup and gc in the list:set type
Luiz Augusto von Dentz <[email protected]>
Bluetooth: L2CAP: Fix rejecting L2CAP_CONN_PARAM_UPDATE_REQ
Gal Pressman <[email protected]>
net/mlx5e: Fix features validation check for tunneled UDP (non-VXLAN) packets
Eric Dumazet <[email protected]>
tcp: fix race in tcp_v6_syn_recv_sock()
Adam Miotk <[email protected]>
drm/bridge/panel: Fix runtime warning on panel bridge release
Amjad Ouled-Ameur <[email protected]>
drm/komeda: check for error-valued pointer
Aleksandr Mishin <[email protected]>
liquidio: Adjust a NULL pointer handling path in lio_vf_rep_copy_packet
Jie Wang <[email protected]>
net: hns3: add cond_resched() to hns3 ring buffer init process
Csókás, Bence <[email protected]>
net: sfp: Always call sfp_sm_mod_remove() on remove
Ian Forbes <[email protected]>
drm/vmwgfx: 3D disabled should not effect STDU memory limits
José Expósito <[email protected]>
HID: logitech-dj: Fix memory leak in logi_dj_recv_switch_to_dj_mode()
Lu Baolu <[email protected]>
iommu: Return right value in iommu_sva_bind_device()
Kun(llfl) <[email protected]>
iommu/amd: Fix sysfs leak in iommu init
Vasant Hegde <[email protected]>
iommu/amd: Introduce pci segment structure
Matthias Schiffer <[email protected]>
gpio: tqmx86: store IRQ trigger type and unmask status separately
Nikita Zhandarovich <[email protected]>
HID: core: remove unnecessary WARN_ON() in implement()
Gregor Herburger <[email protected]>
gpio: tqmx86: fix typo in Kconfig label
Chen Hanxiao <[email protected]>
SUNRPC: return proper error from gss_wrap_req_priv
Dmitry Torokhov <[email protected]>
Input: try trimming too long modalias strings
Michael Ellerman <[email protected]>
powerpc/uaccess: Fix build errors seen with GCC 13/14
Breno Leitao <[email protected]>
scsi: mpt3sas: Avoid test/set_bit() operating in non-allocated memory
Kuangyi Chiang <[email protected]>
xhci: Apply broken streams quirk to Etron EJ188 xHCI host
Kuangyi Chiang <[email protected]>
xhci: Apply reset resume quirk to Etron EJ188 xHCI host
Mathias Nyman <[email protected]>
xhci: Set correct transferred length for cancelled bulk transfers
Greg Kroah-Hartman <[email protected]>
jfs: xattr: fix buffer overflow for invalid xattr
Tomas Winkler <[email protected]>
mei: me: release irq in mei_me_pci_resume error path
Alan Stern <[email protected]>
USB: class: cdc-wdm: Fix CPU lockup caused by excessive log messages
Ryusuke Konishi <[email protected]>
nilfs2: fix nilfs_empty_dir() misjudgment and long loop on I/O errors
Matthew Wilcox (Oracle) <[email protected]>
nilfs2: return the mapped address from nilfs_get_page()
Matthew Wilcox (Oracle) <[email protected]>
nilfs2: Remove check for PageError
Filipe Manana <[email protected]>
btrfs: fix leak of qgroup extent records after transaction abort
Harald Freudenberger <[email protected]>
s390/cpacf: Split and rework cpacf query functions
Heiko Carstens <[email protected]>
s390/cpacf: get rid of register asm
Dev Jain <[email protected]>
selftests/mm: compaction_test: fix bogus test success on Aarch64
Mark Brown <[email protected]>
selftests/mm: log a consistent test name for check_compaction
Muhammad Usama Anjum <[email protected]>
selftests/mm: conform test to TAP format output
Dev Jain <[email protected]>
selftests/mm: compaction_test: fix incorrect write of zero to nr_hugepages
Uwe Kleine-König <[email protected]>
mmc: davinci: Don't strip remove function when driver is builtin
Hugo Villeneuve <[email protected]>
serial: sc16is7xx: fix bug in sc16is7xx_set_baud() when using prescaler
Hugo Villeneuve <[email protected]>
serial: sc16is7xx: replace hardcoded divisor value with BIT() macro
George Shen <[email protected]>
drm/amd/display: Handle Y carry-over in VCP X.Y calculation
Wesley Cheng <[email protected]>
usb: gadget: f_fs: Fix race between aio_cancel() and AIO request complete
Eric Dumazet <[email protected]>
ipv6: fix possible race in __fib6_drop_pcpu_from()
Kuniyuki Iwashima <[email protected]>
af_unix: Annotate data-race of sk->sk_shutdown in sk_diag_fill().
Kuniyuki Iwashima <[email protected]>
af_unix: Use skb_queue_len_lockless() in sk_diag_show_rqlen().
Kuniyuki Iwashima <[email protected]>
af_unix: Use unix_recvq_full_lockless() in unix_stream_connect().
Kuniyuki Iwashima <[email protected]>
af_unix: Annotate data-race of net->unx.sysctl_max_dgram_qlen.
Kuniyuki Iwashima <[email protected]>
af_unix: Annotate data-races around sk->sk_state in UNIX_DIAG.
Kuniyuki Iwashima <[email protected]>
af_unix: Annotate data-races around sk->sk_state in sendmsg() and recvmsg().
Kuniyuki Iwashima <[email protected]>
af_unix: Annotate data-races around sk->sk_state in unix_write_space() and poll().
Kuniyuki Iwashima <[email protected]>
af_unix: Annotate data-race of sk->sk_state in unix_inq_len().
Karol Kolacinski <[email protected]>
ptp: Fix error message on failed pin verification
Eric Dumazet <[email protected]>
net/sched: taprio: always validate TCA_TAPRIO_ATTR_PRIOMAP
Jason Xing <[email protected]>
tcp: count CLOSE-WAIT sockets for TCP_MIB_CURRESTAB
Daniel Borkmann <[email protected]>
vxlan: Fix regression when dropping packets due to invalid src addresses
Hangyu Hua <[email protected]>
net: sched: sch_multiq: fix possible OOB write in multiq_tune()
Eric Dumazet <[email protected]>
ipv6: sr: block BH in seg6_output_core() and seg6_input_core()
DelphineCCChiu <[email protected]>
net/ncsi: Fix the multi thread manner of NCSI driver
Peter Delevoryas <[email protected]>
net/ncsi: Simplify Kconfig/dts control flow
Ivan Mikhaylov <[email protected]>
net/ncsi: add NCSI Intel OEM command to keep PHY up
Lingbo Kong <[email protected]>
wifi: mac80211: correctly parse Spatial Reuse Parameter Set element
Emmanuel Grumbach <[email protected]>
wifi: iwlwifi: mvm: don't read past the mfuart notifcation
Miri Korenblit <[email protected]>
wifi: iwlwifi: mvm: check n_ssids before accessing the ssids
Shahar S Matityahu <[email protected]>
wifi: iwlwifi: dbg_ini: move iwl_dbg_tlv_free outside of debugfs ifdef
Johannes Berg <[email protected]>
wifi: iwlwifi: mvm: revert gen2 TX A-MPDU size to 64
Lin Ma <[email protected]>
wifi: cfg80211: pmsr: use correct nla_get_uX functions
Remi Pommarel <[email protected]>
wifi: mac80211: Fix deadlock in ieee80211_sta_ps_deliver_wakeup()
Nicolas Escande <[email protected]>
wifi: mac80211: mesh: Fix leak of mesh_preq_queue objects
Damien Le Moal <[email protected]>
null_blk: Print correct max open zones limit in null_init_zoned_dev()
Steven Rostedt (Google) <[email protected]>
tracing/selftests: Fix kprobe event name test for .isra. functions
-------------
Diffstat:
.../bindings/i2c/google,cros-ec-i2c-tunnel.yaml | 2 +- Makefile | 4 +- arch/arm/boot/dts/exynos4210-smdkv310.dts | 2 +- arch/arm/boot/dts/exynos4412-origen.dts | 2 +- arch/arm/boot/dts/exynos4412-smdk4412.dts | 2 +- arch/arm/boot/dts/rk3066a.dtsi | 1 + arch/arm64/boot/dts/rockchip/rk3368.dtsi | 3 + arch/arm64/include/asm/kvm_host.h | 1 + arch/arm64/include/asm/unistd32.h | 2 +- arch/arm64/kvm/arm.c | 6 +- arch/arm64/kvm/vgic/vgic-v3.c | 2 +- arch/arm64/kvm/vgic/vgic-v4.c | 8 +- arch/csky/include/uapi/asm/unistd.h | 1 + arch/hexagon/include/asm/syscalls.h | 6 + arch/hexagon/include/uapi/asm/unistd.h | 1 + arch/hexagon/kernel/syscalltab.c | 7 + arch/mips/bmips/setup.c | 3 +- arch/mips/kernel/syscalls/syscall_n32.tbl | 2 +- arch/mips/kernel/syscalls/syscall_o32.tbl | 2 +- arch/mips/pci/ops-rc32434.c | 4 +- arch/mips/pci/pcie-octeon.c | 6 + arch/parisc/kernel/syscalls/syscall.tbl | 4 +- arch/powerpc/include/asm/hvcall.h | 8 +- arch/powerpc/include/asm/io.h | 24 +- arch/powerpc/include/asm/uaccess.h | 15 +- arch/powerpc/kernel/syscalls/syscall.tbl | 2 +- arch/s390/include/asm/cpacf.h | 307 +++++++++++++-------- arch/s390/kernel/syscalls/syscall.tbl | 2 +- arch/sh/kernel/sys_sh32.c | 11 + arch/sh/kernel/syscalls/syscall.tbl | 3 +- arch/sparc/kernel/sys32.S | 221 --------------- arch/sparc/kernel/syscalls/syscall.tbl | 8 +- arch/x86/entry/syscalls/syscall_32.tbl | 2 +- arch/x86/include/asm/cpu_device_id.h | 98 +++++++ arch/x86/include/asm/efi.h | 11 + arch/x86/kernel/amd_nb.c | 9 +- arch/x86/kernel/cpu/match.c | 4 +- arch/x86/kernel/time.c | 20 +- arch/x86/mm/numa.c | 6 +- arch/x86/platform/efi/Makefile | 3 +- arch/x86/platform/efi/efi.c | 8 +- arch/x86/platform/efi/memmap.c | 249 +++++++++++++++++ block/ioctl.c | 2 +- drivers/acpi/acpica/exregion.c | 23 +- drivers/acpi/device_pm.c | 3 + drivers/acpi/internal.h | 9 + drivers/acpi/video_detect.c | 8 + drivers/acpi/x86/utils.c | 34 +++ drivers/ata/ahci.c | 17 +- drivers/ata/libata-core.c | 8 +- drivers/base/core.c | 3 + drivers/block/null_blk/zoned.c | 2 +- drivers/bluetooth/ath3k.c | 25 +- drivers/counter/ti-eqep.c | 6 + drivers/dma/dma-axi-dmac.c | 2 +- drivers/dma/ioat/init.c | 73 +++-- drivers/dma/ioat/registers.h | 7 - drivers/firmware/efi/fdtparams.c | 4 + drivers/firmware/efi/memmap.c | 239 +--------------- drivers/gpio/Kconfig | 2 +- drivers/gpio/gpio-davinci.c | 5 + drivers/gpio/gpio-tqmx86.c | 46 +-- drivers/gpio/gpiolib-cdev.c | 16 +- .../amd/display/dc/dcn10/dcn10_stream_encoder.c | 6 + drivers/gpu/drm/amd/pm/powerplay/kv_dpm.c | 2 + .../drm/arm/display/komeda/komeda_pipeline_state.c | 2 +- drivers/gpu/drm/bridge/panel.c | 7 +- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 7 +- drivers/gpu/drm/exynos/exynos_hdmi.c | 7 +- drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c | 1 + drivers/gpu/drm/lima/lima_bcast.c | 12 + drivers/gpu/drm/lima/lima_bcast.h | 3 + drivers/gpu/drm/lima/lima_gp.c | 8 + drivers/gpu/drm/lima/lima_pp.c | 18 ++ drivers/gpu/drm/lima/lima_sched.c | 7 + drivers/gpu/drm/lima/lima_sched.h | 1 + drivers/gpu/drm/nouveau/dispnv04/tvnv17.c | 6 + drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 6 +- drivers/gpu/drm/panel/panel-simple.c | 1 + drivers/gpu/drm/radeon/radeon.h | 1 - drivers/gpu/drm/radeon/radeon_display.c | 8 +- drivers/gpu/drm/radeon/sumo_dpm.c | 2 + drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 7 - drivers/greybus/interface.c | 1 + drivers/hid/hid-core.c | 1 - drivers/hid/hid-ids.h | 1 + drivers/hid/hid-logitech-dj.c | 4 +- drivers/hid/hid-multitouch.c | 6 + drivers/hwtracing/intel_th/pci.c | 25 ++ drivers/i2c/busses/i2c-at91-slave.c | 3 +- drivers/i2c/busses/i2c-designware-slave.c | 2 +- drivers/i2c/busses/i2c-ocores.c | 2 +- drivers/iio/adc/ad7266.c | 2 + drivers/iio/adc/ad9467.c | 4 +- drivers/iio/chemical/bme680.h | 2 + drivers/iio/chemical/bme680_core.c | 62 ++++- drivers/iio/dac/ad5592r-base.c | 2 +- drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c | 4 - drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c | 4 - drivers/infiniband/hw/mlx5/srq.c | 13 +- drivers/input/input.c | 105 ++++++- drivers/input/touchscreen/ili210x.c | 4 +- drivers/iommu/amd/amd_iommu_types.h | 24 +- drivers/iommu/amd/init.c | 55 +++- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 +- drivers/md/bcache/bset.c | 44 +-- drivers/md/bcache/bset.h | 28 +- drivers/md/bcache/btree.c | 40 +-- drivers/md/bcache/super.c | 5 +- drivers/md/bcache/sysfs.c | 2 +- drivers/md/bcache/writeback.c | 10 +- drivers/media/dvb-core/dvbdev.c | 2 +- drivers/misc/mei/pci-me.c | 4 +- drivers/misc/vmw_vmci/vmci_event.c | 6 +- drivers/mmc/host/davinci_mmc.c | 4 +- drivers/mmc/host/sdhci-pci-core.c | 11 +- drivers/mmc/host/sdhci.c | 25 +- drivers/mtd/nand/spi/macronix.c | 112 ++++++++ drivers/mtd/parsers/redboot.c | 2 +- drivers/net/dsa/microchip/ksz9477.c | 6 +- drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c | 11 +- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 14 +- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 4 + drivers/net/ethernet/hisilicon/hns3/hns3_enet.h | 2 + drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 +- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 4 +- drivers/net/ethernet/qualcomm/qca_debug.c | 6 +- drivers/net/ethernet/qualcomm/qca_spi.c | 16 +- drivers/net/ethernet/qualcomm/qca_spi.h | 3 +- drivers/net/ethernet/realtek/r8169_main.c | 48 ++-- drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c | 55 ++-- drivers/net/phy/micrel.c | 1 + drivers/net/phy/sfp.c | 3 +- drivers/net/usb/ax88179_178a.c | 6 +- drivers/net/usb/rtl8150.c | 3 +- drivers/net/virtio_net.c | 12 +- drivers/net/vxlan/vxlan_core.c | 4 + drivers/net/wireless/ath/ath.h | 6 +- drivers/net/wireless/ath/ath9k/main.c | 3 +- drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 10 - drivers/net/wireless/intel/iwlwifi/mvm/rs.h | 9 +- drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 4 +- .../net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 19 +- drivers/net/wireless/realtek/rtlwifi/wifi.h | 1 - drivers/pci/controller/pcie-rockchip-ep.c | 6 +- drivers/pci/pci.c | 12 + drivers/pinctrl/core.c | 2 +- drivers/pinctrl/pinctrl-rockchip.c | 294 ++++---------------- drivers/pinctrl/pinctrl-rockchip.h | 246 +++++++++++++++++ drivers/power/supply/cros_usbpd-charger.c | 11 +- drivers/ptp/ptp_chardev.c | 3 +- drivers/pwm/pwm-stm32.c | 3 + drivers/regulator/core.c | 1 + drivers/remoteproc/ti_k3_r5_remoteproc.c | 25 +- drivers/scsi/mpt3sas/mpt3sas_base.c | 19 ++ drivers/scsi/qedi/qedi_debugfs.c | 12 +- drivers/soc/ti/ti_sci_pm_domains.c | 20 +- drivers/soc/ti/wkup_m3_ipc.c | 7 +- drivers/staging/hikey9xx/hisi-spmi-controller.c | 1 - drivers/tty/serial/8250/8250_exar.c | 42 +++ drivers/tty/serial/8250/8250_omap.c | 25 +- drivers/tty/serial/8250/8250_pxa.c | 1 + drivers/tty/serial/imx.c | 4 +- drivers/tty/serial/mcf.c | 2 +- drivers/tty/serial/sc16is7xx.c | 25 +- drivers/usb/atm/cxacru.c | 14 + drivers/usb/class/cdc-wdm.c | 4 +- drivers/usb/gadget/function/f_fs.c | 4 + drivers/usb/gadget/function/f_printer.c | 40 ++- drivers/usb/host/xhci-pci.c | 7 + drivers/usb/host/xhci-ring.c | 5 +- drivers/usb/misc/uss720.c | 22 +- drivers/usb/musb/da8xx.c | 8 +- drivers/usb/storage/alauda.c | 9 +- fs/btrfs/disk-io.c | 10 +- fs/cifs/smb2transport.c | 12 +- fs/f2fs/super.c | 2 - fs/jfs/xattr.c | 4 +- fs/nfs/read.c | 4 - fs/nfsd/nfs4state.c | 7 +- fs/nfsd/nfsfh.c | 4 +- fs/nilfs2/dir.c | 59 ++-- fs/nilfs2/segment.c | 3 + fs/ocfs2/aops.c | 5 + fs/ocfs2/file.c | 2 + fs/ocfs2/journal.c | 17 ++ fs/ocfs2/journal.h | 2 + fs/ocfs2/namei.c | 2 +- fs/ocfs2/ocfs2_trace.h | 2 + fs/open.c | 4 +- fs/proc/vmcore.c | 2 + fs/udf/udftime.c | 11 +- include/kvm/arm_vgic.h | 2 +- include/linux/compat.h | 2 +- include/linux/efi.h | 10 +- include/linux/iommu.h | 2 +- include/linux/kcov.h | 2 + include/linux/mod_devicetable.h | 2 + include/linux/nvme.h | 4 +- include/linux/pci.h | 9 + include/linux/sunrpc/svc.h | 20 +- include/linux/syscalls.h | 2 +- include/net/bluetooth/hci_core.h | 36 ++- include/net/netfilter/nf_tables.h | 5 + include/net/xdp.h | 3 + include/trace/events/qdisc.h | 2 +- include/trace/events/sunrpc.h | 8 +- include/uapi/asm-generic/hugetlb_encode.h | 26 +- include/uapi/asm-generic/unistd.h | 2 +- kernel/events/core.c | 13 + kernel/gcov/gcc_4_7.c | 4 +- kernel/gen_kheaders.sh | 9 +- kernel/kcov.c | 1 + kernel/padata.c | 8 +- kernel/pid_namespace.c | 1 + kernel/rcu/rcutorture.c | 12 +- kernel/sys_ni.c | 2 +- kernel/time/tick-common.c | 42 +-- kernel/trace/Kconfig | 4 +- kernel/trace/preemptirq_delay_test.c | 1 + net/batman-adv/originator.c | 29 ++ net/bluetooth/l2cap_core.c | 8 +- net/can/j1939/main.c | 6 +- net/can/j1939/transport.c | 21 +- net/core/drop_monitor.c | 20 +- net/core/filter.c | 3 + net/core/net_namespace.c | 9 +- net/core/netpoll.c | 2 +- net/core/sock.c | 6 +- net/core/xdp.c | 100 ++++--- net/ipv4/af_inet.c | 23 +- net/ipv4/cipso_ipv4.c | 12 +- net/ipv4/tcp.c | 16 +- net/ipv6/af_inet6.c | 24 +- net/ipv6/ip6_fib.c | 6 +- net/ipv6/ipv6_sockglue.c | 9 +- net/ipv6/route.c | 9 +- net/ipv6/seg6_iptunnel.c | 14 +- net/ipv6/tcp_ipv6.c | 9 +- net/ipv6/xfrm6_policy.c | 8 +- net/iucv/iucv.c | 26 +- net/mac80211/he.c | 10 +- net/mac80211/mesh_pathtbl.c | 13 + net/mac80211/sta_info.c | 4 +- net/mptcp/pm_netlink.c | 18 +- net/mptcp/protocol.c | 1 + net/ncsi/Kconfig | 6 + net/ncsi/internal.h | 7 + net/ncsi/ncsi-manage.c | 112 +++++--- net/ncsi/ncsi-rsp.c | 4 +- net/netfilter/ipset/ip_set_core.c | 104 ++++--- net/netfilter/ipset/ip_set_list_set.c | 30 +- net/netfilter/nf_tables_api.c | 13 +- net/netfilter/nft_lookup.c | 3 +- net/netrom/nr_timer.c | 3 +- net/packet/af_packet.c | 26 +- net/sched/act_api.c | 66 +++-- net/sched/act_ct.c | 21 +- net/sched/sch_multiq.c | 2 +- net/sched/sch_taprio.c | 15 +- net/sunrpc/auth_gss/auth_gss.c | 4 +- net/sunrpc/svc.c | 18 +- net/tipc/node.c | 1 + net/unix/af_unix.c | 47 ++-- net/unix/diag.c | 12 +- net/wireless/pmsr.c | 8 +- scripts/Makefile.dtbinst | 2 +- sound/pci/hda/patch_realtek.c | 1 + sound/soc/fsl/fsl-asoc-card.c | 3 +- sound/soc/intel/boards/sof_sdw.c | 9 + sound/synth/emux/soundfont.c | 17 +- tools/include/asm-generic/hugetlb_encode.h | 20 +- tools/testing/selftests/arm64/tags/tags_test.c | 4 + .../selftests/bpf/prog_tests/btf_map_in_map.c | 26 +- tools/testing/selftests/bpf/test_tc_tunnel.sh | 13 +- .../ftrace/test.d/kprobe/kprobe_eventname.tc | 3 +- tools/testing/selftests/vm/compaction_test.c | 108 ++++---- 278 files changed, 3057 insertions(+), 1923 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 19/290 ptp: Fix error message on failed pin verification
5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karol Kolacinski <[email protected]>
[ Upstream commit 323a359f9b077f382f4483023d096a4d316fd135 ]
On failed verification of PTP clock pin, error message prints channel number instead of pin index after "pin", which is incorrect.
Fix error message by adding channel number to the message and printing pin number instead of channel number.
--- drivers/ptp/ptp_chardev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/ptp/ptp_chardev.c +2 -1
@@ -84,7 +84,8 @@ int ptp_set_pinfunc(struct ptp_clock *ptp, unsigned int pin, }if (info->verify (info, pin, func, chan)) { -pr_err ("driver cannot use function %u on pin %u\n" , func, chan); +pr_err ("driver cannot use function %u and channel %u on pin %u\n" , + func, chan, pin);return -EOPNOTSUPP ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 28/290 ipv6: fix possible race in __fib6_drop_pcpu_from()
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 b01e1c030770ff3b4fe37fc7cc6bca03f594133f ]
syzbot found a race in __fib6_drop_pcpu_from() [1]
If compiler reads more than once (*ppcpu_rt), second read could read NULL, if another cpu clears the value in rt6_get_pcpu_route().
Add a READ_ONCE() to prevent this race.
Also add rcu_read_lock()/rcu_read_unlock() because we rely on RCU protection while dereferencing pcpu_rt.
[1]
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000012: 0000 [#1] PREEMPT SMP KASAN PTI KASAN: null-ptr-deref in range [0x0000000000000090-0x0000000000000097] CPU: 0 PID: 7543 Comm: kworker/u8:17 Not tainted 6.10.0-rc1-syzkaller-00013-g2bfcfd584ff5 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Workqueue: netns cleanup_net RIP: 0010:__fib6_drop_pcpu_from.part.0+0x10a/0x370 net/ipv6/ip6_fib.c:984 Code: f8 48 c1 e8 03 80 3c 28 00 0f 85 16 02 00 00 4d 8b 3f 4d 85 ff 74 31 e8 74 a7 fa f7 49 8d bf 90 00 00 00 48 89 f8 48 c1 e8 03 <80> 3c 28 00 0f 85 1e 02 00 00 49 8b 87 90 00 00 00 48 8b 0c 24 48 RSP: 0018:ffffc900040df070 EFLAGS: 00010206 RAX: 0000000000000012 RBX: 0000000000000001 RCX: ffffffff89932e16 RDX: ffff888049dd1e00 RSI: ffffffff89932d7c RDI: 0000000000000091 RBP: dffffc0000000000 R08: 0000000000000005 R09: 0000000000000007 R10: 0000000000000001 R11: 0000000000000006 R12: ffff88807fa080b8 R13: fffffbfff1a9a07d R14: ffffed100ff41022 R15: 0000000000000001 FS: 0000000000000000(0000) GS:ffff8880b9200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b32c26000 CR3: 000000005d56e000 CR4: 00000000003526f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> __fib6_drop_pcpu_from net/ipv6/ip6_fib.c:966 [inline] fib6_drop_pcpu_from net/ipv6/ip6_fib.c:1027 [inline] fib6_purge_rt+0x7f2/0x9f0 net/ipv6/ip6_fib.c:1038 fib6_del_route net/ipv6/ip6_fib.c:1998 [inline] fib6_del+0xa70/0x17b0 net/ipv6/ip6_fib.c:2043 fib6_clean_node+0x426/0x5b0 net/ipv6/ip6_fib.c:2205 fib6_walk_continue+0x44f/0x8d0 net/ipv6/ip6_fib.c:2127 fib6_walk+0x182/0x370 net/ipv6/ip6_fib.c:2175 fib6_clean_tree+0xd7/0x120 net/ipv6/ip6_fib.c:2255 __fib6_clean_all+0x100/0x2d0 net/ipv6/ip6_fib.c:2271 rt6_sync_down_dev net/ipv6/route.c:4906 [inline] rt6_disable_ip+0x7ed/0xa00 net/ipv6/route.c:4911 addrconf_ifdown.isra.0+0x117/0x1b40 net/ipv6/addrconf.c:3855 addrconf_notify+0x223/0x19e0 net/ipv6/addrconf.c:3778 notifier_call_chain+0xb9/0x410 kernel/notifier.c:93 call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:1992 call_netdevice_notifiers_extack net/core/dev.c:2030 [inline] call_netdevice_notifiers net/core/dev.c:2044 [inline] dev_close_many+0x333/0x6a0 net/core/dev.c:1585 unregister_netdevice_many_notify+0x46d/0x19f0 net/core/dev.c:11193 unregister_netdevice_many net/core/dev.c:11276 [inline] default_device_exit_batch+0x85b/0xae0 net/core/dev.c:11759 ops_exit_list+0x128/0x180 net/core/net_namespace.c:178 cleanup_net+0x5b7/0xbf0 net/core/net_namespace.c:640 process_one_work+0x9fb/0x1b60 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
--- net/ipv6/ip6_fib.c | 6 +++++- net/ipv6/route.c | 1 + 2 files changed, 6 insertions(+), 1 deletion(-)
net/ipv6/ip6_fib.c +5 -1
@@ -959,6 +959,7 @@ static void __fib6_drop_pcpu_from(struct fib6_nh *fib6_nh,if (!fib6_nh->rt6i_pcpu)return ; +rcu_read_lock ();/* release the reference to this fib entry from * all of its cached pcpu routes */
@@ -967,7 +968,9 @@ static void __fib6_drop_pcpu_from(struct fib6_nh *fib6_nh,struct rt6_info *pcpu_rt; ppcpu_rt =per_cpu_ptr (fib6_nh->rt6i_pcpu, cpu); - pcpu_rt = *ppcpu_rt; + +/* Paired with xchg() in rt6_get_pcpu_route() */ + pcpu_rt =READ_ONCE (*ppcpu_rt);/* only dropping the 'from' reference if the cached route * is using 'match'. The cached pcpu_rt->from only changes
@@ -981,6 +984,7 @@ static void __fib6_drop_pcpu_from(struct fib6_nh *fib6_nh,fib6_info_release (from); } } +rcu_read_unlock (); }struct fib6_nh_pcpu_arg {
net/ipv6/route.c +1 -0
@@ -1396,6 +1396,7 @@ static struct rt6_info *rt6_get_pcpu_route(const struct fib6_result *res)struct rt6_info *prev, **p; p =this_cpu_ptr (res->nh->rt6i_pcpu); +/* Paired with READ_ONCE() in __fib6_drop_pcpu_from() */ prev =xchg (p,NULL );if (prev) {dst_dev_put (&prev->dst);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 29/290 usb: gadget: f_fs: Fix race between aio_cancel() and AIO request complete
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wesley Cheng <[email protected]>
[ Upstream commit 24729b307eefcd7c476065cd7351c1a018082c19 ]
FFS based applications can utilize the aio_cancel() callback to dequeue pending USB requests submitted to the UDC. There is a scenario where the FFS application issues an AIO cancel call, while the UDC is handling a soft disconnect. For a DWC3 based implementation, the callstack looks like the following:
DWC3 Gadget FFS Applicationdwc3_gadget_soft_disconnect() ...
--> dwc3_stop_active_transfers()
--> dwc3_gadget_giveback(-ESHUTDOWN)
--> ffs_epfile_async_io_complete() ffs_aio_cancel()
--> usb_ep_free_request() --> usb_ep_dequeue()There is currently no locking implemented between the AIO completion handler and AIO cancel, so the issue occurs if the completion routine is running in parallel to an AIO cancel call coming from the FFS application. As the completion call frees the USB request (io_data->req) the FFS application is also referencing it for the usb_ep_dequeue() call. This can lead to accessing a stale/hanging pointer.
commit b566d38857fc ("usb: gadget: f_fs: use io_data->status consistently") relocated the usb_ep_free_request() into ffs_epfile_async_io_complete(). However, in order to properly implement locking to mitigate this issue, the spinlock can't be added to ffs_epfile_async_io_complete(), as usb_ep_dequeue() (if successfully dequeuing a USB request) will call the function driver's completion handler in the same context. Hence, leading into a deadlock.
Fix this issue by moving the usb_ep_free_request() back to ffs_user_copy_worker(), and ensuring that it explicitly sets io_data->req to NULL after freeing it within the ffs->eps_lock. This resolves the race condition above, as the ffs_aio_cancel() routine will not continue attempting to dequeue a request that has already been freed, or the ffs_user_copy_work() not freeing the USB request until the AIO cancel is done referencing it.
This fix depends on
commit b566d38857fc ("usb: gadget: f_fs: use io_data->status consistently")
--- drivers/usb/gadget/function/f_fs.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/gadget/function/f_fs.c +4 -0
@@ -827,6 +827,7 @@ static void ffs_user_copy_worker(structint ret = io_data->req->status ? io_data->req->status : io_data->req->actual;bool kiocb_has_eventfd = io_data->kiocb->ki_flags &IOCB_EVENTFD ; +unsigned long flags;if (io_data->read && ret >0 ) {kthread_use_mm (io_data->mm);
@@ -839,7 +840,10 @@ static void ffs_user_copy_worker(structif (io_data->ffs->ffs_eventfd && !kiocb_has_eventfd)eventfd_signal (io_data->ffs->ffs_eventfd,1 ); +spin_lock_irqsave (&io_data->ffs->eps_lock, flags);usb_ep_free_request (io_data->ep, io_data->req); + io_data->req =NULL ; +spin_unlock_irqrestore (&io_data->ffs->eps_lock, flags);if (io_data->read)kfree (io_data->to_free);
Greg Kroah-Hartman
maintainerPATCH 30/290 drm/amd/display: Handle Y carry-over in VCP X.Y calculation
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: George Shen <[email protected]>
[ Upstream commit 3626a6aebe62ce7067cdc460c0c644e9445386bb ]
[Why/How]
Theoretically rare corner case where ceil(Y) results in rounding up to an integer. If this happens, the 1 should be carried over to the X value.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c +6 -0
@@ -633,6 +633,12 @@ void enc1_stream_encoder_set_throttled_vcp_size( x), 26)); +// If y rounds up to integer, carry it over to x. +if (y >>26 ) { + x +=1 ; + y =0 ; + } +REG_SET_2 (DP_MSE_RATE_CNTL ,0 ,DP_MSE_RATE_X , x,DP_MSE_RATE_Y , y);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 31/290 serial: sc16is7xx: replace hardcoded divisor value with BIT() macro
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hugo Villeneuve <[email protected]>
[ Upstream commit 2e57cefc4477659527f7adab1f87cdbf60ef1ae6 ]
To better show why the limit is what it is, since we have only 16 bits for the divisor.
Stable-dep-of: 8492bd91aa05 ("serial: sc16is7xx: fix bug in sc16is7xx_set_baud() when using prescaler")
--- drivers/tty/serial/sc16is7xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/sc16is7xx.c +1 -1
@@ -497,7 +497,7 @@ static int sc16is7xx_set_baud(struct uart_port *port, int baud)u8 prescaler =0 ;unsigned long clk = port->uartclk, div = clk /16 / baud; -if (div >0xffff ) { +if (div >=BIT (16 )) { prescaler =SC16IS7XX_MCR_CLKSEL_BIT ; div /=4 ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 32/290 serial: sc16is7xx: fix bug in sc16is7xx_set_baud() when using prescaler
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hugo Villeneuve <[email protected]>
[ Upstream commit 8492bd91aa055907c67ef04f2b56f6dadd1f44bf ]
When using a high speed clock with a low baud rate, the 4x prescaler is automatically selected if required. In that case, sc16is7xx_set_baud() properly configures the chip registers, but returns an incorrect baud rate by not taking into account the prescaler value. This incorrect baud rate is then fed to uart_update_timeout().
For example, with an input clock of 80MHz, and a selected baud rate of 50, sc16is7xx_set_baud() will return 200 instead of 50.
Fix this by first changing the prescaler variable to hold the selected prescaler value instead of the MCR bitfield. Then properly take into account the selected prescaler value in the return value computation.
Also add better documentation about the divisor value computation.
--- drivers/tty/serial/sc16is7xx.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-)
drivers/tty/serial/sc16is7xx.c +18 -5
@@ -490,16 +490,28 @@ static bool sc16is7xx_regmap_noinc(struct device *dev, unsigned int reg)return reg ==SC16IS7XX_RHR_REG ; } +/* +* Configure programmable baud rate generator (divisor) according to the +* desired baud rate. +* +* From the datasheet, the divisor is computed according to: +* +* XTAL1 input frequency +* ----------------------- +* prescaler +* divisor = --------------------------- +* baud-rate x sampling-rate +*/ static int sc16is7xx_set_baud (struct uart_port *port,int baud) {struct sc16is7xx_port *s =dev_get_drvdata (port->dev);u8 lcr; -u8 prescaler =0 ; +unsigned int prescaler =1 ;unsigned long clk = port->uartclk, div = clk /16 / baud;if (div >=BIT (16 )) { - prescaler =SC16IS7XX_MCR_CLKSEL_BIT ; - div /=4 ; + prescaler =4 ; + div /= prescaler; }/* In an amazing feat of design, the Enhanced Features Register shares
@@ -534,9 +546,10 @@ static int sc16is7xx_set_baud(struct uart_port *port, int baud)mutex_unlock (&s->efr_lock); +/* If bit MCR_CLKSEL is set, the divide by 4 prescaler is activated. */ sc16is7xx_port_update (port,SC16IS7XX_MCR_REG ,SC16IS7XX_MCR_CLKSEL_BIT , - prescaler); + prescaler ==1 ?0 :SC16IS7XX_MCR_CLKSEL_BIT );/* Open the LCR divisors for configuration */ sc16is7xx_port_write(port, SC16IS7XX_LCR_REG,
@@ -551,7 +564,7 @@ static int sc16is7xx_set_baud(struct uart_port *port, int baud)/* Put LCR back to the normal mode */ sc16is7xx_port_write (port,SC16IS7XX_LCR_REG , lcr); -return DIV_ROUND_CLOSEST (clk /16 , div); +return DIV_ROUND_CLOSEST ((clk / prescaler) /16 , div); } static void sc16is7xx_handle_rx(struct uart_port *port, unsigned int rxlen,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 33/290 mmc: davinci: Dont strip remove function when driver is builtin
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Uwe Kleine-König <[email protected]>
[ Upstream commit 55c421b364482b61c4c45313a535e61ed5ae4ea3 ]
Using __exit for the remove function results in the remove callback being discarded with CONFIG_MMC_DAVINCI=y. When such a device gets unbound (e.g. using sysfs or hotplug), the driver is just removed without the cleanup being performed. This results in resource leaks. Fix it by compiling in the remove callback unconditionally.
This also fixes a W=1 modpost warning:
WARNING: modpost: drivers/mmc/host/davinci_mmc: section mismatch in
reference: davinci_mmcsd_driver+0x10 (section: .data) -> davinci_mmcsd_remove (section: .exit.text)
--- drivers/mmc/host/davinci_mmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/davinci_mmc.c +2 -2
@@ -1347,7 +1347,7 @@ ioremap_fail:return ret; } -static int __exit davinci_mmcsd_remove(struct platform_device *pdev) +static int davinci_mmcsd_remove (struct platform_device *pdev) {struct mmc_davinci_host *host =platform_get_drvdata (pdev);
@@ -1404,7 +1404,7 @@ static struct platform_driver davinci_mm .of_match_table = davinci_mmc_dt_ids, }, .probe = davinci_mmcsd_probe, - .remove = __exit_p(davinci_mmcsd_remove), + .remove = davinci_mmcsd_remove, .id_table = davinci_mmc_devtype, };
Greg Kroah-Hartman
maintainerPATCH 34/290 selftests/mm: compaction_test: fix incorrect write of zero to nr_hugepages
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dev Jain <[email protected]>
[ Upstream commit 9ad665ef55eaad1ead1406a58a34f615a7c18b5e ]
Currently, the test tries to set nr_hugepages to zero, but that is not actually done because the file offset is not reset after read(). Fix that using lseek().
--- tools/testing/selftests/vm/compaction_test.c | 2 ++ 1 file changed, 2 insertions(+)
tools/testing/selftests/vm/compaction_test.c +2 -0
@@ -103,6 +103,8 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size) goto close_fd; } +lseek (fd,0 ,SEEK_SET ); +/* Start with the initial condition of 0 huge pages*/ if (write (fd,"0" ,sizeof (char )) !=sizeof (char )) {perror ("Failed to write 0 to /proc/sys/vm/nr_hugepages\n" );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 35/290 selftests/mm: conform test to TAP format output
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Muhammad Usama Anjum <[email protected]>
[ Upstream commit 9a21701edc41465de56f97914741bfb7bfc2517d ]
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages.
Stable-dep-of: d4202e66a4b1 ("selftests/mm: compaction_test: fix bogus test success on Aarch64")
--- tools/testing/selftests/vm/compaction_test.c | 91 ++++++++++---------- 1 file changed, 44 insertions(+), 47 deletions(-)
tools/testing/selftests/vm/compaction_test.c +44 -47
@@ -33,7 +33,7 @@ int read_memory_info(unsigned long *memfree, unsigned long *hugepagesize)FILE *cmdfile =popen (cmd,"r" );if (!(fgets (buffer,sizeof (buffer), cmdfile))) { -perror ("Failed to read meminfo\n" ); +ksft_print_msg ("Failed to read meminfo: %s\n" ,strerror (errno));return -1 ; }
@@ -44,7 +44,7 @@ int read_memory_info(unsigned long *memfree, unsigned long *hugepagesize) cmdfile =popen (cmd,"r" );if (!(fgets (buffer,sizeof (buffer), cmdfile))) { -perror ("Failed to read meminfo\n" ); +ksft_print_msg ("Failed to read meminfo: %s\n" ,strerror (errno));return -1 ; }
@@ -62,14 +62,14 @@ int prereq(void) fd =open ("/proc/sys/vm/compact_unevictable_allowed" ,O_RDONLY |O_NONBLOCK );if (fd <0 ) { -perror ("Failed to open\n" -"/proc/sys/vm/compact_unevictable_allowed\n" ); +ksft_print_msg ("Failed to open /proc/sys/vm/compact_unevictable_allowed: %s\n" , +strerror (errno));return -1 ; }if (read (fd, &allowed,sizeof (char )) !=sizeof (char )) { -perror ("Failed to read from\n" -"/proc/sys/vm/compact_unevictable_allowed\n" ); +ksft_print_msg ("Failed to read from /proc/sys/vm/compact_unevictable_allowed: %s\n" , +strerror (errno));close (fd);return -1 ; }
@@ -78,12 +78,13 @@ int prereq(void)if (allowed =='1' )return 0 ; +ksft_print_msg ("Compaction isn't allowed\n" );return -1 ; }int check_compaction (unsigned long mem_free,unsigned int hugepage_size) { -int fd; +int fd, ret =-1 ;int compaction_index =0 ;char initial_nr_hugepages[10 ] = {0 };char nr_hugepages[10 ] = {0 };
@@ -94,12 +95,14 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size) fd =open ("/proc/sys/vm/nr_hugepages" ,O_RDWR |O_NONBLOCK );if (fd <0 ) { -perror ("Failed to open /proc/sys/vm/nr_hugepages" ); +ksft_test_result_fail ("Failed to open /proc/sys/vm/nr_hugepages: %s\n" , +strerror (errno));return -1 ; }if (read (fd, initial_nr_hugepages,sizeof (initial_nr_hugepages)) <=0 ) { -perror ("Failed to read from /proc/sys/vm/nr_hugepages" ); +ksft_test_result_fail ("Failed to read from /proc/sys/vm/nr_hugepages: %s\n" , +strerror (errno)); goto close_fd; }
@@ -107,7 +110,8 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)/* Start with the initial condition of 0 huge pages*/ if (write (fd,"0" ,sizeof (char )) !=sizeof (char )) { -perror ("Failed to write 0 to /proc/sys/vm/nr_hugepages\n" ); +ksft_test_result_fail ("Failed to write 0 to /proc/sys/vm/nr_hugepages: %s\n" , +strerror (errno)); goto close_fd; }
@@ -116,14 +120,16 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)/* Request a large number of huge pages. The Kernel will allocate as much as it can */ if (write (fd,"100000" , (6 *sizeof (char ))) != (6 *sizeof (char ))) { -perror ("Failed to write 100000 to /proc/sys/vm/nr_hugepages\n" ); +ksft_test_result_fail ("Failed to write 100000 to /proc/sys/vm/nr_hugepages: %s\n" , +strerror (errno)); goto close_fd; }lseek (fd,0 ,SEEK_SET );if (read (fd, nr_hugepages,sizeof (nr_hugepages)) <=0 ) { -perror ("Failed to re-read from /proc/sys/vm/nr_hugepages\n" ); +ksft_test_result_fail ("Failed to re-read from /proc/sys/vm/nr_hugepages: %s\n" , +strerror (errno)); goto close_fd; }
@@ -131,67 +137,58 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)huge pages */ compaction_index = mem_free/(atoi (nr_hugepages) * hugepage_size); -if (compaction_index >3 ) { -printf ("No of huge pages allocated = %d\n" , - (atoi (nr_hugepages))); -fprintf (stderr,"ERROR: Less that 1/%d of memory is available\n" -"as huge pages\n" , compaction_index); - goto close_fd; - } - -printf ("No of huge pages allocated = %d\n" , - (atoi (nr_hugepages))); -lseek (fd,0 ,SEEK_SET );if (write (fd, initial_nr_hugepages,strlen (initial_nr_hugepages)) !=strlen (initial_nr_hugepages)) { -perror ("Failed to write value to /proc/sys/vm/nr_hugepages\n" ); +ksft_test_result_fail ("Failed to write value to /proc/sys/vm/nr_hugepages: %s\n" , +strerror (errno)); goto close_fd; } -close (fd); -return 0 ; +if (compaction_index >3 ) { +ksft_print_msg ("ERROR: Less that 1/%d of memory is available\n" +"as huge pages\n" , compaction_index); +ksft_test_result_fail ("No of huge pages allocated = %d\n" , (atoi (nr_hugepages))); + goto close_fd; + } + +ksft_test_result_pass ("Memory compaction succeeded. No of huge pages allocated = %d\n" , + (atoi (nr_hugepages))); + ret =0 ; close_fd:close (fd); -printf ("Not OK. Compaction test failed." ); -return -1 ; +return ret; }int main (int argc,char **argv) {struct rlimit lim; -struct map_list *list, *entry; +struct map_list *list =NULL , *entry;size_t page_size, i;void *map =NULL ;unsigned long mem_free =0 ;unsigned long hugepage_size =0 ;long mem_fragmentable_MB =0 ; -if (prereq () !=0 ) { -printf ("Either the sysctl compact_unevictable_allowed is not\n" -"set to 1 or couldn't read the proc file.\n" -"Skipping the test\n" ); -return KSFT_SKIP ; - } +ksft_print_header (); + +if (prereq () !=0 ) +return ksft_exit_pass (); + +ksft_set_plan (1 ); lim.rlim_cur =RLIM_INFINITY ; lim.rlim_max =RLIM_INFINITY ; -if (setrlimit (RLIMIT_MEMLOCK , &lim)) { -perror ("Failed to set rlimit:\n" ); -return -1 ; - } +if (setrlimit (RLIMIT_MEMLOCK , &lim)) +ksft_exit_fail_msg ("Failed to set rlimit: %s\n" ,strerror (errno)); page_size =getpagesize (); - list =NULL ; - -if (read_memory_info (&mem_free, &hugepage_size) !=0 ) { -printf ("ERROR: Cannot read meminfo\n" ); -return -1 ; - } +if (read_memory_info (&mem_free, &hugepage_size) !=0 ) +ksft_exit_fail_msg ("Failed to get meminfo\n" ); mem_fragmentable_MB = mem_free *0.8 /1024 ;
@@ -227,7 +224,7 @@ int main(int argc, char **argv) }if (check_compaction (mem_free, hugepage_size) ==0 ) -return 0 ; +return ksft_exit_pass (); -return -1 ; +return ksft_exit_fail (); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 36/290 selftests/mm: log a consistent test name for check_compaction
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <[email protected]>
[ Upstream commit f3b7568c49420d2dcd251032c9ca1e069ec8a6c9 ]
Every test result report in the compaction test prints a distinct log messae, and some of the reports print a name that varies at runtime. This causes problems for automation since a lot of automation software uses the printed string as the name of the test, if the name varies from run to run and from pass to fail then the automation software can't identify that a test changed result or that the same tests are being run.
Refactor the logging to use a consistent name when printing the result of the test, printing the existing messages as diagnostic information instead so they are still available for people trying to interpret the results.
Stable-dep-of: d4202e66a4b1 ("selftests/mm: compaction_test: fix bogus test success on Aarch64")
--- tools/testing/selftests/vm/compaction_test.c | 35 +++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-)
tools/testing/selftests/vm/compaction_test.c +19 -16
@@ -95,14 +95,15 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size) fd =open ("/proc/sys/vm/nr_hugepages" ,O_RDWR |O_NONBLOCK );if (fd <0 ) { -ksft_test_result_fail ("Failed to open /proc/sys/vm/nr_hugepages: %s\n" , -strerror (errno)); -return -1 ; +ksft_print_msg ("Failed to open /proc/sys/vm/nr_hugepages: %s\n" , +strerror (errno)); + ret =-1 ; + goto out; }if (read (fd, initial_nr_hugepages,sizeof (initial_nr_hugepages)) <=0 ) { -ksft_test_result_fail ("Failed to read from /proc/sys/vm/nr_hugepages: %s\n" , -strerror (errno)); +ksft_print_msg ("Failed to read from /proc/sys/vm/nr_hugepages: %s\n" , +strerror (errno)); goto close_fd; }
@@ -110,8 +111,8 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)/* Start with the initial condition of 0 huge pages*/ if (write (fd,"0" ,sizeof (char )) !=sizeof (char )) { -ksft_test_result_fail ("Failed to write 0 to /proc/sys/vm/nr_hugepages: %s\n" , -strerror (errno)); +ksft_print_msg ("Failed to write 0 to /proc/sys/vm/nr_hugepages: %s\n" , +strerror (errno)); goto close_fd; }
@@ -120,16 +121,16 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)/* Request a large number of huge pages. The Kernel will allocate as much as it can */ if (write (fd,"100000" , (6 *sizeof (char ))) != (6 *sizeof (char ))) { -ksft_test_result_fail ("Failed to write 100000 to /proc/sys/vm/nr_hugepages: %s\n" , -strerror (errno)); +ksft_print_msg ("Failed to write 100000 to /proc/sys/vm/nr_hugepages: %s\n" , +strerror (errno)); goto close_fd; }lseek (fd,0 ,SEEK_SET );if (read (fd, nr_hugepages,sizeof (nr_hugepages)) <=0 ) { -ksft_test_result_fail ("Failed to re-read from /proc/sys/vm/nr_hugepages: %s\n" , -strerror (errno)); +ksft_print_msg ("Failed to re-read from /proc/sys/vm/nr_hugepages: %s\n" , +strerror (errno)); goto close_fd; }
@@ -141,24 +142,26 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)if (write (fd, initial_nr_hugepages,strlen (initial_nr_hugepages)) !=strlen (initial_nr_hugepages)) { -ksft_test_result_fail ("Failed to write value to /proc/sys/vm/nr_hugepages: %s\n" , -strerror (errno)); +ksft_print_msg ("Failed to write value to /proc/sys/vm/nr_hugepages: %s\n" , +strerror (errno)); goto close_fd; } +ksft_print_msg ("Number of huge pages allocated = %d\n" , +atoi (nr_hugepages)); +if (compaction_index >3 ) {ksft_print_msg ("ERROR: Less that 1/%d of memory is available\n" "as huge pages\n" , compaction_index); -ksft_test_result_fail ("No of huge pages allocated = %d\n" , (atoi (nr_hugepages))); goto close_fd; } -ksft_test_result_pass ("Memory compaction succeeded. No of huge pages allocated = %d\n" , - (atoi (nr_hugepages))); ret =0 ; close_fd:close (fd); + out: +ksft_test_result (ret ==0 ,"check_compaction\n" );return ret; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 37/290 selftests/mm: compaction_test: fix bogus test success on Aarch64
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dev Jain <[email protected]>
[ Upstream commit d4202e66a4b1fe6968f17f9f09bbc30d08f028a1 ]
Patch series "Fixes for compaction_test", v2.
The compaction_test memory selftest introduces fragmentation in memory and then tries to allocate as many hugepages as possible. This series addresses some problems.
On Aarch64, if nr_hugepages == 0, then the test trivially succeeds since compaction_index becomes 0, which is less than 3, due to no division by zero exception being raised. We fix that by checking for division by zero.
Secondly, correctly set the number of hugepages to zero before trying to set a large number of them.
Now, consider a situation in which, at the start of the test, a non-zero number of hugepages have been already set (while running the entire selftests/mm suite, or manually by the admin). The test operates on 80% of memory to avoid OOM-killer invocation, and because some memory is already blocked by hugepages, it would increase the chance of OOM-killing. Also, since mem_free used in check_compaction() is the value before we set nr_hugepages to zero, the chance that the compaction_index will be small is very high if the preset nr_hugepages was high, leading to a bogus test success.
This patch (of 3):
Currently, if at runtime we are not able to allocate a huge page, the test will trivially pass on Aarch64 due to no exception being raised on division by zero while computing compaction_index. Fix that by checking for nr_hugepages == 0. Anyways, in general, avoid a division by zero by exiting the program beforehand. While at it, fix a typo, and handle the case where the number of hugepages may overflow an integer.
--- tools/testing/selftests/vm/compaction_test.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
tools/testing/selftests/vm/compaction_test.c +13 -7
@@ -82,12 +82,13 @@ int prereq(void)return -1 ; } -int check_compaction (unsigned long mem_free,unsigned int hugepage_size) +int check_compaction (unsigned long mem_free,unsigned long hugepage_size) { +unsigned long nr_hugepages_ul;int fd, ret =-1 ;int compaction_index =0 ; -char initial_nr_hugepages[10 ] = {0 }; -char nr_hugepages[10 ] = {0 }; +char initial_nr_hugepages[20 ] = {0 }; +char nr_hugepages[20 ] = {0 };/* We want to test with 80% of available memory. Else, OOM killer comes in to play */
@@ -136,7 +137,12 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)/* We should have been able to request at least 1/3 rd of the memory in huge pages */ - compaction_index = mem_free/(atoi (nr_hugepages) * hugepage_size); + nr_hugepages_ul =strtoul (nr_hugepages,NULL ,10 ); +if (!nr_hugepages_ul) { +ksft_print_msg ("ERROR: No memory is available as huge pages\n" ); + goto close_fd; + } + compaction_index = mem_free/(nr_hugepages_ul * hugepage_size);lseek (fd,0 ,SEEK_SET );
@@ -147,11 +153,11 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size) goto close_fd; } -ksft_print_msg ("Number of huge pages allocated = %d\n" , -atoi (nr_hugepages)); +ksft_print_msg ("Number of huge pages allocated = %lu\n" , + nr_hugepages_ul);if (compaction_index >3 ) { -ksft_print_msg ("ERROR: Less that 1/%d of memory is available\n" +ksft_print_msg ("ERROR: Less than 1/%d of memory is available\n" "as huge pages\n" , compaction_index); goto close_fd; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 20/290 af_unix: Annotate data-race of sk->sk_state in unix_inq_len().
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 3a0f38eb285c8c2eead4b3230c7ac2983707599d ]
ioctl(SIOCINQ) calls unix_inq_len() that checks sk->sk_state first and returns -EINVAL if it's TCP_LISTEN.
Then, for SOCK_STREAM sockets, unix_inq_len() returns the number of bytes in recvq.
However, unix_inq_len() does not hold unix_state_lock(), and the concurrent listen() might change the state after checking sk->sk_state.
If the race occurs, 0 is returned for the listener, instead of -EINVAL, because the length of skb with embryo is 0.
We could hold unix_state_lock() in unix_inq_len(), but it's overkill given the result is true for pre-listen() TCP_CLOSE state.
So, let's use READ_ONCE() for sk->sk_state in unix_inq_len().
--- net/unix/af_unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/unix/af_unix.c +1 -1
@@ -2614,7 +2614,7 @@ long unix_inq_len(struct sock *sk)struct sk_buff *skb;long amount =0 ; -if (sk->sk_state ==TCP_LISTEN ) +if (READ_ONCE (sk->sk_state) ==TCP_LISTEN )return -EINVAL ;spin_lock (&sk->sk_receive_queue.lock);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 38/290 s390/cpacf: get rid of register asm
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heiko Carstens <[email protected]>
[ Upstream commit b84d0c417a5ac1eb820c8114c0c7cf1fcbf6f017 ]
Using register asm statements has been proven to be very error prone, especially when using code instrumentation where gcc may add function calls, which clobbers register contents in an unexpected way.
Therefore get rid of register asm statements in cpacf code, and make sure this bug class cannot happen.
Stable-dep-of: 830999bd7e72 ("s390/cpacf: Split and rework cpacf query functions")
--- arch/s390/include/asm/cpacf.h | 208 ++++++++++++++++++---------------- 1 file changed, 111 insertions(+), 97 deletions(-)
arch/s390/include/asm/cpacf.h +111 -97
@@ -173,17 +173,16 @@ typedef struct { unsigned char bytes[16]; } cpacf_mask_t;*/ static __always_inline void __cpacf_query(unsigned int opcode, cpacf_mask_t *mask) { - register unsigned long r0 asm("0") = 0; /* query function */ - register unsigned long r1 asm("1") = (unsigned long) mask; - asmvolatile ( -" spm 0\n" /* pckmo doesn't change the cc */ +" lghi 0,0\n" /* query function */ +" lgr 1,%[mask]\n" +" spm 0\n" /* pckmo doesn't change the cc */ /* Parameter regs are ignored, but must be nonzero and unique */ "0: .insn rrf,%[opc] << 16,2,4,6,0\n" " brc 1,0b\n" /* handle partial completion */ :"=m" (*mask) - : [fc]"d" (r0), [pba]"a" (r1), [opc]"i" (opcode) - :"cc" ); + : [mask]"d" ((unsigned long )mask), [opc]"i" (opcode) + :"cc" ,"0" ,"1" ); } static __always_inline int __cpacf_check_opcode(unsigned int opcode)
@@ -249,20 +248,22 @@ static __always_inline int cpacf_query_func(unsigned int opcode, unsigned int fustatic inline int cpacf_km (unsigned long func,void *param,u8 *dest,const u8 *src,long src_len) { - register unsigned long r0 asm("0") = (unsigned long) func; - register unsigned long r1 asm("1") = (unsigned long) param; - register unsigned long r2 asm("2") = (unsigned long) src; - register unsigned long r3 asm("3") = (unsigned long) src_len; - register unsigned long r4 asm("4") = (unsigned long) dest; +union register_pair d, s; + d.even = (unsigned long )dest; + s.even = (unsigned long )src; + s.odd = (unsigned long )src_len; asmvolatile ( +" lgr 0,%[fc]\n" +" lgr 1,%[pba]\n" "0: .insn rre,%[opc] << 16,%[dst],%[src]\n" " brc 1,0b\n" /* handle partial completion */ - : [src]"+a" (r2), [len]"+d" (r3), [dst]"+a" (r4) - : [fc]"d" (r0), [pba]"a" (r1), [opc]"i" (CPACF_KM ) - :"cc" ,"memory" ); + : [src]"+&d" (s.pair), [dst]"+&d" (d.pair) + : [fc]"d" (func), [pba]"d" ((unsigned long )param), + [opc]"i" (CPACF_KM ) + :"cc" ,"memory" ,"0" ,"1" ); -return src_len - r3; +return src_len - s.odd; }/**
@@ -279,20 +280,22 @@ static inline int cpacf_km(unsigned long func, void *param,static inline int cpacf_kmc (unsigned long func,void *param,u8 *dest,const u8 *src,long src_len) { - register unsigned long r0 asm("0") = (unsigned long) func; - register unsigned long r1 asm("1") = (unsigned long) param; - register unsigned long r2 asm("2") = (unsigned long) src; - register unsigned long r3 asm("3") = (unsigned long) src_len; - register unsigned long r4 asm("4") = (unsigned long) dest; +union register_pair d, s; + d.even = (unsigned long )dest; + s.even = (unsigned long )src; + s.odd = (unsigned long )src_len; asmvolatile ( +" lgr 0,%[fc]\n" +" lgr 1,%[pba]\n" "0: .insn rre,%[opc] << 16,%[dst],%[src]\n" " brc 1,0b\n" /* handle partial completion */ - : [src]"+a" (r2), [len]"+d" (r3), [dst]"+a" (r4) - : [fc]"d" (r0), [pba]"a" (r1), [opc]"i" (CPACF_KMC ) - :"cc" ,"memory" ); + : [src]"+&d" (s.pair), [dst]"+&d" (d.pair) + : [fc]"d" (func), [pba]"d" ((unsigned long )param), + [opc]"i" (CPACF_KMC ) + :"cc" ,"memory" ,"0" ,"1" ); -return src_len - r3; +return src_len - s.odd; }/**
@@ -306,17 +309,19 @@ static inline int cpacf_kmc(unsigned long func, void *param,static inline void cpacf_kimd (unsigned long func,void *param,const u8 *src,long src_len) { - register unsigned long r0 asm("0") = (unsigned long) func; - register unsigned long r1 asm("1") = (unsigned long) param; - register unsigned long r2 asm("2") = (unsigned long) src; - register unsigned long r3 asm("3") = (unsigned long) src_len; +union register_pair s; + s.even = (unsigned long )src; + s.odd = (unsigned long )src_len; asmvolatile ( +" lgr 0,%[fc]\n" +" lgr 1,%[pba]\n" "0: .insn rre,%[opc] << 16,0,%[src]\n" " brc 1,0b\n" /* handle partial completion */ - : [src]"+a" (r2), [len]"+d" (r3) - : [fc]"d" (r0), [pba]"a" (r1), [opc]"i" (CPACF_KIMD ) - :"cc" ,"memory" ); + : [src]"+&d" (s.pair) + : [fc]"d" (func), [pba]"d" ((unsigned long )(param)), + [opc]"i" (CPACF_KIMD ) + :"cc" ,"memory" ,"0" ,"1" ); }/**
@@ -329,17 +334,19 @@ static inline void cpacf_kimd(unsigned long func, void *param,static inline void cpacf_klmd (unsigned long func,void *param,const u8 *src,long src_len) { - register unsigned long r0 asm("0") = (unsigned long) func; - register unsigned long r1 asm("1") = (unsigned long) param; - register unsigned long r2 asm("2") = (unsigned long) src; - register unsigned long r3 asm("3") = (unsigned long) src_len; +union register_pair s; + s.even = (unsigned long )src; + s.odd = (unsigned long )src_len; asmvolatile ( +" lgr 0,%[fc]\n" +" lgr 1,%[pba]\n" "0: .insn rre,%[opc] << 16,0,%[src]\n" " brc 1,0b\n" /* handle partial completion */ - : [src]"+a" (r2), [len]"+d" (r3) - : [fc]"d" (r0), [pba]"a" (r1), [opc]"i" (CPACF_KLMD ) - :"cc" ,"memory" ); + : [src]"+&d" (s.pair) + : [fc]"d" (func), [pba]"d" ((unsigned long )param), + [opc]"i" (CPACF_KLMD ) + :"cc" ,"memory" ,"0" ,"1" ); }/**
@@ -355,19 +362,21 @@ static inline void cpacf_klmd(unsigned long func, void *param,static inline int cpacf_kmac (unsigned long func,void *param,const u8 *src,long src_len) { - register unsigned long r0 asm("0") = (unsigned long) func; - register unsigned long r1 asm("1") = (unsigned long) param; - register unsigned long r2 asm("2") = (unsigned long) src; - register unsigned long r3 asm("3") = (unsigned long) src_len; +union register_pair s; + s.even = (unsigned long )src; + s.odd = (unsigned long )src_len; asmvolatile ( +" lgr 0,%[fc]\n" +" lgr 1,%[pba]\n" "0: .insn rre,%[opc] << 16,0,%[src]\n" " brc 1,0b\n" /* handle partial completion */ - : [src]"+a" (r2), [len]"+d" (r3) - : [fc]"d" (r0), [pba]"a" (r1), [opc]"i" (CPACF_KMAC ) - :"cc" ,"memory" ); + : [src]"+&d" (s.pair) + : [fc]"d" (func), [pba]"d" ((unsigned long )param), + [opc]"i" (CPACF_KMAC ) + :"cc" ,"memory" ,"0" ,"1" ); -return src_len - r3; +return src_len - s.odd; }/**
@@ -385,22 +394,24 @@ static inline int cpacf_kmac(unsigned long func, void *param,static inline int cpacf_kmctr (unsigned long func,void *param,u8 *dest,const u8 *src,long src_len,u8 *counter) { - register unsigned long r0 asm("0") = (unsigned long) func; - register unsigned long r1 asm("1") = (unsigned long) param; - register unsigned long r2 asm("2") = (unsigned long) src; - register unsigned long r3 asm("3") = (unsigned long) src_len; - register unsigned long r4 asm("4") = (unsigned long) dest; - register unsigned long r6 asm("6") = (unsigned long) counter; +union register_pair d, s, c; + d.even = (unsigned long )dest; + s.even = (unsigned long )src; + s.odd = (unsigned long )src_len; + c.even = (unsigned long )counter; asmvolatile ( +" lgr 0,%[fc]\n" +" lgr 1,%[pba]\n" "0: .insn rrf,%[opc] << 16,%[dst],%[src],%[ctr],0\n" " brc 1,0b\n" /* handle partial completion */ - : [src]"+a" (r2), [len]"+d" (r3), - [dst]"+a" (r4), [ctr]"+a" (r6) - : [fc]"d" (r0), [pba]"a" (r1), [opc]"i" (CPACF_KMCTR ) - :"cc" ,"memory" ); + : [src]"+&d" (s.pair), [dst]"+&d" (d.pair), + [ctr]"+&d" (c.pair) + : [fc]"d" (func), [pba]"d" ((unsigned long )param), + [opc]"i" (CPACF_KMCTR ) + :"cc" ,"memory" ,"0" ,"1" ); -return src_len - r3; +return src_len - s.odd; }/**
@@ -417,20 +428,21 @@ static inline void cpacf_prno(unsigned long func, void *param, u8 *dest, unsigned long dest_len, const u8 *seed, unsigned long seed_len) { - register unsigned long r0 asm("0") = (unsigned long) func; - register unsigned long r1 asm("1") = (unsigned long) param; - register unsigned long r2 asm("2") = (unsigned long) dest; - register unsigned long r3 asm("3") = (unsigned long) dest_len; - register unsigned long r4 asm("4") = (unsigned long) seed; - register unsigned long r5 asm("5") = (unsigned long) seed_len; + union register_pair d, s; + d.even = (unsigned long )dest; + d.odd = (unsigned long )dest_len; + s.even = (unsigned long )seed; + s.odd = (unsigned long )seed_len; asmvolatile ( +" lgr 0,%[fc]\n" +" lgr 1,%[pba]\n" "0: .insn rre,%[opc] << 16,%[dst],%[seed]\n" " brc 1,0b\n" /* handle partial completion */ - : [dst]"+a" (r2), [dlen]"+d" (r3) - : [fc]"d" (r0), [pba]"a" (r1), - [seed]"a" (r4), [slen]"d" (r5), [opc]"i" (CPACF_PRNO ) - :"cc" ,"memory" ); + : [dst]"+&d" (d.pair) + : [fc]"d" (func), [pba]"d" ((unsigned long )param), + [seed]"d" (s.pair), [opc]"i" (CPACF_PRNO ) + :"cc" ,"memory" ,"0" ,"1" ); }/**
@@ -443,19 +455,19 @@ static inline void cpacf_prno(unsigned long func, void *param,static inline void cpacf_trng (u8 *ucbuf,unsigned long ucbuf_len,u8 *cbuf,unsigned long cbuf_len) { - register unsigned long r0 asm("0") = (unsigned long) CPACF_PRNO_TRNG; - register unsigned long r2 asm("2") = (unsigned long) ucbuf; - register unsigned long r3 asm("3") = (unsigned long) ucbuf_len; - register unsigned long r4 asm("4") = (unsigned long) cbuf; - register unsigned long r5 asm("5") = (unsigned long) cbuf_len; +union register_pair u, c; + u.even = (unsigned long )ucbuf; + u.odd = (unsigned long )ucbuf_len; + c.even = (unsigned long )cbuf; + c.odd = (unsigned long )cbuf_len; asmvolatile ( +" lghi 0,%[fc]\n" "0: .insn rre,%[opc] << 16,%[ucbuf],%[cbuf]\n" " brc 1,0b\n" /* handle partial completion */ - : [ucbuf]"+a" (r2), [ucbuflen]"+d" (r3), - [cbuf]"+a" (r4), [cbuflen]"+d" (r5) - : [fc]"d" (r0), [opc]"i" (CPACF_PRNO ) - :"cc" ,"memory" ); + : [ucbuf]"+&d" (u.pair), [cbuf]"+&d" (c.pair) + : [fc]"K" (CPACF_PRNO_TRNG ), [opc]"i" (CPACF_PRNO ) + :"cc" ,"memory" ,"0" ); }/**
@@ -466,15 +478,15 @@ static inline void cpacf_trng(u8 *ucbuf, unsigned long ucbuf_len,*/ static inline void cpacf_pcc (unsigned long func,void *param) { - register unsigned long r0 asm("0") = (unsigned long) func; - register unsigned long r1 asm("1") = (unsigned long) param; - asmvolatile ( +" lgr 0,%[fc]\n" +" lgr 1,%[pba]\n" "0: .insn rre,%[opc] << 16,0,0\n" /* PCC opcode */ " brc 1,0b\n" /* handle partial completion */ : - : [fc]"d" (r0), [pba]"a" (r1), [opc]"i" (CPACF_PCC ) - :"cc" ,"memory" ); + : [fc]"d" (func), [pba]"d" ((unsigned long )param), + [opc]"i" (CPACF_PCC ) + :"cc" ,"memory" ,"0" ,"1" ); }/**
@@ -487,14 +499,14 @@ static inline void cpacf_pcc(unsigned long func, void *param)*/ static inline void cpacf_pckmo (long func,void *param) { - register unsigned long r0 asm("0") = (unsigned long) func; - register unsigned long r1 asm("1") = (unsigned long) param; - asmvolatile ( +" lgr 0,%[fc]\n" +" lgr 1,%[pba]\n" " .insn rre,%[opc] << 16,0,0\n" /* PCKMO opcode */ : - : [fc]"d" (r0), [pba]"a" (r1), [opc]"i" (CPACF_PCKMO ) - :"cc" ,"memory" ); + : [fc]"d" (func), [pba]"d" ((unsigned long )param), + [opc]"i" (CPACF_PCKMO ) + :"cc" ,"memory" ,"0" ,"1" ); }/**
@@ -512,21 +524,23 @@ static inline void cpacf_kma(unsigned long func, void *param, u8 *dest, const u8 *src, unsigned long src_len, const u8 *aad, unsigned long aad_len) { - register unsigned long r0 asm("0") = (unsigned long) func; - register unsigned long r1 asm("1") = (unsigned long) param; - register unsigned long r2 asm("2") = (unsigned long) src; - register unsigned long r3 asm("3") = (unsigned long) src_len; - register unsigned long r4 asm("4") = (unsigned long) aad; - register unsigned long r5 asm("5") = (unsigned long) aad_len; - register unsigned long r6 asm("6") = (unsigned long) dest; + union register_pair d, s, a; + d.even = (unsigned long )dest; + s.even = (unsigned long )src; + s.odd = (unsigned long )src_len; + a.even = (unsigned long )aad; + a.odd = (unsigned long )aad_len; asmvolatile ( +" lgr 0,%[fc]\n" +" lgr 1,%[pba]\n" "0: .insn rrf,%[opc] << 16,%[dst],%[src],%[aad],0\n" " brc 1,0b\n" /* handle partial completion */ - : [dst]"+a" (r6), [src]"+a" (r2), [slen]"+d" (r3), - [aad]"+a" (r4), [alen]"+d" (r5) - : [fc]"d" (r0), [pba]"a" (r1), [opc]"i" (CPACF_KMA ) - :"cc" ,"memory" ); + : [dst]"+&d" (d.pair), [src]"+&d" (s.pair), + [aad]"+&d" (a.pair) + : [fc]"d" (func), [pba]"d" ((unsigned long )param), + [opc]"i" (CPACF_KMA ) + :"cc" ,"memory" ,"0" ,"1" ); }#endif /* _ASM_S390_CPACF_H */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 39/290 s390/cpacf: Split and rework cpacf query functions
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Harald Freudenberger <[email protected]>
[ Upstream commit 830999bd7e72f4128b9dfa37090d9fa8120ce323 ]
Rework the cpacf query functions to use the correct RRE or RRF instruction formats and set register fields within instructions correctly.
--- arch/s390/include/asm/cpacf.h | 101 +++++++++++++++++++++++++++------- 1 file changed, 81 insertions(+), 20 deletions(-)
arch/s390/include/asm/cpacf.h +81 -20
@@ -161,28 +161,79 @@typedef struct {unsigned char bytes[16 ]; }cpacf_mask_t ; -/** -* cpacf_query() - check if a specific CPACF function is available -* @opcode: the opcode of the crypto instruction -* @func: the function code to test for -* -* Executes the query function for the given crypto instruction @opcode -* and checks if @func is available -* -* Returns 1 if @func is available for @opcode, 0 otherwise -*/ -static __always_inline void __cpacf_query(unsigned int opcode, cpacf_mask_t *mask) +static __always_inline void __cpacf_query_rre(u32 opc, u8 r1, u8 r2, +cpacf_mask_t *mask) { asmvolatile ( -" lghi 0,0\n" /* query function */ -" lgr 1,%[mask]\n" -" spm 0\n" /* pckmo doesn't change the cc */ -/* Parameter regs are ignored, but must be nonzero and unique */ -"0: .insn rrf,%[opc] << 16,2,4,6,0\n" -" brc 1,0b\n" /* handle partial completion */ - :"=m" (*mask) - : [mask]"d" ((unsigned long )mask), [opc]"i" (opcode) - :"cc" ,"0" ,"1" ); +" la %%r1,%[mask]\n" +" xgr %%r0,%%r0\n" +" .insn rre,%[opc] << 16,%[r1],%[r2]\n" + : [mask]"=R" (*mask) + : [opc]"i" (opc), + [r1]"i" (r1), [r2]"i" (r2) + :"cc" ,"r0" ,"r1" ); +} + +static __always_inline void __cpacf_query_rrf(u32 opc, +u8 r1,u8 r2,u8 r3,u8 m4, +cpacf_mask_t *mask) +{ + asmvolatile ( +" la %%r1,%[mask]\n" +" xgr %%r0,%%r0\n" +" .insn rrf,%[opc] << 16,%[r1],%[r2],%[r3],%[m4]\n" + : [mask]"=R" (*mask) + : [opc]"i" (opc), [r1]"i" (r1), [r2]"i" (r2), + [r3]"i" (r3), [m4]"i" (m4) + :"cc" ,"r0" ,"r1" ); +} + +static __always_inline void __cpacf_query(unsigned int opcode, +cpacf_mask_t *mask) +{ +switch (opcode) { +case CPACF_KDSA : +__cpacf_query_rre (CPACF_KDSA ,0 ,2 , mask); +break ; +case CPACF_KIMD : +__cpacf_query_rre (CPACF_KIMD ,0 ,2 , mask); +break ; +case CPACF_KLMD : +__cpacf_query_rre (CPACF_KLMD ,0 ,2 , mask); +break ; +case CPACF_KM : +__cpacf_query_rre (CPACF_KM ,2 ,4 , mask); +break ; +case CPACF_KMA : +__cpacf_query_rrf (CPACF_KMA ,2 ,4 ,6 ,0 , mask); +break ; +case CPACF_KMAC : +__cpacf_query_rre (CPACF_KMAC ,0 ,2 , mask); +break ; +case CPACF_KMC : +__cpacf_query_rre (CPACF_KMC ,2 ,4 , mask); +break ; +case CPACF_KMCTR : +__cpacf_query_rrf (CPACF_KMCTR ,2 ,4 ,6 ,0 , mask); +break ; +case CPACF_KMF : +__cpacf_query_rre (CPACF_KMF ,2 ,4 , mask); +break ; +case CPACF_KMO : +__cpacf_query_rre (CPACF_KMO ,2 ,4 , mask); +break ; +case CPACF_PCC : +__cpacf_query_rre (CPACF_PCC ,0 ,0 , mask); +break ; +case CPACF_PCKMO : +__cpacf_query_rre (CPACF_PCKMO ,0 ,0 , mask); +break ; +case CPACF_PRNO : +__cpacf_query_rre (CPACF_PRNO ,2 ,4 , mask); +break ; +default : +BUG (); + } } static __always_inline int __cpacf_check_opcode(unsigned int opcode)
@@ -210,6 +261,16 @@ static __always_inline int __cpacf_check_opcode(unsigned int opcode) } } +/** +* cpacf_query() - check if a specific CPACF function is available +* @opcode: the opcode of the crypto instruction +* @func: the function code to test for +* +* Executes the query function for the given crypto instruction @opcode +* and checks if @func is available +* +* Returns 1 if @func is available for @opcode, 0 otherwise +*/ static __always_inline int cpacf_query(unsigned int opcode, cpacf_mask_t *mask) {if (__cpacf_check_opcode (opcode)) {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 40/290 btrfs: fix leak of qgroup extent records after transaction abort
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Filipe Manana <[email protected]>
[ Upstream commit fb33eb2ef0d88e75564983ef057b44c5b7e4fded ]
Qgroup extent records are created when delayed ref heads are created and then released after accounting extents at btrfs_qgroup_account_extents(), called during the transaction commit path.
If a transaction is aborted we free the qgroup records by calling btrfs_qgroup_destroy_extent_records() at btrfs_destroy_delayed_refs(), unless we don't have delayed references. We are incorrectly assuming that no delayed references means we don't have qgroup extents records.
We can currently have no delayed references because we ran them all during a transaction commit and the transaction was aborted after that due to some error in the commit path.
So fix this by ensuring we btrfs_qgroup_destroy_extent_records() at btrfs_destroy_delayed_refs() even if we don't have any delayed references.
--- fs/btrfs/disk-io.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)
fs/btrfs/disk-io.c +1 -9
@@ -4442,19 +4442,11 @@ static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans, struct btrfs_fs_info *fs_info) {struct rb_node *node; -struct btrfs_delayed_ref_root *delayed_refs; +struct btrfs_delayed_ref_root *delayed_refs = &trans->delayed_refs;struct btrfs_delayed_ref_node *ref;int ret =0 ; - delayed_refs = &trans->delayed_refs; -spin_lock (&delayed_refs->lock); -if (atomic_read (&delayed_refs->num_entries) ==0 ) { -spin_unlock (&delayed_refs->lock); -btrfs_debug (fs_info,"delayed_refs has NO entry" ); -return ret; - } -while ((node =rb_first_cached (&delayed_refs->href_root)) !=NULL ) {struct btrfs_delayed_ref_head *head;struct rb_node *n;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 41/290 nilfs2: Remove check for PageError
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Wilcox (Oracle) <[email protected]>
[ Upstream commit 79ea65563ad8aaab309d61eeb4d5019dd6cf5fa0 ]
If read_mapping_page() encounters an error, it returns an errno, not a page with PageError set, so this test is not needed.
Stable-dep-of: 7373a51e7998 ("nilfs2: fix nilfs_empty_dir() misjudgment and long loop on I/O errors")
--- fs/nilfs2/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nilfs2/dir.c +1 -1
@@ -194,7 +194,7 @@ static struct page *nilfs_get_page(struct inode *dir, unsigned long n)if (!IS_ERR (page)) {kmap (page);if (unlikely (!PageChecked (page))) { -if (PageError (page) || !nilfs_check_page (page)) +if (!nilfs_check_page (page)) goto fail; } }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 42/290 nilfs2: return the mapped address from nilfs_get_page()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Wilcox (Oracle) <[email protected]>
[ Upstream commit 09a46acb3697e50548bb265afa1d79163659dd85 ]
In prepartion for switching from kmap() to kmap_local(), return the kmap address from nilfs_get_page() instead of having the caller look up page_address().
Stable-dep-of: 7373a51e7998 ("nilfs2: fix nilfs_empty_dir() misjudgment and long loop on I/O errors")
--- fs/nilfs2/dir.c | 57 +++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 30 deletions(-)
fs/nilfs2/dir.c +27 -30
@@ -186,19 +186,24 @@ static bool nilfs_check_page(struct page *page)return false; } -static struct page *nilfs_get_page (struct inode *dir,unsigned long n) +static void *nilfs_get_page (struct inode *dir,unsigned long n, +struct page **pagep) {struct address_space *mapping = dir->i_mapping;struct page *page =read_mapping_page (mapping, n,NULL ); +void *kaddr; -if (!IS_ERR (page)) { -kmap (page); -if (unlikely (!PageChecked (page))) { -if (!nilfs_check_page (page)) - goto fail; - } +if (IS_ERR (page)) +return page; + + kaddr =kmap (page); +if (unlikely (!PageChecked (page))) { +if (!nilfs_check_page (page)) + goto fail; } -return page; + + *pagep = page; +return kaddr; fail:nilfs_put_page (page);
@@ -275,14 +280,14 @@ static int nilfs_readdir(struct file *file, struct dir_context *ctx)for ( ; n < npages; n++, offset =0 ) {char *kaddr, *limit;struct nilfs_dir_entry *de; -struct page *page =nilfs_get_page (inode, n); +struct page *page; -if (IS_ERR (page)) { + kaddr =nilfs_get_page (inode, n, &page); +if (IS_ERR (kaddr)) {nilfs_error (sb,"bad page in #%lu" , inode->i_ino); ctx->pos +=PAGE_SIZE - offset;return -EIO ; } - kaddr =page_address (page); de = (struct nilfs_dir_entry *)(kaddr + offset); limit = kaddr +nilfs_last_byte (inode, n) -NILFS_DIR_REC_LEN (1 );
@@ -345,11 +350,9 @@ nilfs_find_entry(struct inode *dir, const struct qstr *qstr, start =0 ; n = start; do { - char *kaddr; + char *kaddr = nilfs_get_page(dir, n, &page); - page = nilfs_get_page(dir, n); - if (!IS_ERR(page)) { - kaddr = page_address(page); + if (!IS_ERR(kaddr)) { de = (struct nilfs_dir_entry *)kaddr; kaddr += nilfs_last_byte(dir, n) - reclen; while ((char *) de <= kaddr) {
@@ -387,15 +390,11 @@ nilfs_find_entry(struct inode *dir, const struct qstr *qstr,struct nilfs_dir_entry *nilfs_dotdot (struct inode *dir,struct page **p) { -struct page *page =nilfs_get_page (dir,0 ); -struct nilfs_dir_entry *de =NULL ; +struct nilfs_dir_entry *de =nilfs_get_page (dir,0 , p); -if (!IS_ERR (page)) { - de =nilfs_next_entry ( - (struct nilfs_dir_entry *)page_address (page)); - *p = page; - } -return de; +if (IS_ERR (de)) +return NULL ; +return nilfs_next_entry (de); }ino_t nilfs_inode_by_name (struct inode *dir,const struct qstr *qstr)
@@ -459,12 +458,11 @@ int nilfs_add_link(struct dentry *dentry, struct inode *inode)for (n =0 ; n <= npages; n++) {char *dir_end; - page =nilfs_get_page (dir, n); - err =PTR_ERR (page); -if (IS_ERR (page)) + kaddr =nilfs_get_page (dir, n, &page); + err =PTR_ERR (kaddr); +if (IS_ERR (kaddr)) goto out;lock_page (page); - kaddr =page_address (page); dir_end = kaddr +nilfs_last_byte (dir, n); de = (struct nilfs_dir_entry *)kaddr; kaddr +=PAGE_SIZE - reclen;
@@ -627,11 +625,10 @@ int nilfs_empty_dir(struct inode *inode)char *kaddr;struct nilfs_dir_entry *de; - page =nilfs_get_page (inode, i); -if (IS_ERR (page)) + kaddr =nilfs_get_page (inode, i, &page); +if (IS_ERR (kaddr))continue ; - kaddr =page_address (page); de = (struct nilfs_dir_entry *)kaddr; kaddr +=nilfs_last_byte (inode, i) -NILFS_DIR_REC_LEN (1 );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 43/290 nilfs2: fix nilfs_empty_dir() misjudgment and long loop on I/O errors
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ryusuke Konishi <[email protected]>
[ Upstream commit 7373a51e7998b508af7136530f3a997b286ce81c ]
The error handling in nilfs_empty_dir() when a directory folio/page read fails is incorrect, as in the old ext2 implementation, and if the folio/page cannot be read or nilfs_check_folio() fails, it will falsely determine the directory as empty and corrupt the file system.
In addition, since nilfs_empty_dir() does not immediately return on a failed folio/page read, but continues to loop, this can cause a long loop with I/O if i_size of the directory's inode is also corrupted, causing the log writer thread to wait and hang, as reported by syzbot.
Fix these issues by making nilfs_empty_dir() immediately return a false value (0) if it fails to get a directory folio/page.
--- fs/nilfs2/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nilfs2/dir.c +1 -1
@@ -627,7 +627,7 @@ int nilfs_empty_dir(struct inode *inode) kaddr =nilfs_get_page (inode, i, &page);if (IS_ERR (kaddr)) -continue ; +return 0 ; de = (struct nilfs_dir_entry *)kaddr; kaddr +=nilfs_last_byte (inode, i) -NILFS_DIR_REC_LEN (1 );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 44/290 USB: class: cdc-wdm: Fix CPU lockup caused by excessive log messages
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 22f00812862564b314784167a89f27b444f82a46 upstream.
The syzbot fuzzer found that the interrupt-URB completion callback in the cdc-wdm driver was taking too long, and the driver's immediate resubmission of interrupt URBs with -EPROTO status combined with the dummy-hcd emulation to cause a CPU lockup:
cdc_wdm 1-1:1.0: nonzero urb status received: -71cdc_wdm 1-1:1.0: wdm_int_callback - 0 bytes
watchdog: BUG: soft lockup - CPU#0 stuck for 26s! [syz-executor782:6625] CPU#0 Utilization every 4s during lockup: #1: 98% system, 0% softirq, 3% hardirq, 0% idle #2: 98% system, 0% softirq, 3% hardirq, 0% idle #3: 98% system, 0% softirq, 3% hardirq, 0% idle #4: 98% system, 0% softirq, 3% hardirq, 0% idle #5: 98% system, 1% softirq, 3% hardirq, 0% idle Modules linked in: irq event stamp: 73096 hardirqs last enabled at (73095): [<ffff80008037bc00>] console_emit_next_record kernel/printk/printk.c:2935 [inline] hardirqs last enabled at (73095): [<ffff80008037bc00>] console_flush_all+0x650/0xb74 kernel/printk/printk.c:2994 hardirqs last disabled at (73096): [<ffff80008af10b00>] __el1_irq arch/arm64/kernel/entry-common.c:533 [inline] hardirqs last disabled at (73096): [<ffff80008af10b00>] el1_interrupt+0x24/0x68 arch/arm64/kernel/entry-common.c:551 softirqs last enabled at (73048): [<ffff8000801ea530>] softirq_handle_end kernel/softirq.c:400 [inline] softirqs last enabled at (73048): [<ffff8000801ea530>] handle_softirqs+0xa60/0xc34 kernel/softirq.c:582 softirqs last disabled at (73043): [<ffff800080020de8>] __do_softirq+0x14/0x20 kernel/softirq.c:588 CPU: 0 PID: 6625 Comm: syz-executor782 Tainted: G W 6.10.0-rc2-syzkaller-g8867bbd4a056 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
Testing showed that the problem did not occur if the two error messages -- the first two lines above -- were removed; apparently adding material to the kernel log takes a surprisingly large amount of time.
In any case, the best approach for preventing these lockups and to avoid spamming the log with thousands of error messages per second is to ratelimit the two dev_err() calls. Therefore we replace them with dev_err_ratelimited().
--- drivers/usb/class/cdc-wdm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/class/cdc-wdm.c +2 -2
@@ -252,14 +252,14 @@ static void wdm_int_callback(struct urbdev_err (&desc->intf->dev,"Stall on int endpoint\n" ); goto sw;/* halt is cleared in work */ default : -dev_err (&desc->intf->dev, +dev_err_ratelimited (&desc->intf->dev,"nonzero urb status received: %d\n" , status);break ; } }if (urb->actual_length <sizeof (struct usb_cdc_notification )) { -dev_err (&desc->intf->dev,"wdm_int_callback - %d bytes\n" , +dev_err_ratelimited (&desc->intf->dev,"wdm_int_callback - %d bytes\n" , urb->actual_length); goto exit; }
Greg Kroah-Hartman
maintainerPATCH 45/290 mei: me: release irq in mei_me_pci_resume error path
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomas Winkler <[email protected]>
commit 283cb234ef95d94c61f59e1cd070cd9499b51292 upstream.
The mei_me_pci_resume doesn't release irq on the error path, in case mei_start() fails.
--- drivers/misc/mei/pci-me.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/misc/mei/pci-me.c +3 -1
@@ -400,8 +400,10 @@ static int mei_me_pci_resume(struct devi } err =mei_restart (dev); -if (err) +if (err) { +free_irq (pdev->irq, dev);return err; + }/* Start timer if stopped in suspend */ schedule_delayed_work (&dev->timer_work,HZ );
Greg Kroah-Hartman
maintainerPATCH 46/290 jfs: xattr: fix buffer overflow for invalid xattr
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <[email protected]>
commit 7c55b78818cfb732680c4a72ab270cc2d2ee3d0f upstream.
When an xattr size is not what is expected, it is printed out to the kernel log in hex format as a form of debugging. But when that xattr size is bigger than the expected size, printing it out can cause an access off the end of the buffer.
Fix this all up by properly restricting the size of the debug hex dump in the kernel log.
--- fs/jfs/xattr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/jfs/xattr.c +3 -1
@@ -557,9 +557,11 @@ static int ea_get(struct inode *inode, s size_check:if (EALIST_SIZE (ea_buf->xattr) != ea_size) { +int size =min_t (int,EALIST_SIZE (ea_buf->xattr), ea_size); +printk (KERN_ERR "ea_get: invalid extended attribute\n" );print_hex_dump (KERN_ERR ,"" ,DUMP_PREFIX_ADDRESS ,16 ,1 , - ea_buf->xattr, ea_size,1 ); + ea_buf->xattr, size,1 );ea_release (inode, ea_buf); rc = -EIO ; goto clean_up;
Greg Kroah-Hartman
maintainerPATCH 47/290 xhci: Set correct transferred length for cancelled bulk transfers
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 f0260589b439e2637ad54a2b25f00a516ef28a57 upstream.
The transferred length is set incorrectly for cancelled bulk transfer TDs in case the bulk transfer ring stops on the last transfer block with a 'Stop - Length Invalid' completion code.
length essentially ends up being set to the requested length:urb->actual_length = urb->transfer_buffer_length
Length for 'Stop - Length Invalid' cases should be the sum of all TRB transfer block lengths up to the one the ring stopped on, _excluding_ the one stopped on.
Fix this by always summing up TRB lengths for 'Stop - Length Invalid' bulk cases.
This issue was discovered by Alan Stern while debugging
https://bugzilla.kernel.org/show_bug.cgi?id=218890, but does not solve that bug. Issue is older than 4.10 kernel but fix won't apply to those due to major reworks in that area.
--- drivers/usb/host/xhci-ring.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/usb/host/xhci-ring.c +2 -3
@@ -2386,9 +2386,8 @@ static int process_bulk_intr_td(struct x goto finish_td;case COMP_STOPPED_LENGTH_INVALID :/* stopped on ep trb with invalid length, exclude it */ - ep_trb_len =0 ; - remaining =0 ; -break ; + td->urb->actual_length =sum_trb_lengths (xhci, ep_ring, ep_trb); + goto finish_td;case COMP_USB_TRANSACTION_ERROR : if (xhci->quirks & XHCI_NO_SOFT_RETRY || (ep->err_count++ > MAX_SOFT_RETRY) ||
Greg Kroah-Hartman
maintainerPATCH 21/290 af_unix: Annotate data-races around sk->sk_state in unix_write_space() and poll().
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 eb0718fb3e97ad0d6f4529b810103451c90adf94 ]
unix_poll() and unix_dgram_poll() read sk->sk_state locklessly and calls unix_writable() which also reads sk->sk_state without holding unix_state_lock().
Let's use READ_ONCE() in unix_poll() and unix_dgram_poll() and pass it to unix_writable().
While at it, we remove TCP_SYN_SENT check in unix_dgram_poll() as that state does not exist for AF_UNIX socket since the code was added.
--- net/unix/af_unix.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-)
net/unix/af_unix.c +12 -13
@@ -447,9 +447,9 @@ static int unix_dgram_peer_wake_me(struct sock *sk, struct sock *other)return 0 ; } -static int unix_writable (const struct sock *sk) +static int unix_writable (const struct sock *sk,unsigned char state) { -return sk->sk_state !=TCP_LISTEN && +return state !=TCP_LISTEN && (refcount_read (&sk->sk_wmem_alloc) <<2 ) <= sk->sk_sndbuf; }
@@ -458,7 +458,7 @@ static void unix_write_space(struct sock *sk)struct socket_wq *wq;rcu_read_lock (); -if (unix_writable (sk)) { +if (unix_writable (sk,READ_ONCE (sk->sk_state))) { wq =rcu_dereference (sk->sk_wq);if (skwq_has_sleeper (wq)) wake_up_interruptible_sync_poll(&wq->wait,
@@ -2713,12 +2713,14 @@ static int unix_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned lonstatic __poll_t unix_poll (struct file *file,struct socket *sock,poll_table *wait) {struct sock *sk = sock->sk; +unsigned char state;__poll_t mask;u8 shutdown;sock_poll_wait (file, sock, wait); mask =0 ; shutdown =READ_ONCE (sk->sk_shutdown); + state =READ_ONCE (sk->sk_state);/* exceptional events? */ if (sk->sk_err)
@@ -2734,14 +2736,14 @@ static __poll_t unix_poll(struct file *file, struct socket *sock, poll_table *wa/* Connection-based need to check for termination and startup */ if ((sk->sk_type ==SOCK_STREAM || sk->sk_type ==SOCK_SEQPACKET ) && - sk->sk_state ==TCP_CLOSE ) + state ==TCP_CLOSE ) mask |=EPOLLHUP ;/* * we set writable also when the other side has shut down the * connection. This prevents stuck sockets. */ -if (unix_writable (sk)) +if (unix_writable (sk, state)) mask |=EPOLLOUT |EPOLLWRNORM |EPOLLWRBAND ;return mask;
@@ -2752,12 +2754,14 @@ static __poll_t unix_dgram_poll(struct file *file, struct socket *sock, {struct sock *sk = sock->sk, *other;unsigned int writable; +unsigned char state;__poll_t mask;u8 shutdown;sock_poll_wait (file, sock, wait); mask =0 ; shutdown =READ_ONCE (sk->sk_shutdown); + state =READ_ONCE (sk->sk_state);/* exceptional events? */ if (sk->sk_err || !skb_queue_empty_lockless (&sk->sk_error_queue))
@@ -2774,19 +2778,14 @@ static __poll_t unix_dgram_poll(struct file *file, struct socket *sock, mask |=EPOLLIN |EPOLLRDNORM ;/* Connection-based need to check for termination and startup */ -if (sk->sk_type ==SOCK_SEQPACKET ) { -if (sk->sk_state ==TCP_CLOSE ) - mask |=EPOLLHUP ; -/* connection hasn't started yet? */ -if (sk->sk_state ==TCP_SYN_SENT ) -return mask; - } +if (sk->sk_type ==SOCK_SEQPACKET && state ==TCP_CLOSE ) + mask |=EPOLLHUP ;/* No write status requested, avoid expensive OUT tests. */ if (!(poll_requested_events (wait) & (EPOLLWRBAND |EPOLLWRNORM |EPOLLOUT )))return mask; - writable =unix_writable (sk); + writable =unix_writable (sk, state);if (writable) {unix_state_lock (sk);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 48/290 xhci: Apply reset resume quirk to Etron EJ188 xHCI host
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuangyi Chiang <[email protected]>
commit 17bd54555c2aaecfdb38e2734149f684a73fa584 upstream.
As described in commit c877b3b2ad5c ("xhci: Add reset on resume quirk for asrock p67 host"), EJ188 have the same issue as EJ168, where completely dies on resume. So apply XHCI_RESET_ON_RESUME quirk to EJ188 as well.
--- drivers/usb/host/xhci-pci.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/usb/host/xhci-pci.c +5 -0
@@ -35,6 +35,7 @@#define PCI_VENDOR_ID_ETRON 0x1b6f#define PCI_DEVICE_ID_EJ168 0x7023 +#define PCI_DEVICE_ID_EJ188 0x7052#define PCI_DEVICE_ID_INTEL_LYNXPOINT_XHCI 0x8c31#define PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI 0x9c31
@@ -270,6 +271,10 @@ static void xhci_pci_quirks(struct devic xhci->quirks |=XHCI_TRUST_TX_LENGTH ; xhci->quirks |=XHCI_BROKEN_STREAMS ; } +if (pdev->vendor ==PCI_VENDOR_ID_ETRON && + pdev->device ==PCI_DEVICE_ID_EJ188 ) + xhci->quirks |=XHCI_RESET_ON_RESUME ; +if (pdev->vendor ==PCI_VENDOR_ID_RENESAS && pdev->device ==0x0014 ) { xhci->quirks |=XHCI_TRUST_TX_LENGTH ;
Greg Kroah-Hartman
maintainerPATCH 49/290 xhci: Apply broken streams quirk to Etron EJ188 xHCI host
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuangyi Chiang <[email protected]>
commit 91f7a1524a92c70ffe264db8bdfa075f15bbbeb9 upstream.
As described in commit 8f873c1ff4ca ("xhci: Blacklist using streams on the Etron EJ168 controller"), EJ188 have the same issue as EJ168, where Streams do not work reliable on EJ188. So apply XHCI_BROKEN_STREAMS quirk to EJ188 as well.
--- drivers/usb/host/xhci-pci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/host/xhci-pci.c +3 -1
@@ -272,8 +272,10 @@ static void xhci_pci_quirks(struct devic xhci->quirks |=XHCI_BROKEN_STREAMS ; }if (pdev->vendor ==PCI_VENDOR_ID_ETRON && - pdev->device ==PCI_DEVICE_ID_EJ188 ) + pdev->device ==PCI_DEVICE_ID_EJ188 ) { xhci->quirks |=XHCI_RESET_ON_RESUME ; + xhci->quirks |=XHCI_BROKEN_STREAMS ; + }if (pdev->vendor ==PCI_VENDOR_ID_RENESAS && pdev->device ==0x0014 ) {
Greg Kroah-Hartman
maintainerPATCH 50/290 scsi: mpt3sas: Avoid test/set_bit() operating in non-allocated memory
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Breno Leitao <[email protected]>
commit 4254dfeda82f20844299dca6c38cbffcfd499f41 upstream.
There is a potential out-of-bounds access when using test_bit() on a single word. The test_bit() and set_bit() functions operate on long values, and when testing or setting a single word, they can exceed the word boundary. KASAN detects this issue and produces a dump:
BUG: KASAN: slab-out-of-bounds in _scsih_add_device.constprop.0 (./arch/x86/include/asm/bitops.h:60 ./include/asm-generic/bitops/instrumented-atomic.h:29 drivers/scsi/mpt3sas/mpt3sas_scsih.c:7331) mpt3sas Write of size 8 at addr ffff8881d26e3c60 by task kworker/u1536:2/2965
For full log, please look at [1].
Make the allocation at least the size of sizeof(unsigned long) so that set_bit() and test_bit() have sufficient room for read/write operations without overwriting unallocated memory.
[1] Link: https://lore.kernel.org/all/[email protected]/
--- drivers/scsi/mpt3sas/mpt3sas_base.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
drivers/scsi/mpt3sas/mpt3sas_base.c +19 -0
@@ -7440,6 +7440,12 @@ mpt3sas_base_attach(struct MPT3SAS_ADAPT ioc->pd_handles_sz = (ioc->facts.MaxDevHandle /8 );if (ioc->facts.MaxDevHandle %8 ) ioc->pd_handles_sz++; +/* +* pd_handles_sz should have, at least, the minimal room for +* set_bit()/test_bit(), otherwise out-of-memory touch may occur. +*/ + ioc->pd_handles_sz =ALIGN (ioc->pd_handles_sz,sizeof (unsigned long )); + ioc->pd_handles =kzalloc (ioc->pd_handles_sz,GFP_KERNEL );if (!ioc->pd_handles) {
@@ -7457,6 +7463,13 @@ mpt3sas_base_attach(struct MPT3SAS_ADAPT ioc->pend_os_device_add_sz = (ioc->facts.MaxDevHandle /8 );if (ioc->facts.MaxDevHandle %8 ) ioc->pend_os_device_add_sz++; + +/* +* pend_os_device_add_sz should have, at least, the minimal room for +* set_bit()/test_bit(), otherwise out-of-memory may occur. +*/ + ioc->pend_os_device_add_sz =ALIGN (ioc->pend_os_device_add_sz, +sizeof (unsigned long )); ioc->pend_os_device_add =kzalloc (ioc->pend_os_device_add_sz,GFP_KERNEL );if (!ioc->pend_os_device_add) {
@@ -7747,6 +7760,12 @@ _base_check_ioc_facts_changes(struct MPTif (ioc->facts.MaxDevHandle %8 ) pd_handles_sz++; +/* +* pd_handles should have, at least, the minimal room for +* set_bit()/test_bit(), otherwise out-of-memory touch may +* occur. +*/ + pd_handles_sz =ALIGN (pd_handles_sz,sizeof (unsigned long )); pd_handles =krealloc (ioc->pd_handles, pd_handles_sz,GFP_KERNEL );if (!pd_handles) {
Greg Kroah-Hartman
maintainerPATCH 51/290 powerpc/uaccess: Fix build errors seen with GCC 13/14
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Ellerman <[email protected]>
commit 2d43cc701b96f910f50915ac4c2a0cae5deb734c upstream.
Building ppc64le_defconfig with GCC 14 fails with assembler errors:
CC fs/readdir.o
/tmp/ccdQn0mD.s: Assembler messages:
/tmp/ccdQn0mD.s:212: Error: operand out of domain (18 is not a multiple of 4) /tmp/ccdQn0mD.s:226: Error: operand out of domain (18 is not a multiple of 4) ... [6 lines]
/tmp/ccdQn0mD.s:1699: Error: operand out of domain (18 is not a multiple of 4)
A snippet of the asm shows:
# ../fs/readdir.c:210: unsafe_copy_dirent_name(dirent->d_name, name, namlen, efault_end);
ld 9,0(29) # MEM[(u64 *)name_38(D) + _88 * 1], MEM[(u64 *)name_38(D) + _88 * 1]
# 210 "../fs/readdir.c" 1
1: std 9,18(8) # put_user # *__pus_addr_52, MEM[(u64 *)name_38(D) + _88 * 1]The 'std' instruction requires a 4-byte aligned displacement because it is a DS-form instruction, and as the assembler says, 18 is not a multiple of 4.
A similar error is seen with GCC 13 and CONFIG_UBSAN_SIGNED_WRAP=y.
The fix is to change the constraint on the memory operand to put_user(), from "m" which is a general memory reference to "YZ".
The "Z" constraint is documented in the GCC manual PowerPC machine constraints, and specifies a "memory operand accessed with indexed or indirect addressing". "Y" is not documented in the manual but specifies a "memory operand for a DS-form instruction". Using both allows the compiler to generate a DS-form "std" or X-form "stdx" as appropriate.
The change has to be conditional on CONFIG_PPC_KERNEL_PREFIXED because the "Y" constraint does not guarantee 4-byte alignment when prefixed instructions are enabled.
Unfortunately clang doesn't support the "Y" constraint so that has to be behind an ifdef.
Although the build error is only seen with GCC 13/14, that appears to just be luck. The constraint has been incorrect since it was first added.
--- arch/powerpc/include/asm/uaccess.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
arch/powerpc/include/asm/uaccess.h +13 -2
@@ -186,9 +186,20 @@ do { \ : \ : label) +#ifdef CONFIG_CC_IS_CLANG +#define DS_FORM_CONSTRAINT "Z<>" +#else +#define DS_FORM_CONSTRAINT "YZ<>" +#endif +#ifdef __powerpc64__ -#define __put_user_asm2_goto (x, ptr, label) \ - __put_user_asm_goto(x, ptr, label, "std") +#define __put_user_asm2_goto (x, addr, label) \ + asm goto ("1: std%U1%X1 %0,%1 # put_user\n" \ + EX_TABLE(1b, %l2) \ + : \ + : "r" (x), DS_FORM_CONSTRAINT (*addr) \ + : \ + : label)#else /* __powerpc64__ */ #define __put_user_asm2_goto (x, addr, label) \ asm_volatile_goto( \
Greg Kroah-Hartman
maintainerPATCH 22/290 af_unix: Annotate data-races around sk->sk_state in sendmsg() and recvmsg().
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 8a34d4e8d9742a24f74998f45a6a98edd923319b ]
The following functions read sk->sk_state locklessly and proceed only if the state is TCP_ESTABLISHED.
* unix_stream_sendmsg
* unix_stream_read_generic
* unix_seqpacket_sendmsg
* unix_seqpacket_recvmsg
Let's use READ_ONCE() there.
--- net/unix/af_unix.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
net/unix/af_unix.c +4 -4
@@ -1909,7 +1909,7 @@ static int unix_stream_sendmsg(struct socket *sock, struct msghdr *msg, goto out_err;if (msg->msg_namelen) { - err = sk->sk_state ==TCP_ESTABLISHED ? -EISCONN : -EOPNOTSUPP ; + err =READ_ONCE (sk->sk_state) ==TCP_ESTABLISHED ? -EISCONN : -EOPNOTSUPP ; goto out_err; }else { err = -ENOTCONN ;
@@ -2112,7 +2112,7 @@ static int unix_seqpacket_sendmsg(struct socket *sock, struct msghdr *msg,if (err)return err; -if (sk->sk_state !=TCP_ESTABLISHED ) +if (READ_ONCE (sk->sk_state) !=TCP_ESTABLISHED )return -ENOTCONN ;if (msg->msg_namelen)
@@ -2126,7 +2126,7 @@ static int unix_seqpacket_recvmsg(struct socket *sock, struct msghdr *msg, {struct sock *sk = sock->sk; -if (sk->sk_state !=TCP_ESTABLISHED ) +if (READ_ONCE (sk->sk_state) !=TCP_ESTABLISHED )return -ENOTCONN ;return unix_dgram_recvmsg (sock, msg, size, flags);
@@ -2326,7 +2326,7 @@ static int unix_stream_read_generic(struct unix_stream_read_state *state,size_t size = state->size;unsigned int last_len; -if (unlikely (sk->sk_state !=TCP_ESTABLISHED )) { +if (unlikely (READ_ONCE (sk->sk_state) !=TCP_ESTABLISHED )) { err = -EINVAL ; goto out; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 23/290 af_unix: Annotate data-races around sk->sk_state in UNIX_DIAG.
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 0aa3be7b3e1f8f997312cc4705f8165e02806f8f ]
While dumping AF_UNIX sockets via UNIX_DIAG, sk->sk_state is read locklessly.
Let's use READ_ONCE() there.
Note that the result could be inconsistent if the socket is dumped during the state change. This is common for other SOCK_DIAG and similar interfaces.
--- net/unix/diag.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
net/unix/diag.c +4 -4
@@ -64,7 +64,7 @@ static int sk_diag_dump_icons(struct sock *sk, struct sk_buff *nlskb)u32 *buf;int i; -if (sk->sk_state ==TCP_LISTEN ) { +if (READ_ONCE (sk->sk_state) ==TCP_LISTEN ) {spin_lock (&sk->sk_receive_queue.lock); attr = nla_reserve(nlskb, UNIX_DIAG_ICONS,
@@ -102,7 +102,7 @@ static int sk_diag_show_rqlen(struct sock *sk, struct sk_buff *nlskb) {struct unix_diag_rqlen rql; -if (sk->sk_state ==TCP_LISTEN ) { +if (READ_ONCE (sk->sk_state) ==TCP_LISTEN ) { rql.udiag_rqueue = sk->sk_receive_queue.qlen; rql.udiag_wqueue = sk->sk_max_ack_backlog; }else {
@@ -135,7 +135,7 @@ static int sk_diag_fill(struct sock *sk, struct sk_buff *skb, struct unix_diag_r rep =nlmsg_data (nlh); rep->udiag_family =AF_UNIX ; rep->udiag_type = sk->sk_type; - rep->udiag_state = sk->sk_state; + rep->udiag_state =READ_ONCE (sk->sk_state); rep->pad =0 ; rep->udiag_ino = sk_ino;sock_diag_save_cookie (sk, rep->udiag_cookie);
@@ -218,7 +218,7 @@ static int unix_diag_dump(struct sk_buff *skb, struct netlink_callback *cb)continue ;if (num < s_num) goto next; -if (!(req->udiag_states & (1 << sk->sk_state))) +if (!(req->udiag_states & (1 <<READ_ONCE (sk->sk_state)))) goto next; if (sk_diag_dump(sk, skb, req, sk_user_ns(skb->sk), NETLINK_CB(cb->skb).portid,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 24/290 af_unix: Annotate data-race of net->unx.sysctl_max_dgram_qlen.
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 bd9f2d05731f6a112d0c7391a0d537bfc588dbe6 ]
net->unx.sysctl_max_dgram_qlen is exposed as a sysctl knob and can be changed concurrently.
Let's use READ_ONCE() in unix_create1().
--- net/unix/af_unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/unix/af_unix.c +1 -1
@@ -815,7 +815,7 @@ static struct sock *unix_create1(struct net *net, struct socket *sock, int kern) sk->sk_allocation =GFP_KERNEL_ACCOUNT ; sk->sk_write_space = unix_write_space; - sk->sk_max_ack_backlog = net->unx.sysctl_max_dgram_qlen; + sk->sk_max_ack_backlog =READ_ONCE (net->unx.sysctl_max_dgram_qlen); sk->sk_destruct = unix_sock_destructor; u =unix_sk (sk); u->inflight =0 ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 25/290 af_unix: Use unix_recvq_full_lockless() in unix_stream_connect().
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 45d872f0e65593176d880ec148f41ad7c02e40a7 ]
Once sk->sk_state is changed to TCP_LISTEN, it never changes.
unix_accept() takes advantage of this characteristics; it does not hold the listener's unix_state_lock() and only acquires recvq lock to pop one skb.
It means unix_state_lock() does not prevent the queue length from changing in unix_stream_connect().
Thus, we need to use unix_recvq_full_lockless() to avoid data-race.
Now we remove unix_recvq_full() as no one uses it.
Note that we can remove READ_ONCE() for sk->sk_max_ack_backlog in unix_recvq_full_lockless() because of the following reasons:
(1) For SOCK_DGRAM, it is a written-once field in unix_create1()
(2) For SOCK_STREAM and SOCK_SEQPACKET, it is changed under the listener's unix_state_lock() in unix_listen(), and we hold the lock in unix_stream_connect()
--- net/unix/af_unix.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
net/unix/af_unix.c +2 -8
@@ -189,15 +189,9 @@ static inline int unix_may_send(struct sock *sk, struct sock *osk)return unix_peer (osk) ==NULL ||unix_our_peer (sk, osk); } -static inline int unix_recvq_full (const struct sock *sk) -{ -return skb_queue_len (&sk->sk_receive_queue) > sk->sk_max_ack_backlog; -} -static inline int unix_recvq_full_lockless (const struct sock *sk) { -return skb_queue_len_lockless (&sk->sk_receive_queue) > -READ_ONCE (sk->sk_max_ack_backlog); +return skb_queue_len_lockless (&sk->sk_receive_queue) > sk->sk_max_ack_backlog; }struct sock *unix_peer_get (struct sock *s)
@@ -1310,7 +1304,7 @@ static int unix_stream_connect(struct socket *sock, struct sockaddr *uaddr,if (other->sk_shutdown &RCV_SHUTDOWN ) goto out_unlock; -if (unix_recvq_full (other)) { +if (unix_recvq_full_lockless (other)) { err = -EAGAIN ;if (!timeo) goto out_unlock;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 26/290 af_unix: Use skb_queue_len_lockless() in sk_diag_show_rqlen().
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 5d915e584d8408211d4567c22685aae8820bfc55 ]
We can dump the socket queue length via UNIX_DIAG by specifying UDIAG_SHOW_RQLEN.
If sk->sk_state is TCP_LISTEN, we return the recv queue length, but here we do not hold recvq lock.
Let's use skb_queue_len_lockless() in sk_diag_show_rqlen().
--- net/unix/diag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/unix/diag.c +1 -1
@@ -103,7 +103,7 @@ static int sk_diag_show_rqlen(struct sock *sk, struct sk_buff *nlskb)struct unix_diag_rqlen rql;if (READ_ONCE (sk->sk_state) ==TCP_LISTEN ) { - rql.udiag_rqueue = sk->sk_receive_queue.qlen; + rql.udiag_rqueue =skb_queue_len_lockless (&sk->sk_receive_queue); rql.udiag_wqueue = sk->sk_max_ack_backlog; }else { rql.udiag_rqueue = (u32 )unix_inq_len (sk);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 27/290 af_unix: Annotate data-race of sk->sk_shutdown in sk_diag_fill().
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 efaf24e30ec39ebbea9112227485805a48b0ceb1 ]
While dumping sockets via UNIX_DIAG, we do not hold unix_state_lock().
Let's use READ_ONCE() to read sk->sk_shutdown.
--- net/unix/diag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/unix/diag.c +1 -1
@@ -164,7 +164,7 @@ static int sk_diag_fill(struct sock *sk, struct sk_buff *skb, struct unix_diag_r sock_diag_put_meminfo(sk, skb, UNIX_DIAG_MEMINFO)) goto out_nlmsg_trim; -if (nla_put_u8 (skb,UNIX_DIAG_SHUTDOWN , sk->sk_shutdown)) +if (nla_put_u8 (skb,UNIX_DIAG_SHUTDOWN ,READ_ONCE (sk->sk_shutdown))) goto out_nlmsg_trim; if ((req->udiag_show & UDIAG_SHOW_UID) &&
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 18/290 net/sched: taprio: always validate TCA_TAPRIO_ATTR_PRIOMAP
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 f921a58ae20852d188f70842431ce6519c4fdc36 ]
If one TCA_TAPRIO_ATTR_PRIOMAP attribute has been provided, taprio_parse_mqprio_opt() must validate it, or userspace can inject arbitrary data to the kernel, the second time taprio_change() is called.
First call (with valid attributes) sets dev->num_tc to a non zero value.
Second call (with arbitrary mqprio attributes)
returns early from taprio_parse_mqprio_opt()
and bad things can happen.
--- net/sched/sch_taprio.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
net/sched/sch_taprio.c +6 -9
@@ -925,16 +925,13 @@ static int taprio_parse_mqprio_opt(struct net_device *dev, {int i, j; -if (!qopt && !dev->num_tc) { -NL_SET_ERR_MSG (extack,"'mqprio' configuration is necessary" ); -return -EINVAL ; - } - -/* If num_tc is already set, it means that the user already -* configured the mqprio part -*/ -if (dev->num_tc) +if (!qopt) { +if (!dev->num_tc) { +NL_SET_ERR_MSG (extack,"'mqprio' configuration is necessary" ); +return -EINVAL ; + }return 0 ; + }/* Verify num_tc is not out of max range */ if (qopt->num_tc >TC_MAX_QUEUE ) {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 53/290 SUNRPC: return proper error from gss_wrap_req_priv
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Hanxiao <[email protected]>
[ Upstream commit 33c94d7e3cb84f6d130678d6d59ba475a6c489cf ]
don't return 0 if snd_buf->len really greater than snd_buf->buflen
--- net/sunrpc/auth_gss/auth_gss.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/sunrpc/auth_gss/auth_gss.c +3 -1
@@ -1855,8 +1855,10 @@ gss_wrap_req_priv(struct rpc_cred *cred, struct gss_cl_ctx *ctx, offset = (u8 *)p - (u8 *)snd_buf->head[0 ].iov_base; maj_stat =gss_wrap (ctx->gc_gss_ctx, offset, snd_buf, inpages);/* slack space should prevent this ever happening: */ -if (unlikely (snd_buf->len > snd_buf->buflen)) +if (unlikely (snd_buf->len > snd_buf->buflen)) { + status = -EIO ; goto wrap_failed; + }/* We're assuming that when GSS_S_CONTEXT_EXPIRED, the encryption was * done anyway, so it's safe to put the request on the wire: */ if (maj_stat ==GSS_S_CONTEXT_EXPIRED )
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 62/290 net: sfp: Always call `sfp_sm_mod_remove()` on remove
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Csókás, Bence <[email protected]>
[ Upstream commit e96b2933152fd87b6a41765b2f58b158fde855b6 ]
If the module is in SFP_MOD_ERROR, sfp_sm_mod_remove() will not be run. As a consequence, sfp_hwmon_remove() is not getting run either, leaving a stale hwmon device behind. sfp_sm_mod_remove() itself checks sfp->sm_mod_state anyways, so this check was not really needed in the first place.
--- drivers/net/phy/sfp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/phy/sfp.c +1 -2
@@ -1952,8 +1952,7 @@ static void sfp_sm_module(struct sfp *sfp, unsigned int event)/* Handle remove event globally, it resets this state machine */ if (event ==SFP_E_REMOVE ) { -if (sfp->sm_mod_state >SFP_MOD_PROBE ) -sfp_sm_mod_remove (sfp); +sfp_sm_mod_remove (sfp);sfp_sm_mod_next (sfp,SFP_MOD_EMPTY ,0 );return ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 63/290 net: hns3: add cond_resched() to hns3 ring buffer init process
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jie Wang <[email protected]>
[ Upstream commit 968fde83841a8c23558dfbd0a0c69d636db52b55 ]
Currently hns3 ring buffer init process would hold cpu too long with big Tx/Rx ring depth. This could cause soft lockup.
So this patch adds cond_resched() to the process. Then cpu can break to run other tasks instead of busy looping.
--- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 4 ++++ drivers/net/ethernet/hisilicon/hns3/hns3_enet.h | 2 ++ 2 files changed, 6 insertions(+)
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +4 -0
@@ -2513,6 +2513,9 @@ static int hns3_alloc_ring_buffers(struct hns3_enet_ring *ring) ret =hns3_alloc_and_attach_buffer (ring, i);if (ret) goto out_buffer_fail; + +if (!(i %HNS3_RESCHED_BD_NUM )) +cond_resched (); }return 0 ;
@@ -3946,6 +3949,7 @@ int hns3_init_all_ring(struct hns3_nic_priv *priv) }u64_stats_init (&priv->ring[i].syncp); +cond_resched (); }return 0 ;
drivers/net/ethernet/hisilicon/hns3/hns3_enet.h +2 -0
@@ -182,6 +182,8 @@ enum hns3_nic_state {#define HNS3_RING_EN_B 0 +#define HNS3_RESCHED_BD_NUM 1024 +enum hns3_pkt_l2t_type {HNS3_L2_TYPE_UNICAST ,HNS3_L2_TYPE_MULTICAST ,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 64/290 liquidio: Adjust a NULL pointer handling path in lio_vf_rep_copy_packet
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aleksandr Mishin <[email protected]>
[ Upstream commit c44711b78608c98a3e6b49ce91678cd0917d5349 ]
In lio_vf_rep_copy_packet() pg_info->page is compared to a NULL value, but then it is unconditionally passed to skb_add_rx_frag() which looks strange and could lead to null pointer dereference.
lio_vf_rep_copy_packet() call trace looks like:
octeon_droq_process_packets
octeon_droq_fast_process_packets
octeon_droq_dispatch_pkt
octeon_create_recv_info
...search in the dispatch_list...
->disp_fn(rdisp->rinfo, ...)
lio_vf_rep_pkt_recv(struct octeon_recv_info *recv_info, ...)
In this path there is no code which sets pg_info->page to NULL. So this check looks unneeded and doesn't solve potential problem. But I guess the author had reason to add a check and I have no such card and can't do real test.
In addition, the code in the function liquidio_push_packet() in liquidio/lio_core.c does exactly the same.
Based on this, I consider the most acceptable compromise solution to adjust this issue by moving skb_add_rx_frag() into conditional scope.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c +5 -6
@@ -272,13 +272,12 @@ lio_vf_rep_copy_packet(struct octeon_device *oct, pg_info->page_offset;memcpy (skb->data, va,MIN_SKB_SIZE );skb_put (skb,MIN_SKB_SIZE ); +skb_add_rx_frag (skb,skb_shinfo (skb)->nr_frags, + pg_info->page, + pg_info->page_offset +MIN_SKB_SIZE , + len -MIN_SKB_SIZE , +LIO_RXBUFFER_SZ ); } - -skb_add_rx_frag (skb,skb_shinfo (skb)->nr_frags, - pg_info->page, - pg_info->page_offset +MIN_SKB_SIZE , - len -MIN_SKB_SIZE , -LIO_RXBUFFER_SZ ); }else {struct octeon_skb_page_info *pg_info = ((struct octeon_skb_page_info *)(skb->cb));
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 65/290 drm/komeda: check for error-valued pointer
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amjad Ouled-Ameur <[email protected]>
[ Upstream commit b880018edd3a577e50366338194dee9b899947e0 ]
komeda_pipeline_get_state() may return an error-valued pointer, thus check the pointer for negative or null value before dereferencing.
--- drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c +1 -1
@@ -259,7 +259,7 @@ komeda_component_get_avail_scaler(struct komeda_component *c,u32 avail_scalers; pipe_st =komeda_pipeline_get_state (c->pipeline, state); -if (!pipe_st) +if (IS_ERR_OR_NULL (pipe_st))return NULL ; avail_scalers = (pipe_st->active_comps & KOMEDA_PIPELINE_SCALERS) ^
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 66/290 drm/bridge/panel: Fix runtime warning on panel bridge release
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adam Miotk <[email protected]>
[ Upstream commit ce62600c4dbee8d43b02277669dd91785a9b81d9 ]
Device managed panel bridge wrappers are created by calling to drm_panel_bridge_add_typed() and registering a release handler for clean-up when the device gets unbound.
Since the memory for this bridge is also managed and linked to the panel device, the release function should not try to free that memory. Moreover, the call to devm_kfree() inside drm_panel_bridge_remove() will fail in this case and emit a warning because the panel bridge resource is no longer on the device resources list (it has been removed from there before the call to release handlers).
--- drivers/gpu/drm/bridge/panel.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/panel.c +5 -2
@@ -252,9 +252,12 @@ EXPORT_SYMBOL(drm_panel_bridge_remove);static void devm_drm_panel_bridge_release (struct device *dev,void *res) { -struct drm_bridge **bridge = res; +struct drm_bridge *bridge = *(struct drm_bridge **)res; -drm_panel_bridge_remove (*bridge); +if (!bridge) +return ; + +drm_bridge_remove (bridge); }/**
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 67/290 tcp: fix race in tcp_v6_syn_recv_sock()
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 d37fe4255abe8e7b419b90c5847e8ec2b8debb08 ]
tcp_v6_syn_recv_sock() calls ip6_dst_store() before inet_sk(newsk)->pinet6 has been set up.
This means ip6_dst_store() writes over the parent (listener) np->dst_cookie.
This is racy because multiple threads could share the same parent and their final np->dst_cookie could be wrong.
Move ip6_dst_store() call after inet_sk(newsk)->pinet6 has been changed and after the copy of parent ipv6_pinfo.
--- net/ipv6/tcp_ipv6.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ipv6/tcp_ipv6.c +2 -1
@@ -1311,7 +1311,6 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff **/ newsk->sk_gso_type =SKB_GSO_TCPV6 ; -ip6_dst_store (newsk, dst,NULL ,NULL );inet6_sk_rx_dst_set (newsk, skb);inet_sk (newsk)->pinet6 =tcp_inet6_sk (newsk);
@@ -1322,6 +1321,8 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *memcpy (newnp, np,sizeof (struct ipv6_pinfo )); +ip6_dst_store (newsk, dst,NULL ,NULL ); + newsk->sk_v6_daddr = ireq->ir_v6_rmt_addr; newnp->saddr = ireq->ir_v6_loc_addr; newsk->sk_v6_rcv_saddr = ireq->ir_v6_loc_addr;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 68/290 net/mlx5e: Fix features validation check for tunneled UDP (non-VXLAN) packets
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 791b4089e326271424b78f2fae778b20e53d071b ]
Move the vxlan_features_check() call to after we verified the packet is a tunneled VXLAN packet.
Without this, tunneled UDP non-VXLAN packets (for ex. GENENVE) might wrongly not get offloaded.
In some cases, it worked by chance as GENEVE header is the same size as VXLAN, but it is obviously incorrect.
--- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +1 -2
@@ -4393,7 +4393,7 @@ static netdev_features_t mlx5e_tunnel_features_check(struct mlx5e_priv *priv,/* Verify if UDP port is being offloaded by HW */ if (mlx5_vxlan_lookup_port (priv->mdev->vxlan, port)) -return features; +return vxlan_features_check (skb, features);#if IS_ENABLED (CONFIG_GENEVE )/* Support Geneve offload for default UDP port */
@@ -4414,7 +4414,6 @@ netdev_features_t mlx5e_features_check(struct sk_buff *skb,struct mlx5e_priv *priv =netdev_priv (netdev); features =vlan_features_check (skb, features); - features =vxlan_features_check (skb, features);#ifdef CONFIG_MLX5_EN_IPSEC if (mlx5e_ipsec_feature_check (skb, netdev, features))
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 69/290 Bluetooth: L2CAP: Fix rejecting L2CAP_CONN_PARAM_UPDATE_REQ
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 806a5198c05987b748b50f3d0c0cfb3d417381a4 ]
This removes the bogus check for max > hcon->le_conn_max_interval since the later is just the initial maximum conn interval not the maximum the stack could support which is really 3200=4000ms.
In order to pass GAP/CONN/CPUP/BV-05-C one shall probably enter values of the following fields in IXIT that would cause hci_check_conn_params to fail:
TSPX_conn_update_int_minTSPX_conn_update_int_maxTSPX_conn_update_peripheral_latencyTSPX_conn_update_supervision_timeout
--- include/net/bluetooth/hci_core.h | 36 ++++++++++++++++++++++++++++---- net/bluetooth/l2cap_core.c | 8 +------ 2 files changed, 33 insertions(+), 11 deletions(-)
include/net/bluetooth/hci_core.h +32 -4
@@ -1625,18 +1625,46 @@ static inline int hci_check_conn_params(u16 min, u16 max, u16 latency, {u16 max_latency; -if (min > max || min <6 || max >3200 ) +if (min > max) { +BT_WARN ("min %d > max %d" , min, max);return -EINVAL ; + } + +if (min <6 ) { +BT_WARN ("min %d < 6" , min); +return -EINVAL ; + } + +if (max >3200 ) { +BT_WARN ("max %d > 3200" , max); +return -EINVAL ; + } + +if (to_multiplier <10 ) { +BT_WARN ("to_multiplier %d < 10" , to_multiplier); +return -EINVAL ; + } -if (to_multiplier <10 || to_multiplier >3200 ) +if (to_multiplier >3200 ) { +BT_WARN ("to_multiplier %d > 3200" , to_multiplier);return -EINVAL ; + } -if (max >= to_multiplier *8 ) +if (max >= to_multiplier *8 ) { +BT_WARN ("max %d >= to_multiplier %d * 8" , max, to_multiplier);return -EINVAL ; + } max_latency = (to_multiplier *4 / max) -1 ; -if (latency >499 || latency > max_latency) +if (latency >499 ) { +BT_WARN ("latency %d > 499" , latency);return -EINVAL ; + } + +if (latency > max_latency) { +BT_WARN ("latency %d > max_latency %d" , latency, max_latency); +return -EINVAL ; + }return 0 ; }
net/bluetooth/l2cap_core.c +1 -7
@@ -5612,13 +5612,7 @@ static inline int l2cap_conn_param_update_req(struct l2cap_conn *conn,memset (&rsp,0 ,sizeof (rsp)); -if (max > hcon->le_conn_max_interval) { -BT_DBG ("requested connection interval exceeds current bounds." ); - err = -EINVAL ; - }else { - err =hci_check_conn_params (min, max, latency, to_multiplier); - } - + err =hci_check_conn_params (min, max, latency, to_multiplier);if (err) rsp.result =cpu_to_le16 (L2CAP_CONN_PARAM_REJECTED );else
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 70/290 netfilter: ipset: Fix race between namespace cleanup and gc in the list:set type
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jozsef Kadlecsik <[email protected]>
[ Upstream commit 4e7aaa6b82d63e8ddcbfb56b4fd3d014ca586f10 ]
Lion Ackermann reported that there is a race condition between namespace cleanup in ipset and the garbage collection of the list:set type. The namespace cleanup can destroy the list:set type of sets while the gc of the set type is waiting to run in rcu cleanup. The latter uses data from the destroyed set which thus leads use after free. The patch contains the following parts:
- When destroying all sets, first remove the garbage collectors, then wait if needed and then destroy the sets.
- Fix the badly ordered "wait then remove gc" for the destroy a single set case.
- Fix the missing rcu locking in the list:set type in the userspace test case.
- Use proper RCU list handlings in the list:set type.
The patch depends on c1193d9bbbd3 (netfilter: ipset: Add list flush to cancel_gc).
--- net/netfilter/ipset/ip_set_core.c | 81 +++++++++++++++------------ net/netfilter/ipset/ip_set_list_set.c | 30 +++++----- 2 files changed, 60 insertions(+), 51 deletions(-)
net/netfilter/ipset/ip_set_core.c +46 -35
@@ -1176,23 +1176,50 @@ ip_set_setname_policy[IPSET_ATTR_CMD_MAX + 1] = { .len = IPSET_MAXNAMELEN - 1 }, }; +/* In order to return quickly when destroying a single set, it is split +* into two stages: +* - Cancel garbage collector +* - Destroy the set itself via call_rcu() +*/ +static void -ip_set_destroy_set (struct ip_set *set) +ip_set_destroy_set_rcu (struct rcu_head *head) { -pr_debug ("set: %s\n" , set->name); + struct ip_set *set = container_of(head, struct ip_set, rcu); -/* Must call it without holding any lock */ set->variant->destroy (set);module_put (set->type->me);kfree (set); }static void -ip_set_destroy_set_rcu (struct rcu_head *head) +_destroy_all_sets (struct ip_set_net *inst) { - struct ip_set *set = container_of(head, struct ip_set, rcu); +struct ip_set *set; +ip_set_id_t i; +bool need_wait = false; -ip_set_destroy_set (set); +/* First cancel gc's: set:list sets are flushed as well */ +for (i =0 ; i < inst->ip_set_max; i++) { + set =ip_set (inst, i); +if (set) { + set->variant->cancel_gc (set); +if (set->type->features &IPSET_TYPE_NAME ) + need_wait = true; + } + } +/* Must wait for flush to be really finished */ +if (need_wait) +rcu_barrier (); +for (i =0 ; i < inst->ip_set_max; i++) { + set =ip_set (inst, i); +if (set) { +ip_set (inst, i) =NULL ; + set->variant->destroy (set); +module_put (set->type->me); +kfree (set); + } + } } static int ip_set_destroy(struct net *net, struct sock *ctnl,
@@ -1208,11 +1235,10 @@ static int ip_set_destroy(struct net *net, struct sock *ctnl,if (unlikely (protocol_min_failed (attr)))return -IPSET_ERR_PROTOCOL ; -/* Commands are serialized and references are * protected by the ip_set_ref_lock. * External systems (i.e. xt_set) must call -* ip_set_put|get_nfnl_* functions, that way we +* ip_set_nfnl_get_* functions, that way we * can safely check references here. * * list:set timer can only decrement the reference
@@ -1220,8 +1246,6 @@ static int ip_set_destroy(struct net *net, struct sock *ctnl,* without holding the lock. */ if (!attr[IPSET_ATTR_SETNAME ]) { -/* Must wait for flush to be really finished in list:set */ -rcu_barrier ();read_lock_bh (&ip_set_ref_lock);for (i =0 ; i < inst->ip_set_max; i++) { s =ip_set (inst, i);
@@ -1232,15 +1256,7 @@ static int ip_set_destroy(struct net *net, struct sock *ctnl, } inst->is_destroyed = true;read_unlock_bh (&ip_set_ref_lock); -for (i =0 ; i < inst->ip_set_max; i++) { - s =ip_set (inst, i); -if (s) { -ip_set (inst, i) =NULL ; -/* Must cancel garbage collectors */ - s->variant->cancel_gc (s); -ip_set_destroy_set (s); - } - } +_destroy_all_sets (inst);/* Modified by ip_set_destroy() only, which is serialized */ inst->is_destroyed = false; }else {
@@ -1259,12 +1275,12 @@ static int ip_set_destroy(struct net *net, struct sock *ctnl, features = s->type->features;ip_set (inst, i) =NULL ;read_unlock_bh (&ip_set_ref_lock); +/* Must cancel garbage collectors */ + s->variant->cancel_gc (s);if (features &IPSET_TYPE_NAME ) {/* Must wait for flush to be really finished */ rcu_barrier (); } -/* Must cancel garbage collectors */ - s->variant->cancel_gc (s);call_rcu (&s->rcu, ip_set_destroy_set_rcu); }return 0 ;
@@ -2400,30 +2416,25 @@ ip_set_net_init(struct net *net) } static void __net_exit -ip_set_net_exit (struct net *net) +ip_set_net_pre_exit (struct net *net) {struct ip_set_net *inst =ip_set_pernet (net); -struct ip_set *set =NULL ; -ip_set_id_t i; - inst->is_deleted = true;/* flag for ip_set_nfnl_put */ +} -nfnl_lock (NFNL_SUBSYS_IPSET ); -for (i =0 ; i < inst->ip_set_max; i++) { - set =ip_set (inst, i); -if (set) { -ip_set (inst, i) =NULL ; - set->variant->cancel_gc (set); -ip_set_destroy_set (set); - } - } -nfnl_unlock (NFNL_SUBSYS_IPSET ); +static void __net_exit +ip_set_net_exit (struct net *net) +{ +struct ip_set_net *inst =ip_set_pernet (net); + +_destroy_all_sets (inst);kvfree (rcu_dereference_protected (inst->ip_set_list,1 )); }static struct pernet_operations ip_set_net_ops = { .init = ip_set_net_init, + .pre_exit = ip_set_net_pre_exit, .exit = ip_set_net_exit, .id = &ip_set_net_id, .size =sizeof (struct ip_set_net ),
net/netfilter/ipset/ip_set_list_set.c +14 -16
@@ -79,7 +79,7 @@ list_set_kadd(struct ip_set *set, const struct sk_buff *skb,struct set_elem *e;int ret; -list_for_each_entry (e, &map->members, list) { +list_for_each_entry_rcu (e, &map->members, list) {if (SET_WITH_TIMEOUT (set) &&ip_set_timeout_expired (ext_timeout (e, set)))continue ;
@@ -99,7 +99,7 @@ list_set_kdel(struct ip_set *set, const struct sk_buff *skb,struct set_elem *e;int ret; -list_for_each_entry (e, &map->members, list) { +list_for_each_entry_rcu (e, &map->members, list) {if (SET_WITH_TIMEOUT (set) &&ip_set_timeout_expired (ext_timeout (e, set)))continue ;
@@ -188,9 +188,10 @@ list_set_utest(struct ip_set *set, void *value, const struct ip_set_ext *ext,struct list_set *map = set->data;struct set_adt_elem *d = value;struct set_elem *e, *next, *prev =NULL ; -int ret; +int ret =0 ; -list_for_each_entry (e, &map->members, list) { +rcu_read_lock (); +list_for_each_entry_rcu (e, &map->members, list) {if (SET_WITH_TIMEOUT (set) &&ip_set_timeout_expired (ext_timeout (e, set)))continue ;
@@ -201,6 +202,7 @@ list_set_utest(struct ip_set *set, void *value, const struct ip_set_ext *ext,if (d->before ==0 ) { ret =1 ; + goto out; }else if (d->before >0 ) { next =list_next_entry (e, list); ret = !list_is_last(&e->list, &map->members) &&
@@ -208,9 +210,11 @@ list_set_utest(struct ip_set *set, void *value, const struct ip_set_ext *ext, }else { ret = prev && prev->id == d->refid; } -return ret; + goto out; } -return 0 ; +out: +rcu_read_unlock (); +return ret; } static void
@@ -239,7 +243,7 @@ list_set_uadd(struct ip_set *set, void *value, const struct ip_set_ext *ext,/* Find where to add the new entry */ n = prev = next =NULL ; -list_for_each_entry (e, &map->members, list) { +list_for_each_entry_rcu (e, &map->members, list) {if (SET_WITH_TIMEOUT (set) &&ip_set_timeout_expired (ext_timeout (e, set)))continue ;
@@ -316,9 +320,9 @@ list_set_udel(struct ip_set *set, void *value, const struct ip_set_ext *ext, {struct list_set *map = set->data;struct set_adt_elem *d = value; -struct set_elem *e, *next, *prev =NULL ; +struct set_elem *e, *n, *next, *prev =NULL ; -list_for_each_entry (e, &map->members, list) { +list_for_each_entry_safe (e, n, &map->members, list) {if (SET_WITH_TIMEOUT (set) &&ip_set_timeout_expired (ext_timeout (e, set)))continue ;
@@ -424,14 +428,8 @@ static void list_set_destroy(struct ip_set *set) {struct list_set *map = set->data; -struct set_elem *e, *n; -list_for_each_entry_safe (e, n, &map->members, list) { -list_del (&e->list); -ip_set_put_byindex (map->net, e->id); -ip_set_ext_destroy (set, e); -kfree (e); - } +WARN_ON_ONCE (!list_empty (&map->members));kfree (map); set->data =NULL ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 71/290 net: stmmac: replace priv->speed with the portTransmitRate from the tc-cbs parameters
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xiaolei Wang <[email protected]>
[ Upstream commit be27b896529787e23a35ae4befb6337ce73fcca0 ]
The current cbs parameter depends on speed after uplinking, which is not needed and will report a configuration error if the port is not initially connected. The UAPI exposed by tc-cbs requires userspace to recalculate the send slope anyway, because the formula depends on port_transmit_rate (see man tc-cbs), which is not an invariant from tc's perspective. Therefore, we use offload->sendslope and offload->idleslope to derive the original port_transmit_rate from the CBS formula.
--- .../net/ethernet/stmicro/stmmac/stmmac_tc.c | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c +11 -14
@@ -310,10 +310,11 @@ static int tc_setup_cbs(struct stmmac_priv *priv, struct tc_cbs_qopt_offload *qopt) {u32 tx_queues_count = priv->plat->tx_queues_to_use; +s64 port_transmit_rate_kbps;u32 queue = qopt->queue; -u32 ptr, speed_div;u32 mode_to_use;u64 value; +u32 ptr;int ret;/* Queue 0 is not AVB capable */
@@ -322,30 +323,26 @@ static int tc_setup_cbs(struct stmmac_priv *priv,if (!priv->dma_cap.av)return -EOPNOTSUPP ; + port_transmit_rate_kbps = qopt->idleslope - qopt->sendslope; +/* Port Transmit Rate and Speed Divider */ -switch (priv->speed) { +switch (div_s64 (port_transmit_rate_kbps,1000 )) {case SPEED_10000 : - ptr =32 ; - speed_div =10000000 ; -break ;case SPEED_5000 : ptr =32 ; - speed_div =5000000 ;break ;case SPEED_2500 : - ptr =8 ; - speed_div =2500000 ; -break ;case SPEED_1000 : ptr =8 ; - speed_div =1000000 ;break ;case SPEED_100 : ptr =4 ; - speed_div =100000 ;break ;default : -return -EOPNOTSUPP ; +netdev_err (priv->dev, +"Invalid portTransmitRate %lld (idleSlope - sendSlope)\n" , + port_transmit_rate_kbps); +return -EINVAL ; } mode_to_use = priv->plat->tx_queues_cfg[queue].mode_to_use;
@@ -365,10 +362,10 @@ static int tc_setup_cbs(struct stmmac_priv *priv, }/* Final adjustments for HW */ - value =div_s64 (qopt->idleslope *1024ll * ptr, speed_div); + value =div_s64 (qopt->idleslope *1024ll * ptr, port_transmit_rate_kbps); priv->plat->tx_queues_cfg[queue].idle_slope = value &GENMASK (31 ,0 ); - value =div_s64 (-qopt->sendslope *1024ll * ptr, speed_div); + value =div_s64 (-qopt->sendslope *1024ll * ptr, port_transmit_rate_kbps); priv->plat->tx_queues_cfg[queue].send_slope = value &GENMASK (31 ,0 ); value = qopt->hicredit *1024ll *8 ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 54/290 gpio: tqmx86: fix typo in Kconfig label
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gregor Herburger <[email protected]>
[ Upstream commit 8c219e52ca4d9a67cd6a7074e91bf29b55edc075 ]
Fix description for GPIO_TQMX86 from QTMX86 to TQMx86.
--- drivers/gpio/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/Kconfig +1 -1
@@ -1335,7 +1335,7 @@ config GPIO_TPS68470 drivers are loaded. config GPIO_TQMX86 - tristate "TQ-Systems QTMX86 GPIO" + tristate "TQ-Systems TQMx86 GPIO" depends on MFD_TQMX86 || COMPILE_TEST depends on HAS_IOPORT_MAP select GPIOLIB_IRQCHIP
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 72/290 net/ipv6: Fix the RT cache flush via sysctl using a previous delay
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Petr Pavlu <[email protected]>
[ Upstream commit 14a20e5b4ad998793c5f43b0330d9e1388446cf3 ]
The net.ipv6.route.flush system parameter takes a value which specifies a delay used during the flush operation for aging exception routes. The written value is however not used in the currently requested flush and instead utilized only in the next one.
A problem is that ipv6_sysctl_rtcache_flush() first reads the old value of net->ipv6.sysctl.flush_delay into a local delay variable and then calls proc_dointvec() which actually updates the sysctl based on the provided input.
Fix the problem by switching the order of the two operations.
--- net/ipv6/route.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv6/route.c +2 -2
@@ -6181,12 +6181,12 @@ static int ipv6_sysctl_rtcache_flush(struct ctl_table *ctl, int write,if (!write)return -EINVAL ; - net = (struct net *)ctl->extra1; - delay = net->ipv6.sysctl.flush_delay; ret =proc_dointvec (ctl, write, buffer, lenp, ppos);if (ret)return ret; + net = (struct net *)ctl->extra1; + delay = net->ipv6.sysctl.flush_delay;fib6_run_gc (delay <=0 ?0 : (unsigned long )delay, net, delay >0 );return 0 ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 73/290 ionic: fix use after netif_napi_del()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Taehee Yoo <[email protected]>
[ Upstream commit 79f18a41dd056115d685f3b0a419c7cd40055e13 ]
When queues are started, netif_napi_add() and napi_enable() are called. If there are 4 queues and only 3 queues are used for the current configuration, only 3 queues' napi should be registered and enabled. The ionic_qcq_enable() checks whether the .poll pointer is not NULL for enabling only the using queue' napi. Unused queues' napi will not be registered by netif_napi_add(), so the .poll pointer indicates NULL. But it couldn't distinguish whether the napi was unregistered or not because netif_napi_del() doesn't reset the .poll pointer to NULL. So, ionic_qcq_enable() calls napi_enable() for the queue, which was unregistered by netif_napi_del().
Reproducer:
ethtool -L <interface name> rx 1 tx 1 combined 0 ethtool -L <interface name> rx 0 tx 0 combined 1 ethtool -L <interface name> rx 0 tx 0 combined 4
Splat looks like:
kernel BUG at net/core/dev.c:6666!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP NOPTI CPU: 3 PID: 1057 Comm: kworker/3:3 Not tainted 6.10.0-rc2+ #16 Workqueue: events ionic_lif_deferred_work [ionic] RIP: 0010:napi_enable+0x3b/0x40 Code: 48 89 c2 48 83 e2 f6 80 b9 61 09 00 00 00 74 0d 48 83 bf 60 01 00 00 00 74 03 80 ce 01 f0 4f RSP: 0018:ffffb6ed83227d48 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff97560cda0828 RCX: 0000000000000029 RDX: 0000000000000001 RSI: 0000000000000000 RDI: ffff97560cda0a28 RBP: ffffb6ed83227d50 R08: 0000000000000400 R09: 0000000000000001 R10: 0000000000000001 R11: 0000000000000001 R12: 0000000000000000 R13: ffff97560ce3c1a0 R14: 0000000000000000 R15: ffff975613ba0a20 FS: 0000000000000000(0000) GS:ffff975d5f780000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f8f734ee200 CR3: 0000000103e50000 CR4: 00000000007506f0 PKRU: 55555554 Call Trace: <TASK> ? die+0x33/0x90 ? do_trap+0xd9/0x100 ? napi_enable+0x3b/0x40 ? do_error_trap+0x83/0xb0 ? napi_enable+0x3b/0x40 ? napi_enable+0x3b/0x40 ? exc_invalid_op+0x4e/0x70 ? napi_enable+0x3b/0x40 ? asm_exc_invalid_op+0x16/0x20 ? napi_enable+0x3b/0x40 ionic_qcq_enable+0xb7/0x180 [ionic 59bdfc8a035436e1c4224ff7d10789e3f14643f8] ionic_start_queues+0xc4/0x290 [ionic 59bdfc8a035436e1c4224ff7d10789e3f14643f8] ionic_link_status_check+0x11c/0x170 [ionic 59bdfc8a035436e1c4224ff7d10789e3f14643f8] ionic_lif_deferred_work+0x129/0x280 [ionic 59bdfc8a035436e1c4224ff7d10789e3f14643f8] process_one_work+0x145/0x360 worker_thread+0x2bb/0x3d0 ? __pfx_worker_thread+0x10/0x10 kthread+0xcc/0x100 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x2d/0x50 ? __pfx_kthread+0x10/0x10 ret_from_fork_asm+0x1a/0x30
--- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/pensando/ionic/ionic_lif.c +1 -3
@@ -272,10 +272,8 @@ static int ionic_qcq_enable(struct ionic_qcq *qcq)if (ret)return ret; -if (qcq->napi.poll) -napi_enable (&qcq->napi); -if (qcq->flags &IONIC_QCQ_F_INTR ) { +napi_enable (&qcq->napi);irq_set_affinity_hint (qcq->intr.vector, &qcq->intr.affinity_mask); ionic_intr_mask(idev->intr_ctrl, qcq->intr.index,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 74/290 iio: adc: ad9467: fix scan type sign
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Lechner <[email protected]>
commit 8a01ef749b0a632f0e1f4ead0f08b3310d99fcb1 upstream.
According to the IIO documentation, the sign in the scan type should be lower case. The ad9467 driver was incorrectly using upper case.
Fix by changing to lower case.
--- drivers/iio/adc/ad9467.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/ad9467.c +2 -2
@@ -223,11 +223,11 @@ static void __ad9467_get_scale(struct ad }static const struct iio_chan_spec ad9434_channels[] = { -AD9467_CHAN (0 ,0 ,12 ,'S' ), +AD9467_CHAN (0 ,0 ,12 ,'s' ), };static const struct iio_chan_spec ad9467_channels[] = { -AD9467_CHAN (0 ,0 ,16 ,'S' ), +AD9467_CHAN (0 ,0 ,16 ,'s' ), };static const struct ad9467_chip_info ad9467_chip_tbl[] = {
Greg Kroah-Hartman
maintainerPATCH 75/290 iio: dac: ad5592r: fix temperature channel scaling value
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Ferland <[email protected]>
commit 279428df888319bf68f2686934897301a250bb84 upstream.
The scale value for the temperature channel is (assuming Vref=2.5 and the datasheet):
376.7897513
When calculating both val and val2 for the temperature scale we use (3767897513/25) and multiply it by Vref (here I assume 2500mV) to obtain:
2500 * (3767897513/25) ==> 376789751300
Finally we divide with remainder by 10^9 to get:
val = 376
val2 = 789751300However, we return IIO_VAL_INT_PLUS_MICRO (should have been NANO) as the scale type. So when converting the raw temperature value to the 'processed' temperature value we will get (assuming raw=810, offset=-753):
processed = (raw + offset) * scale_val
= (810 + -753) * 376
= 21432
processed += div((raw + offset) * scale_val2, 10^6)
+= div((810 + -753) * 789751300, 10^6)
+= 45015
==> 66447
==> 66.4 Celciusinstead of the expected 21.5 Celsius.
Fix this issue by changing IIO_VAL_INT_PLUS_MICRO to IIO_VAL_INT_PLUS_NANO.
--- drivers/iio/dac/ad5592r-base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dac/ad5592r-base.c +1 -1
@@ -411,7 +411,7 @@ static int ad5592r_read_raw(struct iio_ds64 tmp = *val * (3767897513LL /25LL ); *val =div_s64_rem (tmp,1000000000LL , val2); -return IIO_VAL_INT_PLUS_MICRO ; +return IIO_VAL_INT_PLUS_NANO ; }mutex_lock (&st->lock);
Greg Kroah-Hartman
maintainerPATCH 76/290 iio: imu: inv_icm42600: delete unneeded update watermark call
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jean-Baptiste Maneyrol <[email protected]>
commit 245f3b149e6cc3ac6ee612cdb7042263bfc9e73c upstream.
Update watermark will be done inside the hwfifo_set_watermark callback just after the update_scan_mode. It is useless to do it here.
--- drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c | 4 ---- drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c | 4 ---- 2 files changed, 8 deletions(-)
drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c +0 -4
@@ -128,10 +128,6 @@ static int inv_icm42600_accel_update_sca/* update data FIFO write */ inv_icm42600_timestamp_apply_odr (ts,0 ,0 ,0 ); ret =inv_icm42600_buffer_set_fifo_en (st, fifo_en | st->fifo.en); -if (ret) - goto out_unlock; - - ret =inv_icm42600_buffer_update_watermark (st); out_unlock:mutex_unlock (&st->lock);
drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c +0 -4
@@ -128,10 +128,6 @@ static int inv_icm42600_gyro_update_scan/* update data FIFO write */ inv_icm42600_timestamp_apply_odr (ts,0 ,0 ,0 ); ret =inv_icm42600_buffer_set_fifo_en (st, fifo_en | st->fifo.en); -if (ret) - goto out_unlock; - - ret =inv_icm42600_buffer_update_watermark (st); out_unlock:mutex_unlock (&st->lock);
Greg Kroah-Hartman
maintainerPATCH 77/290 drivers: core: synchronize really_probe() and dev_uevent()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dirk Behme <[email protected]>
commit c0a40097f0bc81deafc15f9195d1fb54595cd6d0 upstream.
Synchronize the dev->driver usage in really_probe() and dev_uevent(). These can run in different threads, what can result in the following race condition for dev->driver uninitialization:
Thread #1:
==========
really_probe() {
...probe_failed:
...
device_unbind_cleanup(dev) {
...
dev->driver = NULL; // <= Failed probe sets dev->driver to NULL
...
}...
}
Thread #2:
==========
dev_uevent() {
...
if (dev->driver)
// If dev->driver is NULLed from really_probe() from here on,
// after above check, the system crashes
add_uevent_var(env, "DRIVER=%s", dev->driver->name);...
}
really_probe() holds the lock, already. So nothing needs to be done there. dev_uevent() is called with lock held, often, too. But not always. What implies that we can't add any locking in dev_uevent() itself. So fix this race by adding the lock to the non-protected path. This is the path where above race is observed:
dev_uevent+0x235/0x380 uevent_show+0x10c/0x1f0 <= Add lock here dev_attr_show+0x3a/0xa0 sysfs_kf_seq_show+0x17c/0x250 kernfs_seq_show+0x7c/0x90 seq_read_iter+0x2d7/0x940 kernfs_fop_read_iter+0xc6/0x310 vfs_read+0x5bc/0x6b0 ksys_read+0xeb/0x1b0 __x64_sys_read+0x42/0x50 x64_sys_call+0x27ad/0x2d30 do_syscall_64+0xcd/0x1d0 entry_SYSCALL_64_after_hwframe+0x77/0x7f
Similar cases are reported by syzkaller in
https://syzkaller.appspot.com/bug?extid=ffa8143439596313a85a
But these are regarding the *initialization* of dev->driver
dev->driver = drv;
As this switches dev->driver to non-NULL these reports can be considered to be false-positives (which should be "fixed" by this commit, as well, though).
The same issue was reported and tried to be fixed back in 2015 in
https://lore.kernel.org/lkml/[email protected]/
already.
--- drivers/base/core.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/base/core.c +3 -0
@@ -2008,8 +2008,11 @@ static ssize_t uevent_show(struct deviceif (!env)return -ENOMEM ; +/* Synchronize with really_probe() */ +device_lock (dev);/* let the kset specific function add its keys */ retval = kset->uevent_ops->uevent (kset, &dev->kobj, env); +device_unlock (dev);if (retval) goto out;
Greg Kroah-Hartman
maintainerPATCH 78/290 drm/exynos/vidi: fix memory leak in .get_modes()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jani Nikula <[email protected]>
commit 38e3825631b1f314b21e3ade00b5a4d737eb054e upstream.
The duplicated EDID is never freed. Fix it.
--- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/exynos/exynos_drm_vidi.c +6 -1
@@ -308,6 +308,7 @@ static int vidi_get_modes(struct drm_construct vidi_context *ctx =ctx_from_connector (connector);struct edid *edid;int edid_len; +int count;/* * the edid data comes from user side and it would be set
@@ -327,7 +328,11 @@ static int vidi_get_modes(struct drm_condrm_connector_update_edid_property (connector, edid); -return drm_add_edid_modes (connector, edid); + count =drm_add_edid_modes (connector, edid); + +kfree (edid); + +return count; }static const struct drm_connector_helper_funcs vidi_connector_helper_funcs = {
Greg Kroah-Hartman
maintainerPATCH 79/290 drm/exynos: hdmi: report safe 640x480 mode as a fallback when no EDID found
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Szyprowski <[email protected]>
commit 799d4b392417ed6889030a5b2335ccb6dcf030ab upstream.
When reading EDID fails and driver reports no modes available, the DRM core adds an artificial 1024x786 mode to the connector. Unfortunately some variants of the Exynos HDMI (like the one in Exynos4 SoCs) are not able to drive such mode, so report a safe 640x480 mode instead of nothing in case of the EDID reading failure.
This fixes the following issue observed on Trats2 board since commit 13d5b040363c ("drm/exynos: do not return negative values from .get_modes()"):
[drm] Exynos DRM: using 11c00000.fimd device for DMA mapping operations
exynos-drm exynos-drm: bound 11c00000.fimd (ops fimd_component_ops)
exynos-drm exynos-drm: bound 12c10000.mixer (ops mixer_component_ops)
exynos-dsi 11c80000.dsi: [drm:samsung_dsim_host_attach] Attached s6e8aa0 device (lanes:4 bpp:24 mode-flags:0x10b) exynos-drm exynos-drm: bound 11c80000.dsi (ops exynos_dsi_component_ops)
exynos-drm exynos-drm: bound 12d00000.hdmi (ops hdmi_component_ops)
[drm] Initialized exynos 1.1.0 20180330 for exynos-drm on minor 1
exynos-hdmi 12d00000.hdmi: [drm:hdmiphy_enable.part.0] *ERROR* PLL could not reach steady state panel-samsung-s6e8aa0 11c80000.dsi.0: ID: 0xa2, 0x20, 0x8c
exynos-mixer 12c10000.mixer: timeout waiting for VSYNC
------------[ cut here ]------------ WARNING: CPU: 1 PID: 11 at drivers/gpu/drm/drm_atomic_helper.c:1682 drm_atomic_helper_wait_for_vblanks.part.0+0x2b0/0x2b8 [CRTC:70:crtc-1] vblank wait timed out Modules linked in: CPU: 1 PID: 11 Comm: kworker/u16:0 Not tainted 6.9.0-rc5-next-20240424 #14913 Hardware name: Samsung Exynos (Flattened Device Tree) Workqueue: events_unbound deferred_probe_work_func Call trace: unwind_backtrace from show_stack+0x10/0x14 show_stack from dump_stack_lvl+0x68/0x88 dump_stack_lvl from __warn+0x7c/0x1c4 __warn from warn_slowpath_fmt+0x11c/0x1a8 warn_slowpath_fmt from drm_atomic_helper_wait_for_vblanks.part.0+0x2b0/0x2b8 drm_atomic_helper_wait_for_vblanks.part.0 from drm_atomic_helper_commit_tail_rpm+0x7c/0x8c drm_atomic_helper_commit_tail_rpm from commit_tail+0x9c/0x184 commit_tail from drm_atomic_helper_commit+0x168/0x190 drm_atomic_helper_commit from drm_atomic_commit+0xb4/0xe0 drm_atomic_commit from drm_client_modeset_commit_atomic+0x23c/0x27c drm_client_modeset_commit_atomic from drm_client_modeset_commit_locked+0x60/0x1cc drm_client_modeset_commit_locked from drm_client_modeset_commit+0x24/0x40 drm_client_modeset_commit from __drm_fb_helper_restore_fbdev_mode_unlocked+0x9c/0xc4 __drm_fb_helper_restore_fbdev_mode_unlocked from drm_fb_helper_set_par+0x2c/0x3c drm_fb_helper_set_par from fbcon_init+0x3d8/0x550 fbcon_init from visual_init+0xc0/0x108 visual_init from do_bind_con_driver+0x1b8/0x3a4 do_bind_con_driver from do_take_over_console+0x140/0x1ec do_take_over_console from do_fbcon_takeover+0x70/0xd0 do_fbcon_takeover from fbcon_fb_registered+0x19c/0x1ac fbcon_fb_registered from register_framebuffer+0x190/0x21c register_framebuffer from __drm_fb_helper_initial_config_and_unlock+0x350/0x574 __drm_fb_helper_initial_config_and_unlock from exynos_drm_fbdev_client_hotplug+0x6c/0xb0 exynos_drm_fbdev_client_hotplug from drm_client_register+0x58/0x94 drm_client_register from exynos_drm_bind+0x160/0x190 exynos_drm_bind from try_to_bring_up_aggregate_device+0x200/0x2d8 try_to_bring_up_aggregate_device from __component_add+0xb0/0x170 __component_add from mixer_probe+0x74/0xcc mixer_probe from platform_probe+0x5c/0xb8 platform_probe from really_probe+0xe0/0x3d8 really_probe from __driver_probe_device+0x9c/0x1e4 __driver_probe_device from driver_probe_device+0x30/0xc0 driver_probe_device from __device_attach_driver+0xa8/0x120 __device_attach_driver from bus_for_each_drv+0x80/0xcc bus_for_each_drv from __device_attach+0xac/0x1fc __device_attach from bus_probe_device+0x8c/0x90 bus_probe_device from deferred_probe_work_func+0x98/0xe0 deferred_probe_work_func from process_one_work+0x240/0x6d0 process_one_work from worker_thread+0x1a0/0x3f4 worker_thread from kthread+0x104/0x138 kthread from ret_from_fork+0x14/0x28 Exception stack(0xf0895fb0 to 0xf0895ff8) ... irq event stamp: 82357 hardirqs last enabled at (82363): [<c01a96e8>] vprintk_emit+0x308/0x33c hardirqs last disabled at (82368): [<c01a969c>] vprintk_emit+0x2bc/0x33c softirqs last enabled at (81614): [<c0101644>] __do_softirq+0x320/0x500 softirqs last disabled at (81609): [<c012dfe0>] __irq_exit_rcu+0x130/0x184 ---[ end trace 0000000000000000 ]---
exynos-drm exynos-drm: [drm] *ERROR* flip_done timed out
exynos-drm exynos-drm: [drm] *ERROR* [CRTC:70:crtc-1] commit wait timed out exynos-drm exynos-drm: [drm] *ERROR* flip_done timed out
exynos-drm exynos-drm: [drm] *ERROR* [CONNECTOR:74:HDMI-A-1] commit wait timed out exynos-drm exynos-drm: [drm] *ERROR* flip_done timed out
exynos-drm exynos-drm: [drm] *ERROR* [PLANE:56:plane-5] commit wait timed out exynos-mixer 12c10000.mixer: timeout waiting for VSYNC
--- drivers/gpu/drm/exynos/exynos_hdmi.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/exynos/exynos_hdmi.c +5 -2
@@ -878,11 +878,11 @@ static int hdmi_get_modes(struct drm_conint ret;if (!hdata->ddc_adpt) -return 0 ; + goto no_edid; edid =drm_get_edid (connector, hdata->ddc_adpt);if (!edid) -return 0 ; + goto no_edid; hdata->dvi_mode = !drm_detect_hdmi_monitor (edid); DRM_DEV_DEBUG_KMS(hdata->dev, "%s : width[%d] x height[%d]\n",
@@ -897,6 +897,9 @@ static int hdmi_get_modes(struct drm_conkfree (edid);return ret; + +no_edid: +return drm_add_modes_noedid (connector,640 ,480 ); }static int hdmi_find_phy_conf (struct hdmi_context *hdata,u32 pixel_clock)
Greg Kroah-Hartman
maintainerPATCH 80/290 vmci: prevent speculation leaks by sanitizing event in event_deliver()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hagar Gamal Halim Hemdan <[email protected]>
commit 8003f00d895310d409b2bf9ef907c56b42a4e0f4 upstream.
Coverity spotted that event_msg is controlled by user-space, event_msg->event_data.event is passed to event_deliver() and used as an index without sanitization.
This change ensures that the event index is sanitized to mitigate any possibility of speculative information leaks.
This bug was discovered and resolved using Coverity Static Analysis Security Testing (SAST) by Synopsys, Inc.
Only compile tested, no access to HW.
--- drivers/misc/vmw_vmci/vmci_event.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/misc/vmw_vmci/vmci_event.c +5 -1
@@ -9,6 +9,7 @@#include <linux/vmw_vmci_api.h> #include <linux/list.h> #include <linux/module.h> +#include <linux/nospec.h> #include <linux/sched.h> #include <linux/slab.h> #include <linux/rculist.h>
@@ -86,9 +87,12 @@ static void event_deliver(struct vmci_ev {struct vmci_subscription *cur;struct list_head *subscriber_list; +u32 sanitized_event, max_vmci_event;rcu_read_lock (); - subscriber_list = &subscriber_array[event_msg->event_data.event]; + max_vmci_event =ARRAY_SIZE (subscriber_array); + sanitized_event =array_index_nospec (event_msg->event_data.event, max_vmci_event); + subscriber_list = &subscriber_array[sanitized_event];list_for_each_entry_rcu (cur, subscriber_list, node) { cur->callback (cur->id, &event_msg->event_data, cur->callback_data);
Greg Kroah-Hartman
maintainerPATCH 81/290 fs/proc: fix softlockup in __read_vmcore
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rik van Riel <[email protected]>
commit 5cbcb62dddf5346077feb82b7b0c9254222d3445 upstream.
While taking a kernel core dump with makedumpfile on a larger system, softlockup messages often appear.
While softlockup warnings can be harmless, they can also interfere with things like RCU freeing memory, which can be problematic when the kdump kexec image is configured with as little memory as possible.
Avoid the softlockup, and give things like work items and RCU a chance to do their thing during __read_vmcore by adding a cond_resched.
--- fs/proc/vmcore.c | 2 ++ 1 file changed, 2 insertions(+)
fs/proc/vmcore.c +2 -0
@@ -373,6 +373,8 @@ static ssize_t __read_vmcore(char *buffe/* leave now if filled buffer already */ if (buflen ==0 )return acc; + +cond_resched (); }list_for_each_entry (m, &vmcore_list, list) {
Greg Kroah-Hartman
maintainerPATCH 55/290 HID: core: remove unnecessary WARN_ON() in implement()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nikita Zhandarovich <[email protected]>
[ Upstream commit 4aa2dcfbad538adf7becd0034a3754e1bd01b2b5 ]
Syzkaller hit a warning [1] in a call to implement() when trying to write a value into a field of smaller size in an output report.
Since implement() already has a warn message printed out with the help of hid_warn() and value in question gets trimmed with:
... value &= m; ...
WARN_ON may be considered superfluous. Remove it to suppress future syzkaller triggers.
[1]
WARNING: CPU: 0 PID: 5084 at drivers/hid/hid-core.c:1451 implement drivers/hid/hid-core.c:1451 [inline] WARNING: CPU: 0 PID: 5084 at drivers/hid/hid-core.c:1451 hid_output_report+0x548/0x760 drivers/hid/hid-core.c:1863 Modules linked in: CPU: 0 PID: 5084 Comm: syz-executor424 Not tainted 6.9.0-rc7-syzkaller-00183-gcf87f46fd34d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 RIP: 0010:implement drivers/hid/hid-core.c:1451 [inline] RIP: 0010:hid_output_report+0x548/0x760 drivers/hid/hid-core.c:1863 ... Call Trace: <TASK> __usbhid_submit_report drivers/hid/usbhid/hid-core.c:591 [inline] usbhid_submit_report+0x43d/0x9e0 drivers/hid/usbhid/hid-core.c:636 hiddev_ioctl+0x138b/0x1f00 drivers/hid/usbhid/hiddev.c:726 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:904 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:890 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f
...
--- drivers/hid/hid-core.c | 1 - 1 file changed, 1 deletion(-)
drivers/hid/hid-core.c +0 -1
@@ -1446,7 +1446,6 @@ static void implement(const struct hid_device *hid, u8 *report,hid_warn (hid,"%s() called with too large value %d (n: %d)! (%s)\n" , __func__, value, n, current->comm); -WARN_ON (1 ); value &= m; } }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 82/290 ocfs2: use coarse time for new created files
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Su Yue <[email protected]>
commit b8cb324277ee16f3eca3055b96fce4735a5a41c6 upstream.
The default atime related mount option is '-o realtime' which means file atime should be updated if atime <= ctime or atime <= mtime. atime should be updated in the following scenario, but it is not:
==========================================================
$ rm /mnt/testfile; $ echo test > /mnt/testfile $ stat -c "%X %Y %Z" /mnt/testfile 1711881646 1711881646 1711881646 $ sleep 5 $ cat /mnt/testfile > /dev/null $ stat -c "%X %Y %Z" /mnt/testfile 1711881646 1711881646 1711881646 ==========================================================
And the reason the atime in the test is not updated is that ocfs2 calls ktime_get_real_ts64() in __ocfs2_mknod_locked during file creation. Then inode_set_ctime_current() is called in inode_set_ctime_current() calls ktime_get_coarse_real_ts64() to get current time.
ktime_get_real_ts64() is more accurate than ktime_get_coarse_real_ts64(). In my test box, I saw ctime set by ktime_get_coarse_real_ts64() is less than ktime_get_real_ts64() even ctime is set later. The ctime of the new inode is smaller than atime.
The call trace is like:
ocfs2_create
ocfs2_mknod
__ocfs2_mknod_locked
....
ktime_get_real_ts64 <------- set atime,ctime,mtime, more accurate
ocfs2_populate_inode
...
ocfs2_init_acl
ocfs2_acl_set_mode
inode_set_ctime_current
current_time
ktime_get_coarse_real_ts64 <-------less accurateocfs2_file_read_iter
ocfs2_inode_lock_atime
ocfs2_should_update_atime
atime <= ctime ? <-------- false, ctime < atime due to accuracy
So here call ktime_get_coarse_real_ts64 to set inode time coarser while creating new files. It may lower the accuracy of file times. But it's not a big deal since we already use coarse time in other places like ocfs2_update_inode_atime and inode_set_ctime_current.
--- fs/ocfs2/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ocfs2/namei.c +1 -1
@@ -566,7 +566,7 @@ static int __ocfs2_mknod_locked(struct i fe->i_last_eb_blk =0 ;strcpy (fe->i_signature,OCFS2_INODE_SIGNATURE ); fe->i_flags |=cpu_to_le32 (OCFS2_VALID_FL ); -ktime_get_real_ts64 (&ts); +ktime_get_coarse_real_ts64 (&ts); fe->i_atime = fe->i_ctime = fe->i_mtime =cpu_to_le64 (ts.tv_sec); fe->i_mtime_nsec = fe->i_ctime_nsec = fe->i_atime_nsec =
Greg Kroah-Hartman
maintainerPATCH 83/290 ocfs2: fix races between hole punching and AIO+DIO
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Su Yue <[email protected]>
commit 952b023f06a24b2ad6ba67304c4c84d45bea2f18 upstream.
After commit "ocfs2: return real error code in ocfs2_dio_wr_get_block", fstests/generic/300 become from always failed to sometimes failed:
========================================================================
[ 473.293420 ] run fstests generic/300
[ 475.296983 ] JBD2: Ignoring recovery information on journal [ 475.302473 ] ocfs2: Mounting device (253,1) on (node local, slot 0) with ordered data mode. [ 494.290998 ] OCFS2: ERROR (device dm-1): ocfs2_change_extent_flag: Owner 5668 has an extent at cpos 78723 which can no longer be found [ 494.291609 ] On-disk corruption discovered. Please run fsck.ocfs2 once the filesystem is unmounted. [ 494.292018 ] OCFS2: File system is now read-only. [ 494.292224 ] (kworker/19:11,2628,19):ocfs2_mark_extent_written:5272 ERROR: status = -30 [ 494.292602 ] (kworker/19:11,2628,19):ocfs2_dio_end_io_write:2374 ERROR: status = -3
fio: io_u error on file /mnt/scratch/racer: Read-only file system: write offset=460849152, buflen=131072
=========================================================================
In __blockdev_direct_IO, ocfs2_dio_wr_get_block is called to add unwritten extents to a list. extents are also inserted into extent tree in ocfs2_write_begin_nolock. Then another thread call fallocate to puch a hole at one of the unwritten extent. The extent at cpos was removed by ocfs2_remove_extent(). At end io worker thread, ocfs2_search_extent_list found there is no such extent at the cpos.
T1 T2 T3
inode lock
...
insert extents
...
inode unlockocfs2_fallocate
__ocfs2_change_file_space
inode lock
lock ip_alloc_sem
ocfs2_remove_inode_range inode
ocfs2_remove_btree_range
ocfs2_remove_extent
^---remove the extent at cpos 78723 ...
unlock ip_alloc_sem
inode unlock
ocfs2_dio_end_io
ocfs2_dio_end_io_write
lock ip_alloc_sem ocfs2_mark_extent_written
ocfs2_change_extent_flag
ocfs2_search_extent_list ^---failed to find extent
...
unlock ip_alloc_sem
In most filesystems, fallocate is not compatible with racing with AIO+DIO, so fix it by adding to wait for all dio before fallocate/punch_hole like ext4.
--- fs/ocfs2/file.c | 2 ++ 1 file changed, 2 insertions(+)
fs/ocfs2/file.c +2 -0
@@ -1940,6 +1940,8 @@ static int __ocfs2_change_file_space(strinode_lock (inode); +/* Wait all existing dio workers, newcomers will block on i_rwsem */ +inode_dio_wait (inode);/* * This prevents concurrent writes on other nodes */
Greg Kroah-Hartman
maintainerPATCH 84/290 PCI: rockchip-ep: Remove wrong mask on subsys_vendor_id
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rick Wertenbroek <[email protected]>
commit 2dba285caba53f309d6060fca911b43d63f41697 upstream.
Remove wrong mask on subsys_vendor_id. Both the Vendor ID and Subsystem Vendor ID are u16 variables and are written to a u32 register of the controller. The Subsystem Vendor ID was always 0 because the u16 value was masked incorrectly with GENMASK(31,16) resulting in all lower 16 bits being set to 0 prior to the shift.
Remove both masks as they are unnecessary and set the register correctly i.e., the lower 16-bits are the Vendor ID and the upper 16-bits are the Subsystem Vendor ID.
This is documented in the RK3399 TRM section 17.6.7.1.17
--- drivers/pci/controller/pcie-rockchip-ep.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/pci/controller/pcie-rockchip-ep.c +2 -4
@@ -131,10 +131,8 @@ static int rockchip_pcie_ep_write_header/* All functions share the same vendor ID with function 0 */ if (fn ==0 ) { -u32 vid_regs = (hdr->vendorid &GENMASK (15 ,0 )) | - (hdr->subsys_vendor_id &GENMASK (31 ,16 )) <<16 ; - -rockchip_pcie_write (rockchip, vid_regs, +rockchip_pcie_write (rockchip, + hdr->vendorid | hdr->subsys_vendor_id <<16 ,PCIE_CORE_CONFIG_VENDOR ); }
Greg Kroah-Hartman
maintainerPATCH 85/290 dmaengine: axi-dmac: fix possible race in remove()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nuno Sa <[email protected]>
commit 1bc31444209c8efae98cb78818131950d9a6f4d6 upstream.
We need to first free the IRQ before calling of_dma_controller_free(). Otherwise we could get an interrupt and schedule a tasklet while removing the DMA controller.
--- drivers/dma/dma-axi-dmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/dma-axi-dmac.c +1 -1
@@ -1020,8 +1020,8 @@ static int axi_dmac_remove(struct platfo {struct axi_dmac *dmac =platform_get_drvdata (pdev); -of_dma_controller_free (pdev->dev.of_node);free_irq (dmac->irq, dmac); +of_dma_controller_free (pdev->dev.of_node);tasklet_kill (&dmac->chan.vchan.task);dma_async_device_unregister (&dmac->dma_dev);clk_disable_unprepare (dmac->clk);
Greg Kroah-Hartman
maintainerPATCH 56/290 gpio: tqmx86: store IRQ trigger type and unmask status separately
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthias Schiffer <[email protected]>
commit 08af509efdf8dad08e972b48de0e2c2a7919ea8b upstream.
irq_set_type() should not implicitly unmask the IRQ.
All accesses to the interrupt configuration register are moved to a new helper tqmx86_gpio_irq_config(). We also introduce the new rule that accessing irq_type must happen while locked, which will become significant for fixing EDGE_BOTH handling.
--- drivers/gpio/gpio-tqmx86.c | 46 +++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 20 deletions(-)
drivers/gpio/gpio-tqmx86.c +26 -20
@@ -27,16 +27,20 @@#define TQMX86_GPIIC 3/* GPI Interrupt Configuration Register */ #define TQMX86_GPIIS 4/* GPI Interrupt Status Register */ +#define TQMX86_GPII_NONE 0#define TQMX86_GPII_FALLING BIT(0)#define TQMX86_GPII_RISING BIT(1)#define TQMX86_GPII_MASK (BIT(0) | BIT(1))#define TQMX86_GPII_BITS 2 +/* Stored in irq_type with GPII bits */ +#define TQMX86_INT_UNMASKED BIT(2)struct tqmx86_gpio_data {struct gpio_chip chip;struct irq_chip irq_chip;void __iomem *io_base;int irq; +/* Lock must be held for accessing output and irq_type fields */ raw_spinlock_t spinlock;u8 irq_type[TQMX86_NGPI ]; };
@@ -107,20 +111,30 @@ static int tqmx86_gpio_get_direction(strreturn GPIO_LINE_DIRECTION_OUT ; } +static void tqmx86_gpio_irq_config (struct tqmx86_gpio_data *gpio,int offset) + __must_hold(&gpio->spinlock) +{ +u8 type =TQMX86_GPII_NONE , gpiic; + +if (gpio->irq_type[offset] &TQMX86_INT_UNMASKED ) + type = gpio->irq_type[offset] &TQMX86_GPII_MASK ; + + gpiic =tqmx86_gpio_read (gpio,TQMX86_GPIIC ); + gpiic &= ~(TQMX86_GPII_MASK << (offset *TQMX86_GPII_BITS )); + gpiic |= type << (offset *TQMX86_GPII_BITS ); +tqmx86_gpio_write (gpio, gpiic,TQMX86_GPIIC ); +} +static void tqmx86_gpio_irq_mask (struct irq_data *data) {unsigned int offset = (data->hwirq -TQMX86_NGPO );struct tqmx86_gpio_data *gpio =gpiochip_get_data (irq_data_get_irq_chip_data (data));unsigned long flags; -u8 gpiic, mask; - - mask =TQMX86_GPII_MASK << (offset *TQMX86_GPII_BITS );raw_spin_lock_irqsave (&gpio->spinlock, flags); - gpiic =tqmx86_gpio_read (gpio,TQMX86_GPIIC ); - gpiic &= ~mask; -tqmx86_gpio_write (gpio, gpiic,TQMX86_GPIIC ); + gpio->irq_type[offset] &= ~TQMX86_INT_UNMASKED ; +tqmx86_gpio_irq_config (gpio, offset);raw_spin_unlock_irqrestore (&gpio->spinlock, flags); }
@@ -130,15 +144,10 @@ static void tqmx86_gpio_irq_unmask(strucstruct tqmx86_gpio_data *gpio =gpiochip_get_data (irq_data_get_irq_chip_data (data));unsigned long flags; -u8 gpiic, mask; - - mask =TQMX86_GPII_MASK << (offset *TQMX86_GPII_BITS );raw_spin_lock_irqsave (&gpio->spinlock, flags); - gpiic =tqmx86_gpio_read (gpio,TQMX86_GPIIC ); - gpiic &= ~mask; - gpiic |= gpio->irq_type[offset] << (offset *TQMX86_GPII_BITS ); -tqmx86_gpio_write (gpio, gpiic,TQMX86_GPIIC ); + gpio->irq_type[offset] |=TQMX86_INT_UNMASKED ; +tqmx86_gpio_irq_config (gpio, offset);raw_spin_unlock_irqrestore (&gpio->spinlock, flags); }
@@ -149,7 +158,7 @@ static int tqmx86_gpio_irq_set_type(struunsigned int offset = (data->hwirq -TQMX86_NGPO );unsigned int edge_type = type &IRQF_TRIGGER_MASK ;unsigned long flags; -u8 new_type, gpiic; +u8 new_type;switch (edge_type) {case IRQ_TYPE_EDGE_RISING :
@@ -165,13 +174,10 @@ static int tqmx86_gpio_irq_set_type(strureturn -EINVAL ;/* not supported */ } - gpio->irq_type[offset] = new_type; -raw_spin_lock_irqsave (&gpio->spinlock, flags); - gpiic =tqmx86_gpio_read (gpio,TQMX86_GPIIC ); - gpiic &= ~((TQMX86_GPII_MASK ) << (offset *TQMX86_GPII_BITS )); - gpiic |= new_type << (offset *TQMX86_GPII_BITS ); -tqmx86_gpio_write (gpio, gpiic,TQMX86_GPIIC ); + gpio->irq_type[offset] &= ~TQMX86_GPII_MASK ; + gpio->irq_type[offset] |= new_type; +tqmx86_gpio_irq_config (gpio, offset);raw_spin_unlock_irqrestore (&gpio->spinlock, flags);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 57/290 iommu/amd: Introduce pci segment structure
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vasant Hegde <[email protected]>
[ Upstream commit 404ec4e4c169fb64da6b2a38b471c13ac0897c76 ]
Newer AMD systems can support multiple PCI segments, where each segment contains one or more IOMMU instances. However, an IOMMU instance can only support a single PCI segment.
Current code assumes that system contains only one pci segment (segment 0) and creates global data structures such as device table, rlookup table, etc.
Introducing per PCI segment data structure, which contains segment specific data structures. This will eventually replace the global data structures.
Also update amd_iommu->pci_seg variable to point to PCI segment structure instead of PCI segment ID.
Stable-dep-of: a295ec52c862 ("iommu/amd: Fix sysfs leak in iommu init")
--- drivers/iommu/amd/amd_iommu_types.h | 24 ++++++++++++++- drivers/iommu/amd/init.c | 46 ++++++++++++++++++++++++++++- 2 files changed, 68 insertions(+), 2 deletions(-)
drivers/iommu/amd/amd_iommu_types.h +23 -1
@@ -435,6 +435,11 @@ extern bool amd_iommu_irq_remap;/* kmem_cache to get tables with 128 byte alignement */ extern struct kmem_cache *amd_iommu_irq_cache; +/* Make iterating over all pci segment easier */ +#define for_each_pci_segment (pci_seg) \ + list_for_each_entry((pci_seg), &amd_iommu_pci_seg_list, list) +#define for_each_pci_segment_safe (pci_seg, next) \ + list_for_each_entry_safe((pci_seg), (next), &amd_iommu_pci_seg_list, list)/* * Make iterating over all IOMMUs easier */
@@ -494,6 +499,17 @@ struct domain_pgtable {u64 *root; }; +/* +* This structure contains information about one PCI segment in the system. +*/ +struct amd_iommu_pci_seg { +/* List with all PCI segments in the system */ +struct list_head list; + +/* PCI segment number */ +u16 id; +}; +/* * Structure where we save information about one hardware AMD IOMMU in the * system.
@@ -545,7 +561,7 @@ struct amd_iommu {u16 cap_ptr;/* pci domain of this IOMMU */ -u16 pci_seg; +struct amd_iommu_pci_seg *pci_seg;/* start of exclusion range of that IOMMU */ u64 exclusion_start;
@@ -676,6 +692,12 @@ extern struct list_head ioapic_map;extern struct list_head hpet_map;extern struct list_head acpihid_map; +/* +* List with all PCI segments in the system. This list is not locked because +* it is only written at driver initialization time +*/ +extern struct list_head amd_iommu_pci_seg_list; +/* * List with all IOMMUs in the system. This list is not locked because it is * only written and read at driver initialization or suspend time
drivers/iommu/amd/init.c +45 -1
78 lines not on this page · raw message
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 58/290 iommu/amd: Fix sysfs leak in iommu init
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kun(llfl) <[email protected]>
[ Upstream commit a295ec52c8624883885396fde7b4df1a179627c3 ]
During the iommu initialization, iommu_init_pci() adds sysfs nodes. However, these nodes aren't remove in free_iommu_resources() subsequently.
--- drivers/iommu/amd/init.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/iommu/amd/init.c +9 -0
@@ -1494,8 +1494,17 @@ static void __init free_pci_segments(void) } } +static void __init free_sysfs (struct amd_iommu *iommu) +{ +if (iommu->iommu.dev) { +iommu_device_unregister (&iommu->iommu); +iommu_device_sysfs_remove (&iommu->iommu); + } +} +static void __init free_iommu_one (struct amd_iommu *iommu) { +free_sysfs (iommu);free_cwwb_sem (iommu);free_command_buffer (iommu);free_event_buffer (iommu);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 59/290 iommu: Return right value in iommu_sva_bind_device()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lu Baolu <[email protected]>
[ Upstream commit 89e8a2366e3bce584b6c01549d5019c5cda1205e ]
iommu_sva_bind_device() should return either a sva bond handle or an ERR_PTR value in error cases. Existing drivers (idxd and uacce) only check the return value with IS_ERR(). This could potentially lead to a kernel NULL pointer dereference issue if the function returns NULL instead of an error pointer.
In reality, this doesn't cause any problems because iommu_sva_bind_device() only returns NULL when the kernel is not configured with CONFIG_IOMMU_SVA. In this case, iommu_dev_enable_feature(dev, IOMMU_DEV_FEAT_SVA) will return an error, and the device drivers won't call iommu_sva_bind_device() at all.
--- include/linux/iommu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/iommu.h +1 -1
@@ -1026,7 +1026,7 @@ iommu_aux_get_pasid(struct iommu_domain *domain, struct device *dev)static inline struct iommu_sva *iommu_sva_bind_device (struct device *dev,struct mm_struct *mm,void *drvdata) { -return NULL ; +return ERR_PTR (-ENODEV ); }static inline void iommu_sva_unbind_device (struct iommu_sva *handle)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 60/290 HID: logitech-dj: Fix memory leak in logi_dj_recv_switch_to_dj_mode()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: José Expósito <[email protected]>
[ Upstream commit ce3af2ee95170b7d9e15fff6e500d67deab1e7b3 ]
Fix a memory leak on logi_dj_recv_send_report() error path.
--- drivers/hid/hid-logitech-dj.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/hid/hid-logitech-dj.c +3 -1
@@ -1218,8 +1218,10 @@ static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev,*/ msleep (50 ); -if (retval) +if (retval) { +kfree (dj_report);return retval; + } }/*
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 61/290 drm/vmwgfx: 3D disabled should not effect STDU memory limits
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 fb5e19d2dd03eb995ccd468d599b2337f7f66555 ]
This limit became a hard cap starting with the change referenced below. Surface creation on the device will fail if the requested size is larger than this limit so altering the value arbitrarily will expose modes that are too large for the device's hard limits.
--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 7 ------- 1 file changed, 7 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +0 -7
@@ -752,13 +752,6 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)vmw_read (dev_priv,SVGA_REG_SUGGESTED_GBOBJECT_MEM_SIZE_KB ); -/* -* Workaround for low memory 2D VMs to compensate for the -* allocation taken by fbdev -*/ -if (!(dev_priv->capabilities &SVGA_CAP_3D )) - mem_size *=3 ; - dev_priv->max_mob_pages = mem_size *1024 /PAGE_SIZE ; dev_priv->prim_bb_mem = vmw_read(dev_priv,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 52/290 Input: try trimming too long modalias strings
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Torokhov <[email protected]>
commit 0774d19038c496f0c3602fb505c43e1b2d8eed85 upstream.
If an input device declares too many capability bits then modalias string for such device may become too long and not fit into uevent buffer, resulting in failure of sending said uevent. This, in turn, may prevent userspace from recognizing existence of such devices.
This is typically not a concern for real hardware devices as they have limited number of keys, but happen with synthetic devices such as ones created by xen-kbdfront driver, which creates devices as being capable of delivering all possible keys, since it doesn't know what keys the backend may produce.
To deal with such devices input core will attempt to trim key data, in the hope that the rest of modalias string will fit in the given buffer. When trimming key data it will indicate that it is not complete by placing "+," sign, resulting in conversions like this:
old: k71,72,73,74,78,7A,7B,7C,7D,8E,9E,A4,AD,E0,E1,E4,F8,174,
new: k71,72,73,74,78,7A,7B,7C,+,
This should allow existing udev rules continue to work with existing devices, and will also allow writing more complex rules that would recognize trimmed modalias and check input device characteristics by other means (for example by parsing KEY= data in uevent or parsing input device sysfs attributes).
Note that the driver core may try adding more uevent environment variables once input core is done adding its own, so when forming modalias we can not use the entire available buffer, so we reduce it by somewhat an arbitrary amount (96 bytes).
---
--- drivers/input/input.c | 105 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 90 insertions(+), 15 deletions(-)
drivers/input/input.c +90 -15
@@ -1356,19 +1356,19 @@ static int input_print_modalias_bits(cha char name, unsigned long *bm, unsigned int min_bit, unsigned int max_bit) { - int len = 0, i; + int bit = min_bit; +int len =0 ; len +=snprintf (buf,max (size,0 ),"%c" , name); -for (i = min_bit; i < max_bit; i++) -if (bm[BIT_WORD (i)] &BIT_MASK (i)) - len +=snprintf (buf + len,max (size - len,0 ),"%X," , i); +for_each_set_bit_from (bit, bm, max_bit) + len +=snprintf (buf + len,max (size - len,0 ),"%X," , bit);return len; } -static int input_print_modalias (char *buf,int size,struct input_dev *id, -int add_cr) +static int input_print_modalias_parts (char *buf,int size,int full_len, +struct input_dev *id) { -int len; +int len, klen, remainder, space; len = snprintf(buf, max(size, 0), "input:b%04Xv%04Xp%04Xe%04X-",
@@ -1377,8 +1377,49 @@ static int input_print_modalias(char *bu len +=input_print_modalias_bits (buf + len, size - len,'e' , id->evbit,0 ,EV_MAX ); - len +=input_print_modalias_bits (buf + len, size - len, + +/* +* Calculate the remaining space in the buffer making sure we +* have place for the terminating 0. +*/ + space =max (size - (len +1 ),0 ); + + klen =input_print_modalias_bits (buf + len, size - len,'k' , id->keybit,KEY_MIN_INTERESTING ,KEY_MAX ); + len += klen; + +/* +* If we have more data than we can fit in the buffer, check +* if we can trim key data to fit in the rest. We will indicate +* that key data is incomplete by adding "+" sign at the end, like +* this: * "k1,2,3,45,+,". +* +* Note that we shortest key info (if present) is "k+," so we +* can only try to trim if key data is longer than that. +*/ +if (full_len && size < full_len +1 && klen >3 ) { + remainder = full_len - len; +/* +* We can only trim if we have space for the remainder +* and also for at least "k+," which is 3 more characters. +*/ +if (remainder <= space -3 ) { +int i; +/* +* We are guaranteed to have 'k' in the buffer, so +* we need at least 3 additional bytes for storing +* "+," in addition to the remainder. +*/ +for (i = size -1 - remainder -3 ; i >=0 ; i--) { +if (buf[i] =='k' || buf[i] ==',' ) { +strcpy (buf + i +1 ,"+," ); + len = i +3 ;/* Not counting '\0' */ +break ; + } + } + } + } + len +=input_print_modalias_bits (buf + len, size - len,'r' , id->relbit,0 ,REL_MAX ); len += input_print_modalias_bits(buf + len, size - len,
@@ -1394,12 +1435,25 @@ static int input_print_modalias(char *bu len +=input_print_modalias_bits (buf + len, size - len,'w' , id->swbit,0 ,SW_MAX ); -if (add_cr) - len +=snprintf (buf + len,max (size - len,0 ),"\n" ); -return len; } +static int input_print_modalias (char *buf,int size,struct input_dev *id) +{ +int full_len; + +/* +* Printing is done in 2 passes: first one figures out total length +* needed for the modalias string, second one will try to trim key +* data in case when buffer is too small for the entire modalias. +* If the buffer is too small regardless, it will fill as much as it +* can (without trimming key data) into the buffer and leave it to +* the caller to figure out what to do with the result. +*/ + full_len =input_print_modalias_parts (NULL ,0 ,0 , id); +return input_print_modalias_parts (buf, size, full_len, id); +} +static ssize_t input_dev_show_modalias (struct device *dev,struct device_attribute *attr,char *buf)
@@ -1407,7 +1461,9 @@ static ssize_t input_dev_show_modalias(sstruct input_dev *id =to_input_dev (dev);ssize_t len; - len =input_print_modalias (buf,PAGE_SIZE , id,1 ); + len =input_print_modalias (buf,PAGE_SIZE , id); +if (len <PAGE_SIZE -2 ) + len +=snprintf (buf + len,PAGE_SIZE - len,"\n" );return min_t (int, len,PAGE_SIZE ); }
@@ -1582,6 +1638,23 @@ static int input_add_uevent_bm_var(strucreturn 0 ; } +/* +* This is a pretty gross hack. When building uevent data the driver core +* may try adding more environment variables to kobj_uevent_env without +* telling us, so we have no idea how much of the buffer we can use to +* avoid overflows/-ENOMEM elsewhere. To work around this let's artificially +* reduce amount of memory we will use for the modalias environment variable. +* +* The potential additions are: +* +* SEQNUM=18446744073709551615 - (%llu - 28 bytes) +* HOME=/ (6 bytes) +* PATH=/sbin:/bin:/usr/sbin:/usr/bin (34 bytes) +* +* 68 bytes total. Allow extra buffer - 96 bytes +*/ +#define UEVENT_ENV_EXTRA_LEN 96 +static int input_add_uevent_modalias_var (struct kobj_uevent_env *env,struct input_dev *dev) {
@@ -1591,9 +1664,11 @@ static int input_add_uevent_modalias_varreturn -ENOMEM ; len =input_print_modalias (&env->buf[env->buflen -1 ], -sizeof (env->buf) - env->buflen, - dev,0 ); -if (len >= (sizeof (env->buf) - env->buflen)) + (int )sizeof (env->buf) - env->buflen - +UEVENT_ENV_EXTRA_LEN , + dev); +if (len >= ((int )sizeof (env->buf) - env->buflen - +UEVENT_ENV_EXTRA_LEN ))return -ENOMEM ; env->buflen += len;
Greg Kroah-Hartman
maintainerPATCH 87/290 intel_th: pci: Add Granite Rapids support
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Shishkin <[email protected]>
commit e44937889bdf4ecd1f0c25762b7226406b9b7a69 upstream.
Add support for the Trace Hub in Granite Rapids.
--- drivers/hwtracing/intel_th/pci.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/hwtracing/intel_th/pci.c +5 -0
@@ -305,6 +305,11 @@ static const struct pci_device_id intel_ .driver_data = (kernel_ulong_t)&intel_th_2x, }, { +/* Granite Rapids */ + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x0963), + .driver_data = (kernel_ulong_t)&intel_th_2x, + }, + {/* Alder Lake CPU */ PCI_DEVICE (PCI_VENDOR_ID_INTEL ,0x466f ), .driver_data = (kernel_ulong_t)&intel_th_2x,
Greg Kroah-Hartman
maintainerPATCH 96/290 mptcp: ensure snd_una is properly initialized on connect
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paolo Abeni <[email protected]>
commit 8031b58c3a9b1db3ef68b3bd749fbee2e1e1aaa3 upstream.
This is strictly related to commit fb7a0d334894 ("mptcp: ensure snd_nxt is properly initialized on connect"). It turns out that syzkaller can trigger the retransmit after fallback and before processing any other incoming packet - so that snd_una is still left uninitialized.
Address the issue explicitly initializing snd_una together with snd_nxt and write_seq.
[ Conflicts in protocol.c, similar to the ones from commit 99951b62bf20
("mptcp: ensure snd_nxt is properly initialized on connect"), with the same resolution. Note that in this version, 'snd_una' is an atomic64 type, so use atomic64_set() instead, as it is done everywhere else. ]
--- net/mptcp/protocol.c | 1 + 1 file changed, 1 insertion(+)
net/mptcp/protocol.c +1 -0
@@ -2646,6 +2646,7 @@ static int mptcp_stream_connect(struct smptcp_subflow_early_fallback (msk, subflow);WRITE_ONCE (msk->write_seq, subflow->idsn); +atomic64_set (&msk->snd_una, msk->write_seq); do_connect: err = ssock->ops->connect (ssock, uaddr, addr_len, flags);
Greg Kroah-Hartman
maintainerPATCH 97/290 mptcp: pm: inc RmAddr MIB counter once per RM_ADDR ID
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: YonglongLi <[email protected]>
commit 6a09788c1a66e3d8b04b3b3e7618cc817bb60ae9 upstream.
The RmAddr MIB counter is supposed to be incremented once when a valid RM_ADDR has been received. Before this patch, it could have been incremented as many times as the number of subflows connected to the linked address ID, so it could have been 0, 1 or more than 1.
The "RmSubflow" is incremented after a local operation. In this case, it is normal to tied it with the number of subflows that have been actually removed.
The "remove invalid addresses" MP Join subtest has been modified to validate this case. A broadcast IP address is now used instead: the client will not be able to create a subflow to this address. The consequence is that when receiving the RM_ADDR with the ID attached to this broadcast IP address, no subflow linked to this ID will be found.
[ Conflicts in pm_netlink.c because the commit 9f12e97bf16c ("mptcp:
unify RM_ADDR and RM_SUBFLOW receiving"), and commit d0b698ca9a27 ("mptcp: remove multi addresses in PM") are not in this version. To fix the issue, the incrementation should be done outside the loop: the same resolution has been applied here.
The selftest modification has been dropped, because the modified test is not in this version. That's fine, we can test with selftests from a newer version. ]
--- net/mptcp/pm_netlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/mptcp/pm_netlink.c +2 -2
@@ -427,10 +427,10 @@ void mptcp_pm_nl_rm_addr_received(struct msk->pm.subflows--;WRITE_ONCE (msk->pm.accept_addr, true); -__MPTCP_INC_STATS (sock_net (sk),MPTCP_MIB_RMADDR ); -break ; } + +__MPTCP_INC_STATS (sock_net (sk),MPTCP_MIB_RMADDR ); }void mptcp_pm_nl_rm_subflow_received (struct mptcp_sock *msk,u8 rm_id)
Greg Kroah-Hartman
maintainerPATCH 98/290 mptcp: pm: update add_addr counters after connect
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: YonglongLi <[email protected]>
commit 40eec1795cc27b076d49236649a29507c7ed8c2d upstream.
The creation of new subflows can fail for different reasons. If no subflow have been created using the received ADD_ADDR, the related counters should not be updated, otherwise they will never be decremented for events related to this ID later on.
For the moment, the number of accepted ADD_ADDR is only decremented upon the reception of a related RM_ADDR, and only if the remote address ID is currently being used by at least one subflow. In other words, if no subflow can be created with the received address, the counter will not be decremented. In this case, it is then important not to increment pm.add_addr_accepted counter, and not to modify pm.accept_addr bit.
Note that this patch does not modify the behaviour in case of failures later on, e.g. if the MP Join is dropped or rejected.
The "remove invalid addresses" MP Join subtest has been modified to validate this case. The broadcast IP address is added before the "valid" address that will be used to successfully create a subflow, and the limit is decreased by one: without this patch, it was not possible to create the last subflow, because:
- the broadcast address would have been accepted even if it was not
usable: the creation of a subflow to this address results in an error,
- the limit of 2 accepted ADD_ADDR would have then been reached.
[ Conflicts in pm_netlink.c because commit 1a0d6136c5f0 ("mptcp: local
addresses fullmesh") is not present in this version (+ others changing the context). To resolve the conflicts, the same block is moved later, and under the condition that the call to __mptcp_subflow_connect() didn't fail.
The selftest modification has been dropped, because the modified test is not in this version. That's fine, we can test with selftests from a newer version. ]
--- net/mptcp/pm_netlink.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
net/mptcp/pm_netlink.c +9 -5
@@ -371,15 +371,12 @@ void mptcp_pm_nl_add_addr_received(strucstruct sock *sk = (struct sock *)msk;struct mptcp_addr_info remote;struct mptcp_addr_info local; +int err;pr_debug ("accepted %d:%d remote family %d" , msk->pm.add_addr_accepted, msk->pm.add_addr_accept_max, msk->pm.remote.family); - msk->pm.add_addr_accepted++; msk->pm.subflows++; -if (msk->pm.add_addr_accepted >= msk->pm.add_addr_accept_max || - msk->pm.subflows >= msk->pm.subflows_max) -WRITE_ONCE (msk->pm.accept_addr, false);/* connect to the specified remote address, using whatever * local address the routing configuration will pick.
@@ -391,9 +388,16 @@ void mptcp_pm_nl_add_addr_received(struc local.family = remote.family;spin_unlock_bh (&msk->pm.lock); -__mptcp_subflow_connect ((struct sock *)msk, &local, &remote); + err =__mptcp_subflow_connect ((struct sock *)msk, &local, &remote);spin_lock_bh (&msk->pm.lock); +if (!err) { + msk->pm.add_addr_accepted++; +if (msk->pm.add_addr_accepted >= msk->pm.add_addr_accept_max || + msk->pm.subflows >= msk->pm.subflows_max) +WRITE_ONCE (msk->pm.accept_addr, false); + } +mptcp_pm_announce_addr (msk, &remote, true); }
Greg Kroah-Hartman
maintainerPATCH 99/290 remoteproc: k3-r5: Jump to error handling labels in start/stop errors
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Beleswar Padhi <[email protected]>
commit 1dc7242f6ee0c99852cb90676d7fe201cf5de422 upstream.
In case of errors during core start operation from sysfs, the driver directly returns with the -EPERM error code. Fix this to ensure that mailbox channels are freed on error before returning by jumping to the 'put_mbox' error handling label. Similarly, jump to the 'out' error handling label to return with required -EPERM error code during the core stop operation from sysfs.
--- drivers/remoteproc/ti_k3_r5_remoteproc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/remoteproc/ti_k3_r5_remoteproc.c +4 -2
@@ -484,7 +484,8 @@ static int k3_r5_rproc_start(struct rproif (core != core0 && core0->rproc->state ==RPROC_OFFLINE ) {dev_err (dev,"%s: can not start core 1 before core 0\n" , __func__); -return -EPERM ; + ret = -EPERM ; + goto put_mbox; } ret =k3_r5_core_run (core);
@@ -547,7 +548,8 @@ static int k3_r5_rproc_stop(struct rprocif (core != core1 && core1->rproc->state !=RPROC_OFFLINE ) {dev_err (dev,"%s: can not stop core 0 before core 1\n" , __func__); -return -EPERM ; + ret = -EPERM ; + goto out; } ret =k3_r5_core_halt (core);
Greg Kroah-Hartman
maintainerPATCH 100/290 greybus: Fix use-after-free bug in gb_interface_release due to race condition.
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sicong Huang <[email protected]>
commit 5c9c5d7f26acc2c669c1dcf57d1bb43ee99220ce upstream.
In gb_interface_create, &intf->mode_switch_completion is bound with gb_interface_mode_switch_work. Then it will be started by gb_interface_request_mode_switch. Here is the relevant code.
if (!queue_work(system_long_wq, &intf->mode_switch_work)) {
...
}If we call gb_interface_release to make cleanup, there may be an unfinished work. This function will call kfree to free the object "intf". However, if gb_interface_mode_switch_work is scheduled to run after kfree, it may cause use-after-free error as gb_interface_mode_switch_work will use the object "intf". The possible execution flow that may lead to the issue is as follows:
CPU0 CPU1
| gb_interface_create
| gb_interface_request_mode_switch
gb_interface_release |
kfree(intf) (free) |
| gb_interface_mode_switch_work
| mutex_lock(&intf->mutex) (use)Fix it by canceling the work before kfree.
--- drivers/greybus/interface.c | 1 + 1 file changed, 1 insertion(+)
drivers/greybus/interface.c +1 -0
@@ -694,6 +694,7 @@ static void gb_interface_release(structtrace_gb_interface_release (intf); +cancel_work_sync (&intf->mode_switch_work);kfree (intf); }
Greg Kroah-Hartman
maintainerPATCH 101/290 usb-storage: alauda: Check whether the media is initialized
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shichao Lai <[email protected]>
[ Upstream commit 16637fea001ab3c8df528a8995b3211906165a30 ]
The member "uzonesize" of struct alauda_info will remain 0 if alauda_init_media() fails, potentially causing divide errors in alauda_read_data() and alauda_write_lba().
- Add a member "media_initialized" to struct alauda_info.
- Change a condition in alauda_check_media() to ensure the first initialization.
- Add an error check for the return value of alauda_init_media().
--- drivers/usb/storage/alauda.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/usb/storage/alauda.c +6 -3
@@ -105,6 +105,8 @@ struct alauda_info {unsigned char sense_key;unsigned long sense_asc;/* additional sense code */ unsigned long sense_ascq;/* additional sense code qualifier */ + +bool media_initialized; };#define short_pack (lsb,msb) ( ((u16)(lsb)) | ( ((u16)(msb))<<8 ) )
@@ -476,11 +478,12 @@ static int alauda_check_media(struct us_data *us) }/* Check for media change */ -if (status[0 ] &0x08 ) { +if (status[0 ] &0x08 || !info->media_initialized) {usb_stor_dbg (us,"Media change detected\n" );alauda_free_maps (&MEDIA_INFO (us)); -alauda_init_media (us); - + rc =alauda_init_media (us); +if (rc ==USB_STOR_TRANSPORT_GOOD ) + info->media_initialized = true; info->sense_key =UNIT_ATTENTION ; info->sense_asc =0x28 ; info->sense_ascq =0x00 ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 102/290 i2c: at91: Fix the functionality flags of the slave-only interface
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jean Delvare <[email protected]>
[ Upstream commit d6d5645e5fc1233a7ba950de4a72981c394a2557 ]
When an I2C adapter acts only as a slave, it should not claim to support I2C master capabilities.
--- drivers/i2c/busses/i2c-at91-slave.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/i2c/busses/i2c-at91-slave.c +1 -2
@@ -106,8 +106,7 @@ static int at91_unreg_slave(struct i2c_client *slave)static u32 at91_twi_func (struct i2c_adapter *adapter) { -return I2C_FUNC_SLAVE |I2C_FUNC_I2C |I2C_FUNC_SMBUS_EMUL - |I2C_FUNC_SMBUS_READ_BLOCK_DATA ; +return I2C_FUNC_SLAVE ; }static const struct i2c_algorithm at91_twi_algorithm_slave = {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 103/290 i2c: designware: Fix the functionality flags of the slave-only interface
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jean Delvare <[email protected]>
[ Upstream commit cbf3fb5b29e99e3689d63a88c3cddbffa1b8de99 ]
When an I2C adapter acts only as a slave, it should not claim to support I2C master capabilities.
--- drivers/i2c/busses/i2c-designware-slave.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-designware-slave.c +1 -1
@@ -232,7 +232,7 @@ static const struct i2c_algorithm i2c_dw_algo = {void i2c_dw_configure_slave (struct dw_i2c_dev *dev) { - dev->functionality =I2C_FUNC_SLAVE |DW_IC_DEFAULT_FUNCTIONALITY ; + dev->functionality =I2C_FUNC_SLAVE ; dev->slave_cfg =DW_IC_CON_RX_FIFO_FULL_HLD_CTRL |DW_IC_CON_RESTART_EN |DW_IC_CON_STOP_DET_IFADDRESSED ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 104/290 zap_pid_ns_processes: clear TIF_NOTIFY_SIGNAL along with TIF_SIGPENDING
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleg Nesterov <[email protected]>
[ Upstream commit 7fea700e04bd3f424c2d836e98425782f97b494e ]
kernel_wait4() doesn't sleep and returns -EINTR if there is no eligible child and signal_pending() is true.
That is why zap_pid_ns_processes() clears TIF_SIGPENDING but this is not enough, it should also clear TIF_NOTIFY_SIGNAL to make signal_pending() return false and avoid a busy-wait loop.
--- kernel/pid_namespace.c | 1 + 1 file changed, 1 insertion(+)
kernel/pid_namespace.c +1 -0
@@ -221,6 +221,7 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns)*/ do {clear_thread_flag (TIF_SIGPENDING ); +clear_thread_flag (TIF_NOTIFY_SIGNAL ); rc =kernel_wait4 (-1 ,NULL , __WALL,NULL ); }while (rc != -ECHILD );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 105/290 padata: Disable BH when taking works lock on MT path
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Herbert Xu <[email protected]>
[ Upstream commit 58329c4312031603bb1786b44265c26d5065fe72 ]
As the old padata code can execute in softirq context, disable softirqs for the new padata_do_mutithreaded code too as otherwise lockdep will get antsy.
--- kernel/padata.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/padata.c +4 -4
@@ -111,7 +111,7 @@ static int __init padata_work_alloc_mt(int nworks, void *data, {int i; -spin_lock (&padata_works_lock); +spin_lock_bh (&padata_works_lock);/* Start at 1 because the current task participates in the job. */ for (i =1 ; i < nworks; ++i) {struct padata_work *pw =padata_work_alloc ();
@@ -121,7 +121,7 @@ static int __init padata_work_alloc_mt(int nworks, void *data,padata_work_init (pw, padata_mt_helper, data,0 );list_add (&pw->pw_list, head); } -spin_unlock (&padata_works_lock); +spin_unlock_bh (&padata_works_lock);return i; }
@@ -139,12 +139,12 @@ static void __init padata_works_free(struct list_head *works)if (list_empty (works))return ; -spin_lock (&padata_works_lock); +spin_lock_bh (&padata_works_lock);list_for_each_entry_safe (cur, next, works, pw_list) {list_del (&cur->pw_list);padata_work_free (cur); } -spin_unlock (&padata_works_lock); +spin_unlock_bh (&padata_works_lock); }static void padata_parallel_worker (struct work_struct *parallel_work)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 88/290 intel_th: pci: Add Granite Rapids SOC support
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Shishkin <[email protected]>
commit 854afe461b009801a171b3a49c5f75ea43e4c04c upstream.
Add support for the Trace Hub in Granite Rapids SOC.
--- drivers/hwtracing/intel_th/pci.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/hwtracing/intel_th/pci.c +5 -0
@@ -310,6 +310,11 @@ static const struct pci_device_id intel_ .driver_data = (kernel_ulong_t)&intel_th_2x, }, { +/* Granite Rapids SOC */ + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x3256), + .driver_data = (kernel_ulong_t)&intel_th_2x, + }, + {/* Alder Lake CPU */ PCI_DEVICE (PCI_VENDOR_ID_INTEL ,0x466f ), .driver_data = (kernel_ulong_t)&intel_th_2x,
Greg Kroah-Hartman
maintainerPATCH 106/290 rcutorture: Fix rcu_torture_one_read() pipe_count overflow comment
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul E. McKenney <[email protected]>
[ Upstream commit 8b9b443fa860276822b25057cb3ff3b28734dec0 ]
The "pipe_count > RCU_TORTURE_PIPE_LEN" check has a comment saying "Should not happen, but...". This is only true when testing an RCU whose grace periods are always long enough. This commit therefore fixes this comment.
--- kernel/rcu/rcutorture.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/rcu/rcutorture.c +2 -1
@@ -1407,7 +1407,8 @@ static bool rcu_torture_one_read(struct torture_random_state *trsp)preempt_disable (); pipe_count =READ_ONCE (p->rtort_pipe_count);if (pipe_count >RCU_TORTURE_PIPE_LEN ) { -/* Should not happen, but... */ +// Should not happen in a correct RCU implementation, +// happens quite often for torture_type=busted. pipe_count =RCU_TORTURE_PIPE_LEN ; } completed = cur_ops->get_gp_seq ();
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 107/290 rcutorture: Fix invalid context warning when enable srcu barrier testing
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zqiang <[email protected]>
[ Upstream commit 668c0406d887467d53f8fe79261dda1d22d5b671 ]
When the torture_type is set srcu or srcud and cb_barrier is non-zero, running the rcutorture test will trigger the following warning:
[ 163.910989][ C1] BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48 [ 163.910994][ C1] in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 0, name: swapper/1 [ 163.910999][ C1] preempt_count: 10001, expected: 0 [ 163.911002][ C1] RCU nest depth: 0, expected: 0 [ 163.911005][ C1] INFO: lockdep is turned off. [ 163.911007][ C1] irq event stamp: 30964 [ 163.911010][ C1] hardirqs last enabled at (30963): [<ffffffffabc7df52>] do_idle+0x362/0x500 [ 163.911018][ C1] hardirqs last disabled at (30964): [<ffffffffae616eff>] sysvec_call_function_single+0xf/0xd0 [ 163.911025][ C1] softirqs last enabled at (0): [<ffffffffabb6475f>] copy_process+0x16ff/0x6580 [ 163.911033][ C1] softirqs last disabled at (0): [<0000000000000000>] 0x0 [ 163.911038][ C1] Preemption disabled at: [ 163.911039][ C1] [<ffffffffacf1964b>] stack_depot_save_flags+0x24b/0x6c0 [ 163.911063][ C1] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G W 6.8.0-rc4-rt4-yocto-preempt-rt+ #3 1e39aa9a737dd024a3275c4f835a872f673a7d3a [ 163.911071][ C1] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.2-0-gea1b7a073390-prebuilt.qemu.org 04/01/2014 [ 163.911075][ C1] Call Trace: [ 163.911078][ C1] <IRQ> [ 163.911080][ C1] dump_stack_lvl+0x88/0xd0 [ 163.911089][ C1] dump_stack+0x10/0x20 [ 163.911095][ C1] __might_resched+0x36f/0x530 [ 163.911105][ C1] rt_spin_lock+0x82/0x1c0 [ 163.911112][ C1] spin_lock_irqsave_ssp_contention+0xb8/0x100 [ 163.911121][ C1] srcu_gp_start_if_needed+0x782/0xf00 [ 163.911128][ C1] ? _raw_spin_unlock_irqrestore+0x46/0x70 [ 163.911136][ C1] ? debug_object_active_state+0x336/0x470 [ 163.911148][ C1] ? __pfx_srcu_gp_start_if_needed+0x10/0x10 [ 163.911156][ C1] ? __pfx_lock_release+0x10/0x10 [ 163.911165][ C1] ? __pfx_rcu_torture_barrier_cbf+0x10/0x10 [ 163.911188][ C1] __call_srcu+0x9f/0xe0 [ 163.911196][ C1] call_srcu+0x13/0x20 [ 163.911201][ C1] srcu_torture_call+0x1b/0x30 [ 163.911224][ C1] rcu_torture_barrier1cb+0x4a/0x60 [ 163.911247][ C1] __flush_smp_call_function_queue+0x267/0xca0 [ 163.911256][ C1] ? __pfx_rcu_torture_barrier1cb+0x10/0x10 [ 163.911281][ C1] generic_smp_call_function_single_interrupt+0x13/0x20 [ 163.911288][ C1] __sysvec_call_function_single+0x7d/0x280 [ 163.911295][ C1] sysvec_call_function_single+0x93/0xd0 [ 163.911302][ C1] </IRQ> [ 163.911304][ C1] <TASK> [ 163.911308][ C1] asm_sysvec_call_function_single+0x1b/0x20 [ 163.911313][ C1] RIP: 0010:default_idle+0x17/0x20 [ 163.911326][ C1] RSP: 0018:ffff888001997dc8 EFLAGS: 00000246 [ 163.911333][ C1] RAX: 0000000000000000 RBX: dffffc0000000000 RCX: ffffffffae618b51 [ 163.911337][ C1] RDX: 0000000000000000 RSI: ffffffffaea80920 RDI: ffffffffaec2de80 [ 163.911342][ C1] RBP: ffff888001997dc8 R08: 0000000000000001 R09: ffffed100d740cad [ 163.911346][ C1] R10: ffffed100d740cac R11: ffff88806ba06563 R12: 0000000000000001 [ 163.911350][ C1] R13: ffffffffafe460c0 R14: ffffffffafe460c0 R15: 0000000000000000 [ 163.911358][ C1] ? ct_kernel_exit.constprop.3+0x121/0x160 [ 163.911369][ C1] ? lockdep_hardirqs_on+0xc4/0x150 [ 163.911376][ C1] arch_cpu_idle+0x9/0x10 [ 163.911383][ C1] default_idle_call+0x7a/0xb0 [ 163.911390][ C1] do_idle+0x362/0x500 [ 163.911398][ C1] ? __pfx_do_idle+0x10/0x10 [ 163.911404][ C1] ? complete_with_flags+0x8b/0xb0 [ 163.911416][ C1] cpu_startup_entry+0x58/0x70 [ 163.911423][ C1] start_secondary+0x221/0x280 [ 163.911430][ C1] ? __pfx_start_secondary+0x10/0x10 [ 163.911440][ C1] secondary_startup_64_no_verify+0x17f/0x18b [ 163.911455][ C1] </TASK>
This commit therefore use smp_call_on_cpu() instead of smp_call_function_single(), make rcu_torture_barrier1cb() invoked happens on task-context.
--- kernel/rcu/rcutorture.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
kernel/rcu/rcutorture.c +4 -5
@@ -2210,11 +2210,12 @@ static void rcu_torture_barrier_cbf(struct rcu_head *rcu) }/* IPI handler to get callback posted on desired CPU, if online. */ -static void rcu_torture_barrier1cb (void *rcu_void) +static int rcu_torture_barrier1cb (void *rcu_void) {struct rcu_head *rhp = rcu_void; cur_ops->call (rhp, rcu_torture_barrier_cbf); +return 0 ; }/* kthread function to register callbacks used to test RCU barriers. */
@@ -2240,11 +2241,9 @@ static int rcu_torture_barrier_cbs(void *arg)* The above smp_load_acquire() ensures barrier_phase load * is ordered before the following ->call(). */ -if (smp_call_function_single (myid, rcu_torture_barrier1cb, - &rcu,1 )) { -// IPI failed, so use direct call from current CPU. +if (smp_call_on_cpu (myid, rcu_torture_barrier1cb, &rcu,1 )) cur_ops->call (&rcu, rcu_torture_barrier_cbf); - } +if (atomic_dec_and_test (&barrier_cbs_count))wake_up (&barrier_wq); }while (!torture_must_stop ());
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 108/290 block/ioctl: prefer different overflow check
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Justin Stitt <[email protected]>
[ Upstream commit ccb326b5f9e623eb7f130fbbf2505ec0e2dcaff9 ]
Running syzkaller with the newly reintroduced signed integer overflow sanitizer shows this report:
[ 62.982337] ------------[ cut here ]------------ [ 62.985692] cgroup: Invalid name [ 62.986211] UBSAN: signed-integer-overflow in ../block/ioctl.c:36:46 [ 62.989370] 9pnet_fd: p9_fd_create_tcp (7343): problem connecting socket to 127.0.0.1 [ 62.992992] 9223372036854775807 + 4095 cannot be represented in type 'long long' [ 62.997827] 9pnet_fd: p9_fd_create_tcp (7345): problem connecting socket to 127.0.0.1 [ 62.999369] random: crng reseeded on system resumption [ 63.000634] GUP no longer grows the stack in syz-executor.2 (7353): 20002000-20003000 (20001000) [ 63.000668] CPU: 0 PID: 7353 Comm: syz-executor.2 Not tainted 6.8.0-rc2-00035-gb3ef86b5a957 #1 [ 63.000677] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 63.000682] Call Trace: [ 63.000686] <TASK> [ 63.000731] dump_stack_lvl+0x93/0xd0 [ 63.000919] __get_user_pages+0x903/0xd30 [ 63.001030] __gup_longterm_locked+0x153e/0x1ba0 [ 63.001041] ? _raw_read_unlock_irqrestore+0x17/0x50 [ 63.001072] ? try_get_folio+0x29c/0x2d0 [ 63.001083] internal_get_user_pages_fast+0x1119/0x1530 [ 63.001109] iov_iter_extract_pages+0x23b/0x580 [ 63.001206] bio_iov_iter_get_pages+0x4de/0x1220 [ 63.001235] iomap_dio_bio_iter+0x9b6/0x1410 [ 63.001297] __iomap_dio_rw+0xab4/0x1810 [ 63.001316] iomap_dio_rw+0x45/0xa0 [ 63.001328] ext4_file_write_iter+0xdde/0x1390 [ 63.001372] vfs_write+0x599/0xbd0 [ 63.001394] ksys_write+0xc8/0x190 [ 63.001403] do_syscall_64+0xd4/0x1b0 [ 63.001421] ? arch_exit_to_user_mode_prepare+0x3a/0x60 [ 63.001479] entry_SYSCALL_64_after_hwframe+0x6f/0x77 [ 63.001535] RIP: 0033:0x7f7fd3ebf539 [ 63.001551] Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 14 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 [ 63.001562] RSP: 002b:00007f7fd32570c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 63.001584] RAX: ffffffffffffffda RBX: 00007f7fd3ff3f80 RCX: 00007f7fd3ebf539 [ 63.001590] RDX: 4db6d1e4f7e43360 RSI: 0000000020000000 RDI: 0000000000000004 [ 63.001595] RBP: 00007f7fd3f1e496 R08: 0000000000000000 R09: 0000000000000000 [ 63.001599] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [ 63.001604] R13: 0000000000000006 R14: 00007f7fd3ff3f80 R15: 00007ffd415ad2b8 ... [ 63.018142] ---[ end trace ]---
Historically, the signed integer overflow sanitizer did not work in the kernel due to its interaction with -fwrapv but this has since been changed [1] in the newest version of Clang; It was re-enabled in the kernel with Commit 557f8c582a9ba8ab ("ubsan: Reintroduce signed overflow sanitizer").
Let's rework this overflow checking logic to not actually perform an overflow during the check itself, thus avoiding the UBSAN splat.
[1]: https://github.com/llvm/llvm-project/pull/82432
--- block/ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block/ioctl.c +1 -1
@@ -32,7 +32,7 @@ static int blkpg_do_ioctl(struct block_device *bdev,if (op ==BLKPG_DEL_PARTITION )return bdev_del_partition (bdev, p.pno); -if (p.start <0 || p.length <=0 || p.start + p.length <0 ) +if (p.start <0 || p.length <=0 ||LLONG_MAX - p.length < p.start)return -EINVAL ;/* Check that the partition is aligned to the block size */ if (!IS_ALIGNED (p.start | p.length,bdev_logical_block_size (bdev)))
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 109/290 selftests/bpf: Prevent client connect before server bind in test_tc_tunnel.sh
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alessandro Carminati (Red Hat) <[email protected]>
[ Upstream commit f803bcf9208a2540acb4c32bdc3616673169f490 ]
In some systems, the netcat server can incur in delay to start listening. When this happens, the test can randomly fail in various points. This is an example error message:
# ip gre none gso # encap 192.168.1.1 to 192.168.1.2, type gre, mac none len 2000 # test basic connectivity # Ncat: Connection refused.
The issue stems from a race condition between the netcat client and server. The test author had addressed this problem by implementing a sleep, which I have removed in this patch.
This patch introduces a function capable of sleeping for up to two seconds. However, it can terminate the waiting period early if the port is reported to be listening.
--- tools/testing/selftests/bpf/test_tc_tunnel.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
tools/testing/selftests/bpf/test_tc_tunnel.sh +12 -1
@@ -71,7 +71,6 @@ cleanup() { server_listen() { ip netns exec "${ns2}" nc "${netcat_opt}" -l -p "${port}" > "${outfile}" & server_pid=$! - sleep 0.2 } client_connect() {
@@ -92,6 +91,16 @@ verify_data() { fi } +wait_for_port() { + for i in $(seq 20); do + if ip netns exec "${ns2}" ss ${2:--4}OHntl | grep -q "$1"; then + return 0 + fi + sleep 0.1 + done + return 1 +} + set -e # no arguments: automated test, run all
@@ -183,6 +192,7 @@ setup # basic communication works echo "test basic connectivity" server_listen +wait_for_port ${port} ${netcat_opt} client_connect verify_data
@@ -194,6 +204,7 @@ ip netns exec "${ns1}" tc filter add dev veth1 egress \ section "encap_${tuntype}_${mac}" echo "test bpf encap without decap (expect failure)" server_listen +wait_for_port ${port} ${netcat_opt} ! client_connect if [[ "$tuntype" =~ "udp" ]]; then
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 110/290 selftests/bpf: Fix flaky test btf_map_in_map/lookup_update
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yonghong Song <[email protected]>
[ Upstream commit 14bb1e8c8d4ad5d9d2febb7d19c70a3cf536e1e5 ]
Recently, I frequently hit the following test failure:
[root@arch-fb-vm1 bpf]# ./test_progs -n 33/1 test_lookup_update:PASS:skel_open 0 nsec [...]
test_lookup_update:PASS:sync_rcu 0 nsec test_lookup_update:FAIL:map1_leak inner_map1 leaked!
#33/1 btf_map_in_map/lookup_update:FAIL
#33 btf_map_in_map:FAIL
In the test, after map is closed and then after two rcu grace periods, it is assumed that map_id is not available to user space.
But the above assumption cannot be guaranteed. After zero or one or two rcu grace periods in different siturations, the actual freeing-map-work is put into a workqueue. Later on, when the work is dequeued, the map will be actually freed.
See bpf_map_put() in kernel/bpf/syscall.c.
By using workqueue, there is no ganrantee that map will be actually freed after a couple of rcu grace periods. This patch removed such map leak detection and then the test can pass consistently.
--- .../selftests/bpf/prog_tests/btf_map_in_map.c | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-)
tools/testing/selftests/bpf/prog_tests/btf_map_in_map.c +1 -25
@@ -58,7 +58,7 @@ static void test_lookup_update(void)int map1_fd, map2_fd, map3_fd, map4_fd, map5_fd, map1_id, map2_id;int outer_arr_fd, outer_hash_fd, outer_arr_dyn_fd;struct test_btf_map_in_map *skel; -int err, key =0 , val, i, fd; +int err, key =0 , val, i; skel =test_btf_map_in_map__open_and_load ();if (CHECK (!skel,"skel_open" ,"failed to open&load skeleton\n" ))
@@ -135,30 +135,6 @@ static void test_lookup_update(void)CHECK (map1_id ==0 ,"map1_id" ,"failed to get ID 1\n" );CHECK (map2_id ==0 ,"map2_id" ,"failed to get ID 2\n" ); -test_btf_map_in_map__destroy (skel); - skel =NULL ; - -/* we need to either wait for or force synchronize_rcu(), before -* checking for "still exists" condition, otherwise map could still be -* resolvable by ID, causing false positives. -* -* Older kernels (5.8 and earlier) freed map only after two -* synchronize_rcu()s, so trigger two, to be entirely sure. -*/ -CHECK (kern_sync_rcu (),"sync_rcu" ,"failed\n" ); -CHECK (kern_sync_rcu (),"sync_rcu" ,"failed\n" ); - - fd =bpf_map_get_fd_by_id (map1_id); -if (CHECK (fd >=0 ,"map1_leak" ,"inner_map1 leaked!\n" )) { -close (fd); - goto cleanup; - } - fd =bpf_map_get_fd_by_id (map2_id); -if (CHECK (fd >=0 ,"map2_leak" ,"inner_map2 leaked!\n" )) { -close (fd); - goto cleanup; - } - cleanup:test_btf_map_in_map__destroy (skel); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 111/290 batman-adv: bypass empty buckets in batadv_purge_orig_ref()
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 40dc8ab605894acae1473e434944924a22cfaaa0 ]
Many syzbot reports are pointing to soft lockups in batadv_purge_orig_ref() [1]
Root cause is unknown, but we can avoid spending too much time there and perhaps get more interesting reports.
[1]
watchdog: BUG: soft lockup - CPU#0 stuck for 27s! [kworker/u4:6:621] Modules linked in: irq event stamp: 6182794 hardirqs last enabled at (6182793): [<ffff8000801dae10>] __local_bh_enable_ip+0x224/0x44c kernel/softirq.c:386 hardirqs last disabled at (6182794): [<ffff80008ad66a78>] __el1_irq arch/arm64/kernel/entry-common.c:533 [inline] hardirqs last disabled at (6182794): [<ffff80008ad66a78>] el1_interrupt+0x24/0x68 arch/arm64/kernel/entry-common.c:551 softirqs last enabled at (6182792): [<ffff80008aab71c4>] spin_unlock_bh include/linux/spinlock.h:396 [inline] softirqs last enabled at (6182792): [<ffff80008aab71c4>] batadv_purge_orig_ref+0x114c/0x1228 net/batman-adv/originator.c:1287 softirqs last disabled at (6182790): [<ffff80008aab61dc>] spin_lock_bh include/linux/spinlock.h:356 [inline] softirqs last disabled at (6182790): [<ffff80008aab61dc>] batadv_purge_orig_ref+0x164/0x1228 net/batman-adv/originator.c:1271 CPU: 0 PID: 621 Comm: kworker/u4:6 Not tainted 6.8.0-rc7-syzkaller-g707081b61156 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024 Workqueue: bat_events batadv_purge_orig pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : should_resched arch/arm64/include/asm/preempt.h:79 [inline] pc : __local_bh_enable_ip+0x228/0x44c kernel/softirq.c:388 lr : __local_bh_enable_ip+0x224/0x44c kernel/softirq.c:386
sp : ffff800099007970
x29: ffff800099007980 x28: 1fffe00018fce1bd x27: dfff800000000000
x26: ffff0000d2620008 x25: ffff0000c7e70de8 x24: 0000000000000001
x23: 1fffe00018e57781 x22: dfff800000000000 x21: ffff80008aab71c4
x20: ffff0001b40136c0 x19: ffff0000c72bbc08 x18: 1fffe0001a817bb0
x17: ffff800125414000 x16: ffff80008032116c x15: 0000000000000001
x14: 1fffe0001ee9d610 x13: 0000000000000000 x12: 0000000000000003
x11: 0000000000000000 x10: 0000000000ff0100 x9 : 0000000000000000 x8 : 00000000005e5789 x7 : ffff80008aab61dc x6 : 0000000000000000 x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000 x2 : 0000000000000006 x1 : 0000000000000080 x0 : ffff800125414000
Call trace: __daif_local_irq_enable arch/arm64/include/asm/irqflags.h:27 [inline] arch_local_irq_enable arch/arm64/include/asm/irqflags.h:49 [inline] __local_bh_enable_ip+0x228/0x44c kernel/softirq.c:386 __raw_spin_unlock_bh include/linux/spinlock_api_smp.h:167 [inline] _raw_spin_unlock_bh+0x3c/0x4c kernel/locking/spinlock.c:210 spin_unlock_bh include/linux/spinlock.h:396 [inline] batadv_purge_orig_ref+0x114c/0x1228 net/batman-adv/originator.c:1287 batadv_purge_orig+0x20/0x70 net/batman-adv/originator.c:1300 process_one_work+0x694/0x1204 kernel/workqueue.c:2633 process_scheduled_works kernel/workqueue.c:2706 [inline] worker_thread+0x938/0xef4 kernel/workqueue.c:2787 kthread+0x288/0x310 kernel/kthread.c:388 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 Sending NMI from CPU 0 to CPUs 1: NMI backtrace for cpu 1 CPU: 1 PID: 0 Comm: swapper/1 Not tainted 6.8.0-rc7-syzkaller-g707081b61156 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024 pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : arch_local_irq_enable+0x8/0xc arch/arm64/include/asm/irqflags.h:51 lr : default_idle_call+0xf8/0x128 kernel/sched/idle.c:103
sp : ffff800093a17d30
x29: ffff800093a17d30 x28: dfff800000000000 x27: 1ffff00012742fb4
x26: ffff80008ec9d000 x25: 0000000000000000 x24: 0000000000000002
x23: 1ffff00011d93a74 x22: ffff80008ec9d3a0 x21: 0000000000000000
x20: ffff0000c19dbc00 x19: ffff8000802d0fd8 x18: 1fffe00036804396
x17: ffff80008ec9d000 x16: ffff8000802d089c x15: 0000000000000001
x14: 1fffe00036805f10 x13: 0000000000000000 x12: 0000000000000003
x11: 0000000000000001 x10: 0000000000000003 x9 : 0000000000000000 x8 : 00000000000ce8d1 x7 : ffff8000804609e4 x6 : 0000000000000000 x5 : 0000000000000001 x4 : 0000000000000001 x3 : ffff80008ad6aac0 x2 : 0000000000000000 x1 : ffff80008aedea60 x0 : ffff800125436000
Call trace: __daif_local_irq_enable arch/arm64/include/asm/irqflags.h:27 [inline] arch_local_irq_enable+0x8/0xc arch/arm64/include/asm/irqflags.h:49 cpuidle_idle_call kernel/sched/idle.c:170 [inline] do_idle+0x1f0/0x4e8 kernel/sched/idle.c:312 cpu_startup_entry+0x5c/0x74 kernel/sched/idle.c:410 secondary_start_kernel+0x198/0x1c0 arch/arm64/kernel/smp.c:272 __secondary_switched+0xb8/0xbc arch/arm64/kernel/head.S:404
--- net/batman-adv/originator.c | 2 ++ 1 file changed, 2 insertions(+)
net/batman-adv/originator.c +2 -0
@@ -1285,6 +1285,8 @@ void batadv_purge_orig_ref(struct batadv_priv *bat_priv)/* for all origins... */ for (i =0 ; i < hash->size; i++) { head = &hash->table[i]; +if (hlist_empty (head)) +continue ; list_lock = &hash->list_locks[i];spin_lock_bh (list_lock);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 112/290 wifi: ath9k: work around memset overflow warning
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
[ Upstream commit 61752ac69b69ed2e04444d090f6917c77ab36d42 ]
gcc-9 and some other older versions produce a false-positive warning for zeroing two fields
In file included from include/linux/string.h:369,
from drivers/net/wireless/ath/ath9k/main.c:18:
In function 'fortify_memset_chk',
inlined from 'ath9k_ps_wakeup' at drivers/net/wireless/ath/ath9k/main.c:140:3:include/linux/fortify-string.h:462:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning]
462 | __write_overflow_field(p_size_field, size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Using a struct_group seems to reliably avoid the warning and not make the code much uglier. The combined memset() should even save a couple of cpu cycles.
--- drivers/net/wireless/ath/ath.h | 6 ++++-- drivers/net/wireless/ath/ath9k/main.c | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath.h +4 -2
@@ -171,8 +171,10 @@ struct ath_common {unsigned int clockrate;spinlock_t cc_lock; -struct ath_cycle_counters cc_ani; -struct ath_cycle_counters cc_survey; +struct_group (cc, + struct ath_cycle_counters cc_ani; + struct ath_cycle_counters cc_survey; + );struct ath_regulatory regulatory;struct ath_regulatory reg_world_copy;
drivers/net/wireless/ath/ath9k/main.c +1 -2
@@ -135,8 +135,7 @@ void ath9k_ps_wakeup(struct ath_softc *sc)if (power_mode !=ATH9K_PM_AWAKE ) {spin_lock (&common->cc_lock);ath_hw_cycle_counters_update (common); -memset (&common->cc_survey,0 ,sizeof (common->cc_survey)); -memset (&common->cc_ani,0 ,sizeof (common->cc_ani)); +memset (&common->cc,0 ,sizeof (common->cc));spin_unlock (&common->cc_lock); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 113/290 af_packet: avoid a false positive warning in packet_setsockopt()
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 86d43e2bf93ccac88ef71cee36a23282ebd9e427 ]
Although the code is correct, the following line
copy_from_sockptr(&req_u.req, optval, len));
triggers this warning :
memcpy: detected field-spanning write (size 28) of single field "dst" at include/linux/sockptr.h:49 (size 16)
Refactor the code to be more explicit.
--- net/packet/af_packet.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-)
net/packet/af_packet.c +14 -12
@@ -3761,28 +3761,30 @@ packet_setsockopt(struct socket *sock, int level, int optname, sockptr_t optval,case PACKET_TX_RING : {union tpacket_req_u req_u; -int len; + ret = -EINVAL ;lock_sock (sk);switch (po->tp_version) {case TPACKET_V1 :case TPACKET_V2 : - len =sizeof (req_u.req); +if (optlen <sizeof (req_u.req)) +break ; + ret =copy_from_sockptr (&req_u.req, optval, +sizeof (req_u.req)) ? + -EINVAL :0 ;break ;case TPACKET_V3 :default : - len =sizeof (req_u.req3); +if (optlen <sizeof (req_u.req3)) +break ; + ret =copy_from_sockptr (&req_u.req3, optval, +sizeof (req_u.req3)) ? + -EINVAL :0 ;break ; } -if (optlen < len) { - ret = -EINVAL ; - }else { -if (copy_from_sockptr (&req_u.req, optval, len)) - ret = -EFAULT ; -else - ret =packet_set_ring (sk, &req_u,0 , - optname ==PACKET_TX_RING ); - } +if (!ret) + ret =packet_set_ring (sk, &req_u,0 , + optname ==PACKET_TX_RING );release_sock (sk);return ret; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 114/290 drop_monitor: replace spin_lock by raw_spin_lock
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wander Lairson Costa <[email protected]>
[ Upstream commit f1e197a665c2148ebc25fe09c53689e60afea195 ]
trace_drop_common() is called with preemption disabled, and it acquires a spin_lock. This is problematic for RT kernels because spin_locks are sleeping locks in this configuration, which causes the following splat:
BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48
in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 449, name: rcuc/47preempt_count: 1, expected: 0
RCU nest depth: 2, expected: 2
5 locks held by rcuc/47/449:
#0: ff1100086ec30a60 ((softirq_ctrl.lock)){+.+.}-{2:2}, at: __local_bh_disable_ip+0x105/0x210 #1: ffffffffb394a280 (rcu_read_lock){....}-{1:2}, at: rt_spin_lock+0xbf/0x130 #2: ffffffffb394a280 (rcu_read_lock){....}-{1:2}, at: __local_bh_disable_ip+0x11c/0x210 #3: ffffffffb394a160 (rcu_callback){....}-{0:0}, at: rcu_do_batch+0x360/0xc70 #4: ff1100086ee07520 (&data->lock){+.+.}-{2:2}, at: trace_drop_common.constprop.0+0xb5/0x290
irq event stamp: 139909 hardirqs last enabled at (139908): [<ffffffffb1df2b33>] _raw_spin_unlock_irqrestore+0x63/0x80 hardirqs last disabled at (139909): [<ffffffffb19bd03d>] trace_drop_common.constprop.0+0x26d/0x290 softirqs last enabled at (139892): [<ffffffffb07a1083>] __local_bh_enable_ip+0x103/0x170 softirqs last disabled at (139898): [<ffffffffb0909b33>] rcu_cpu_kthread+0x93/0x1f0 Preemption disabled at: [<ffffffffb1de786b>] rt_mutex_slowunlock+0xab/0x2e0 CPU: 47 PID: 449 Comm: rcuc/47 Not tainted 6.9.0-rc2-rt1+ #7 Hardware name: Dell Inc. PowerEdge R650/0Y2G81, BIOS 1.6.5 04/15/2022 Call Trace: <TASK> dump_stack_lvl+0x8c/0xd0 dump_stack+0x14/0x20 __might_resched+0x21e/0x2f0 rt_spin_lock+0x5e/0x130 ? trace_drop_common.constprop.0+0xb5/0x290 ? skb_queue_purge_reason.part.0+0x1bf/0x230 trace_drop_common.constprop.0+0xb5/0x290 ? preempt_count_sub+0x1c/0xd0 ? _raw_spin_unlock_irqrestore+0x4a/0x80 ? __pfx_trace_drop_common.constprop.0+0x10/0x10 ? rt_mutex_slowunlock+0x26a/0x2e0 ? skb_queue_purge_reason.part.0+0x1bf/0x230 ? __pfx_rt_mutex_slowunlock+0x10/0x10 ? skb_queue_purge_reason.part.0+0x1bf/0x230 trace_kfree_skb_hit+0x15/0x20 trace_kfree_skb+0xe9/0x150 kfree_skb_reason+0x7b/0x110 skb_queue_purge_reason.part.0+0x1bf/0x230 ? __pfx_skb_queue_purge_reason.part.0+0x10/0x10 ? mark_lock.part.0+0x8a/0x520
...
trace_drop_common() also disables interrupts, but this is a minor issue because we could easily replace it with a local_lock.
Replace the spin_lock with raw_spin_lock to avoid sleeping in atomic context.
--- net/core/drop_monitor.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
net/core/drop_monitor.c +10 -10
@@ -73,7 +73,7 @@ struct net_dm_hw_entries { };struct per_cpu_dm_data { -spinlock_t lock;/* Protects 'skb', 'hw_entries' and +raw_spinlock_t lock;/* Protects 'skb', 'hw_entries' and * 'send_timer' */ union {
@@ -168,9 +168,9 @@ static struct sk_buff *reset_per_cpu_data(struct per_cpu_dm_data *data) err:mod_timer (&data->send_timer, jiffies +HZ /10 ); out: -spin_lock_irqsave (&data->lock, flags); +raw_spin_lock_irqsave (&data->lock, flags);swap (data->skb, skb); -spin_unlock_irqrestore (&data->lock, flags); +raw_spin_unlock_irqrestore (&data->lock, flags);if (skb) {struct nlmsghdr *nlh = (struct nlmsghdr *)skb->data;
@@ -225,7 +225,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location)local_irq_save (flags); data =this_cpu_ptr (&dm_cpu_data); -spin_lock (&data->lock); +raw_spin_lock (&data->lock); dskb = data->skb;if (!dskb)
@@ -259,7 +259,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location) } out: -spin_unlock_irqrestore (&data->lock, flags); +raw_spin_unlock_irqrestore (&data->lock, flags); }static void trace_kfree_skb_hit (void *ignore,struct sk_buff *skb,void *location)
@@ -318,9 +318,9 @@ net_dm_hw_reset_per_cpu_data(struct per_cpu_dm_data *hw_data)mod_timer (&hw_data->send_timer, jiffies +HZ /10 ); } -spin_lock_irqsave (&hw_data->lock, flags); +raw_spin_lock_irqsave (&hw_data->lock, flags);swap (hw_data->hw_entries, hw_entries); -spin_unlock_irqrestore (&hw_data->lock, flags); +raw_spin_unlock_irqrestore (&hw_data->lock, flags);return hw_entries; }
@@ -452,7 +452,7 @@ net_dm_hw_trap_summary_probe(void *ignore, const struct devlink *devlink,return ; hw_data =this_cpu_ptr (&dm_hw_cpu_data); -spin_lock_irqsave (&hw_data->lock, flags); +raw_spin_lock_irqsave (&hw_data->lock, flags); hw_entries = hw_data->hw_entries;if (!hw_entries)
@@ -481,7 +481,7 @@ net_dm_hw_trap_summary_probe(void *ignore, const struct devlink *devlink, } out: -spin_unlock_irqrestore (&hw_data->lock, flags); +raw_spin_unlock_irqrestore (&hw_data->lock, flags); }static const struct net_dm_alert_ops net_dm_alert_summary_ops = {
@@ -1669,7 +1669,7 @@ static struct notifier_block dropmon_net_notifier = {static void __net_dm_cpu_data_init (struct per_cpu_dm_data *data) { -spin_lock_init (&data->lock); +raw_spin_lock_init (&data->lock);skb_queue_head_init (&data->drop_queue);u64_stats_init (&data->stats.syncp); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 115/290 scsi: qedi: Fix crash while reading debugfs attribute
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Manish Rangankar <[email protected]>
[ Upstream commit 28027ec8e32ecbadcd67623edb290dad61e735b5 ]
The qedi_dbg_do_not_recover_cmd_read() function invokes sprintf() directly on a __user pointer, which results into the crash.
To fix this issue, use a small local stack buffer for sprintf() and then call simple_read_from_buffer(), which in turns make the copy_to_user() call.
BUG: unable to handle page fault for address: 00007f4801111000 PGD 8000000864df6067 P4D 8000000864df6067 PUD 864df7067 PMD 846028067 PTE 0 Oops: 0002 [#1] PREEMPT SMP PTI Hardware name: HPE ProLiant DL380 Gen10/ProLiant DL380 Gen10, BIOS U30 06/15/2023 RIP: 0010:memcpy_orig+0xcd/0x130 RSP: 0018:ffffb7a18c3ffc40 EFLAGS: 00010202 RAX: 00007f4801111000 RBX: 00007f4801111000 RCX: 000000000000000f RDX: 000000000000000f RSI: ffffffffc0bfd7a0 RDI: 00007f4801111000 RBP: ffffffffc0bfd7a0 R08: 725f746f6e5f6f64 R09: 3d7265766f636572 R10: ffffb7a18c3ffd08 R11: 0000000000000000 R12: 00007f4881110fff R13: 000000007fffffff R14: ffffb7a18c3ffca0 R15: ffffffffc0bfd7af FS: 00007f480118a740(0000) GS:ffff98e38af00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f4801111000 CR3: 0000000864b8e001 CR4: 00000000007706e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: <TASK> ? __die_body+0x1a/0x60 ? page_fault_oops+0x183/0x510 ? exc_page_fault+0x69/0x150 ? asm_exc_page_fault+0x22/0x30 ? memcpy_orig+0xcd/0x130 vsnprintf+0x102/0x4c0 sprintf+0x51/0x80 qedi_dbg_do_not_recover_cmd_read+0x2f/0x50 [qedi 6bcfdeeecdea037da47069eca2ba717c84a77324] full_proxy_read+0x50/0x80 vfs_read+0xa5/0x2e0 ? folio_add_new_anon_rmap+0x44/0xa0 ? set_pte_at+0x15/0x30 ? do_pte_missing+0x426/0x7f0 ksys_read+0xa5/0xe0 do_syscall_64+0x58/0x80 ? __count_memcg_events+0x46/0x90 ? count_memcg_event_mm+0x3d/0x60 ? handle_mm_fault+0x196/0x2f0 ? do_user_addr_fault+0x267/0x890 ? exc_page_fault+0x69/0x150 entry_SYSCALL_64_after_hwframe+0x72/0xdc RIP: 0033:0x7f4800f20b4d
--- drivers/scsi/qedi/qedi_debugfs.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/scsi/qedi/qedi_debugfs.c +4 -8
@@ -120,15 +120,11 @@ static ssize_t qedi_dbg_do_not_recover_cmd_read(struct file *filp, char __user *buffer, size_t count, loff_t *ppos) { - size_t cnt = 0; - -if (*ppos) -return 0 ; + char buf[64]; +int len; - cnt =sprintf (buffer,"do_not_recover=%d\n" , qedi_do_not_recover); - cnt =min_t (int, count, cnt - *ppos); - *ppos += cnt; -return cnt; + len =sprintf (buf,"do_not_recover=%d\n" , qedi_do_not_recover); +return simple_read_from_buffer (buffer, count, ppos, buf, len); } static int
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 89/290 intel_th: pci: Add Sapphire Rapids SOC support
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Shishkin <[email protected]>
commit 2e1da7efabe05cb0cf0b358883b2bc89080ed0eb upstream.
Add support for the Trace Hub in Sapphire Rapids SOC.
--- drivers/hwtracing/intel_th/pci.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/hwtracing/intel_th/pci.c +5 -0
@@ -315,6 +315,11 @@ static const struct pci_device_id intel_ .driver_data = (kernel_ulong_t)&intel_th_2x, }, { +/* Sapphire Rapids SOC */ + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x3456), + .driver_data = (kernel_ulong_t)&intel_th_2x, + }, + {/* Alder Lake CPU */ PCI_DEVICE (PCI_VENDOR_ID_INTEL ,0x466f ), .driver_data = (kernel_ulong_t)&intel_th_2x,
Greg Kroah-Hartman
maintainerPATCH 116/290 kselftest: arm64: Add a null pointer check
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kunwu Chan <[email protected]>
[ Upstream commit 80164282b3620a3cb73de6ffda5592743e448d0e ]
There is a 'malloc' call, which can be unsuccessful. This patch will add the malloc failure checking
to avoid possible null dereference and give more information about test fail reasons.
--- tools/testing/selftests/arm64/tags/tags_test.c | 4 ++++ 1 file changed, 4 insertions(+)
tools/testing/selftests/arm64/tags/tags_test.c +4 -0
@@ -6,6 +6,7 @@#include <stdint.h> #include <sys/prctl.h> #include <sys/utsname.h> +#include "../../kselftest.h" #define SHIFT_TAG (tag) ((uint64_t)(tag) << 56)#define SET_TAG (ptr, tag) (((uint64_t)(ptr) & ~SHIFT_TAG(0xff)) | \
@@ -21,6 +22,9 @@ int main(void)if (prctl (PR_SET_TAGGED_ADDR_CTRL ,PR_TAGGED_ADDR_ENABLE ,0 ,0 ,0 ) ==0 ) tbi_enabled =1 ; ptr = (struct utsname *)malloc (sizeof (*ptr)); +if (!ptr) +ksft_exit_fail_msg ("Failed to allocate utsname buffer\n" ); +if (tbi_enabled) tag =0x42 ; ptr = (struct utsname *)SET_TAG (ptr, tag);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 117/290 netpoll: Fix race condition in netpoll_owner_active
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 c2e6a872bde9912f1a7579639c5ca3adf1003916 ]
KCSAN detected a race condition in netpoll:
BUG: KCSAN: data-race in net_rx_action / netpoll_send_skb write (marked) to 0xffff8881164168b0 of 4 bytes by interrupt on cpu 10: net_rx_action (./include/linux/netpoll.h:90 net/core/dev.c:6712 net/core/dev.c:6822) <snip> read to 0xffff8881164168b0 of 4 bytes by task 1 on cpu 2: netpoll_send_skb (net/core/netpoll.c:319 net/core/netpoll.c:345 net/core/netpoll.c:393) netpoll_send_udp (net/core/netpoll.c:?) <snip> value changed: 0x0000000a -> 0xffffffff
This happens because netpoll_owner_active() needs to check if the current CPU is the owner of the lock, touching napi->poll_owner non atomically. The ->poll_owner field contains the current CPU holding the lock.
Use an atomic read to check if the poll owner is the current CPU.
--- net/core/netpoll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/netpoll.c +1 -1
@@ -316,7 +316,7 @@ static int netpoll_owner_active(struct net_device *dev)struct napi_struct *napi;list_for_each_entry_rcu (napi, &dev->napi_list, dev_list) { -if (napi->poll_owner ==smp_processor_id ()) +if (READ_ONCE (napi->poll_owner) ==smp_processor_id ())return 1 ; }return 0 ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 118/290 HID: Add quirk for Logitech Casa touchpad
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean O'Brien <[email protected]>
[ Upstream commit dd2c345a94cfa3873cc20db87387ee509c345c1b ]
This device sometimes doesn't send touch release signals when moving from >=4 fingers to <4 fingers. Using MT_QUIRK_NOT_SEEN_MEANS_UP instead of MT_QUIRK_ALWAYS_VALID makes sure that no touches become stuck.
MT_QUIRK_FORCE_MULTI_INPUT is not necessary for this device, but does no harm.
--- drivers/hid/hid-ids.h | 1 + drivers/hid/hid-multitouch.c | 6 ++++++ 2 files changed, 7 insertions(+)
drivers/hid/hid-ids.h +1 -0
@@ -765,6 +765,7 @@#define USB_DEVICE_ID_LOGITECH_AUDIOHUB 0x0a0e#define USB_DEVICE_ID_LOGITECH_T651 0xb00c#define USB_DEVICE_ID_LOGITECH_DINOVO_EDGE_KBD 0xb309 +#define USB_DEVICE_ID_LOGITECH_CASA_TOUCHPAD 0xbb00#define USB_DEVICE_ID_LOGITECH_C007 0xc007#define USB_DEVICE_ID_LOGITECH_C077 0xc077#define USB_DEVICE_ID_LOGITECH_RECEIVER 0xc101
drivers/hid/hid-multitouch.c +6 -0
@@ -1998,6 +1998,12 @@ static const struct hid_device_id mt_devices[] = { USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_X12_TAB) }, +/* Logitech devices */ + { .driver_data = MT_CLS_NSMU, +HID_DEVICE (BUS_BLUETOOTH ,HID_GROUP_MULTITOUCH_WIN_8 , +USB_VENDOR_ID_LOGITECH , + USB_DEVICE_ID_LOGITECH_CASA_TOUCHPAD) }, + /* MosArt panels */ { .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE, MT_USB_DEVICE(USB_VENDOR_ID_ASUS,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 119/290 ACPI: video: Add backlight=native quirk for Lenovo Slim 7 16ARH7
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 c901f63dc142c48326931f164f787dfff69273d9 ]
Lenovo Slim 7 16ARH7 is a machine with switchable graphics between AMD and Nvidia, and the backlight can't be adjusted properly unless acpi_backlight=native is passed. Although nvidia-wmi-backlight is present and loaded, this doesn't work as expected at all.
For making it working as default, add the corresponding quirk entry with a DMI matching "LENOVO" "82UX".
--- drivers/acpi/video_detect.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/acpi/video_detect.c +8 -0
@@ -341,6 +341,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "82BK"), }, }, + { + .callback = video_detect_force_native, +/* Lenovo Slim 7 16ARH7 */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_NAME, "82UX"), + }, + }, { .callback = video_detect_force_native,/* Lenovo ThinkPad X131e (3371 AMD version) */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 90/290 intel_th: pci: Add Meteor Lake-S support
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Shishkin <[email protected]>
commit c4a30def564d75e84718b059d1a62cc79b137cf9 upstream.
Add support for the Trace Hub in Meteor Lake-S.
--- drivers/hwtracing/intel_th/pci.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/hwtracing/intel_th/pci.c +5 -0
@@ -295,6 +295,11 @@ static const struct pci_device_id intel_ .driver_data = (kernel_ulong_t)&intel_th_2x, }, { +/* Meteor Lake-S */ + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x7f26), + .driver_data = (kernel_ulong_t)&intel_th_2x, + }, + {/* Raptor Lake-S */ PCI_DEVICE (PCI_VENDOR_ID_INTEL ,0x7a26 ), .driver_data = (kernel_ulong_t)&intel_th_2x,
Greg Kroah-Hartman
maintainerPATCH 91/290 intel_th: pci: Add Lunar Lake support
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Shishkin <[email protected]>
commit f866b65322bfbc8fcca13c25f49e1a5c5a93ae4d upstream.
Add support for the Trace Hub in Lunar Lake.
--- drivers/hwtracing/intel_th/pci.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/hwtracing/intel_th/pci.c +5 -0
@@ -325,6 +325,11 @@ static const struct pci_device_id intel_ .driver_data = (kernel_ulong_t)&intel_th_2x, }, { +/* Lunar Lake */ + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa824), + .driver_data = (kernel_ulong_t)&intel_th_2x, + }, + {/* Alder Lake CPU */ PCI_DEVICE (PCI_VENDOR_ID_INTEL ,0x466f ), .driver_data = (kernel_ulong_t)&intel_th_2x,
Greg Kroah-Hartman
maintainerPATCH 92/290 nilfs2: fix potential kernel bug due to lack of writeback flag waiting
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ryusuke Konishi <[email protected]>
commit a4ca369ca221bb7e06c725792ac107f0e48e82e7 upstream.
Destructive writes to a block device on which nilfs2 is mounted can cause a kernel bug in the folio/page writeback start routine or writeback end routine (__folio_start_writeback in the log below):
kernel BUG at mm/page-writeback.c:3070!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI ... RIP: 0010:__folio_start_writeback+0xbaa/0x10e0 Code: 25 ff 0f 00 00 0f 84 18 01 00 00 e8 40 ca c6 ff e9 17 f6 ff ff e8 36 ca c6 ff 4c 89 f7 48 c7 c6 80 c0 12 84 e8 e7 b3 0f 00 90 <0f> 0b e8 1f ca c6 ff 4c 89 f7 48 c7 c6 a0 c6 12 84 e8 d0 b3 0f 00 ... Call Trace: <TASK> nilfs_segctor_do_construct+0x4654/0x69d0 [nilfs2] nilfs_segctor_construct+0x181/0x6b0 [nilfs2] nilfs_segctor_thread+0x548/0x11c0 [nilfs2] kthread+0x2f0/0x390 ret_from_fork+0x4b/0x80 ret_from_fork_asm+0x1a/0x30 </TASK>
This is because when the log writer starts a writeback for segment summary blocks or a super root block that use the backing device's page cache, it does not wait for the ongoing folio/page writeback, resulting in an inconsistent writeback state.
Fix this issue by waiting for ongoing writebacks when putting folios/pages on the backing device into writeback state.
--- fs/nilfs2/segment.c | 3 +++ 1 file changed, 3 insertions(+)
fs/nilfs2/segment.c +3 -0
@@ -1697,6 +1697,7 @@ static void nilfs_segctor_prepare_write(if (bh->b_page != bd_page) {if (bd_page) {lock_page (bd_page); +wait_on_page_writeback (bd_page);clear_page_dirty_for_io (bd_page);set_page_writeback (bd_page);unlock_page (bd_page);
@@ -1710,6 +1711,7 @@ static void nilfs_segctor_prepare_write(if (bh == segbuf->sb_super_root) {if (bh->b_page != bd_page) {lock_page (bd_page); +wait_on_page_writeback (bd_page);clear_page_dirty_for_io (bd_page);set_page_writeback (bd_page);unlock_page (bd_page);
@@ -1726,6 +1728,7 @@ static void nilfs_segctor_prepare_write( }if (bd_page) {lock_page (bd_page); +wait_on_page_writeback (bd_page);clear_page_dirty_for_io (bd_page);set_page_writeback (bd_page);unlock_page (bd_page);
Greg Kroah-Hartman
maintainerPATCH 93/290 tick/nohz_full: Dont abuse smp_call_function_single() in tick_setup_device()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleg Nesterov <[email protected]>
commit 07c54cc5988f19c9642fd463c2dbdac7fc52f777 upstream.
After the recent commit 5097cbcb38e6 ("sched/isolation: Prevent boot crash when the boot CPU is nohz_full") the kernel no longer crashes, but there is another problem.
In this case tick_setup_device() calls tick_take_do_timer_from_boot() to update tick_do_timer_cpu and this triggers the WARN_ON_ONCE(irqs_disabled) in smp_call_function_single().
Kill tick_take_do_timer_from_boot() and just use WRITE_ONCE(), the new comment explains why this is safe (thanks Thomas!).
--- kernel/time/tick-common.c | 42 ++++++++++++++---------------------------- 1 file changed, 14 insertions(+), 28 deletions(-)
kernel/time/tick-common.c +14 -28
@@ -177,26 +177,6 @@ void tick_setup_periodic(struct clock_ev } } -#ifdef CONFIG_NO_HZ_FULL -static void giveup_do_timer (void *info) -{ -int cpu = *(unsigned int *)info; - -WARN_ON (tick_do_timer_cpu !=smp_processor_id ()); - - tick_do_timer_cpu = cpu; -} - -static void tick_take_do_timer_from_boot (void ) -{ -int cpu =smp_processor_id (); -int from = tick_do_timer_boot_cpu; - -if (from >=0 && from != cpu) -smp_call_function_single (from, giveup_do_timer, &cpu,1 ); -} -#endif -/* * Setup the tick device */
@@ -220,19 +200,25 @@ static void tick_setup_device(struct tic tick_next_period =ktime_get ();#ifdef CONFIG_NO_HZ_FULL /* -* The boot CPU may be nohz_full, in which case set -* tick_do_timer_boot_cpu so the first housekeeping -* secondary that comes up will take do_timer from -* us. +* The boot CPU may be nohz_full, in which case the +* first housekeeping secondary will take do_timer() +* from it. */ if (tick_nohz_full_cpu (cpu)) tick_do_timer_boot_cpu = cpu; - }else if (tick_do_timer_boot_cpu !=-1 && - !tick_nohz_full_cpu (cpu)) { -tick_take_do_timer_from_boot (); + }else if (tick_do_timer_boot_cpu !=-1 && !tick_nohz_full_cpu (cpu)) { tick_do_timer_boot_cpu =-1 ; -WARN_ON (tick_do_timer_cpu != cpu); +/* +* The boot CPU will stay in periodic (NOHZ disabled) +* mode until clocksource_done_booting() called after +* smp_init() selects a high resolution clocksource and +* timekeeping_notify() kicks the NOHZ stuff alive. +* +* So this WRITE_ONCE can only race with the READ_ONCE +* check in tick_periodic() but this race is harmless. +*/ +WRITE_ONCE (tick_do_timer_cpu, cpu);#endif }
Greg Kroah-Hartman
maintainerPATCH 94/290 serial: 8250_pxa: Configure tx_loadsz to match FIFO IRQ level
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Doug Brown <[email protected]>
commit 5208e7ced520a813b4f4774451fbac4e517e78b2 upstream.
The FIFO is 64 bytes, but the FCR is configured to fire the TX interrupt when the FIFO is half empty (bit 3 = 0). Thus, we should only write 32 bytes when a TX interrupt occurs.
This fixes a problem observed on the PXA168 that dropped a bunch of TX bytes during large transmissions.
--- drivers/tty/serial/8250/8250_pxa.c | 1 + 1 file changed, 1 insertion(+)
drivers/tty/serial/8250/8250_pxa.c +1 -0
@@ -125,6 +125,7 @@ static int serial_pxa_probe(struct platf uart.port.regshift =2 ; uart.port.irq = irq; uart.port.fifosize =64 ; + uart.tx_loadsz =32 ; uart.port.flags =UPF_IOREMAP |UPF_SKIP_TEST |UPF_FIXED_TYPE ; uart.port.dev = &pdev->dev; uart.port.uartclk =clk_get_rate (data->clk);
Greg Kroah-Hartman
maintainerPATCH 95/290 hugetlb_encode.h: fix undefined behaviour (34 << 26)
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthias Goergens <[email protected]>
commit 710bb68c2e3a24512e2d2bae470960d7488e97b1 upstream.
Left-shifting past the size of your datatype is undefined behaviour in C. The literal 34 gets the type int, and that one is not big enough to be left shifted by 26 bits.
An unsigned is long enough (on any machine that has at least 32 bits for their ints.)
For uniformity, we mark all the literals as unsigned. But it's only really needed for HUGETLB_FLAG_ENCODE_16GB.
Thanks to Randy Dunlap for an initial review and suggestion.
--- include/uapi/asm-generic/hugetlb_encode.h | 26 +++++++++++++------------- tools/include/asm-generic/hugetlb_encode.h | 20 ++++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-)
include/uapi/asm-generic/hugetlb_encode.h +13 -13
@@ -20,18 +20,18 @@#define HUGETLB_FLAG_ENCODE_SHIFT 26#define HUGETLB_FLAG_ENCODE_MASK 0x3f -#define HUGETLB_FLAG_ENCODE_16KB (14 << HUGETLB_FLAG_ENCODE_SHIFT) -#define HUGETLB_FLAG_ENCODE_64KB (16 << HUGETLB_FLAG_ENCODE_SHIFT) -#define HUGETLB_FLAG_ENCODE_512KB (19 << HUGETLB_FLAG_ENCODE_SHIFT) -#define HUGETLB_FLAG_ENCODE_1MB (20 << HUGETLB_FLAG_ENCODE_SHIFT) -#define HUGETLB_FLAG_ENCODE_2MB (21 << HUGETLB_FLAG_ENCODE_SHIFT) -#define HUGETLB_FLAG_ENCODE_8MB (23 << HUGETLB_FLAG_ENCODE_SHIFT) -#define HUGETLB_FLAG_ENCODE_16MB (24 << HUGETLB_FLAG_ENCODE_SHIFT) -#define HUGETLB_FLAG_ENCODE_32MB (25 << HUGETLB_FLAG_ENCODE_SHIFT) -#define HUGETLB_FLAG_ENCODE_256MB (28 << HUGETLB_FLAG_ENCODE_SHIFT) -#define HUGETLB_FLAG_ENCODE_512MB (29 << HUGETLB_FLAG_ENCODE_SHIFT) -#define HUGETLB_FLAG_ENCODE_1GB (30 << HUGETLB_FLAG_ENCODE_SHIFT) -#define HUGETLB_FLAG_ENCODE_2GB (31 << HUGETLB_FLAG_ENCODE_SHIFT) -#define HUGETLB_FLAG_ENCODE_16GB (34 << HUGETLB_FLAG_ENCODE_SHIFT) +#define HUGETLB_FLAG_ENCODE_16KB (14U << HUGETLB_FLAG_ENCODE_SHIFT) +#define HUGETLB_FLAG_ENCODE_64KB (16U << HUGETLB_FLAG_ENCODE_SHIFT) +#define HUGETLB_FLAG_ENCODE_512KB (19U << HUGETLB_FLAG_ENCODE_SHIFT) +#define HUGETLB_FLAG_ENCODE_1MB (20U << HUGETLB_FLAG_ENCODE_SHIFT) +#define HUGETLB_FLAG_ENCODE_2MB (21U << HUGETLB_FLAG_ENCODE_SHIFT) +#define HUGETLB_FLAG_ENCODE_8MB (23U << HUGETLB_FLAG_ENCODE_SHIFT) +#define HUGETLB_FLAG_ENCODE_16MB (24U << HUGETLB_FLAG_ENCODE_SHIFT) +#define HUGETLB_FLAG_ENCODE_32MB (25U << HUGETLB_FLAG_ENCODE_SHIFT) +#define HUGETLB_FLAG_ENCODE_256MB (28U << HUGETLB_FLAG_ENCODE_SHIFT) +#define HUGETLB_FLAG_ENCODE_512MB (29U << HUGETLB_FLAG_ENCODE_SHIFT) +#define HUGETLB_FLAG_ENCODE_1GB (30U << HUGETLB_FLAG_ENCODE_SHIFT) +#define HUGETLB_FLAG_ENCODE_2GB (31U << HUGETLB_FLAG_ENCODE_SHIFT) +#define HUGETLB_FLAG_ENCODE_16GB (34U << HUGETLB_FLAG_ENCODE_SHIFT)#endif /* _ASM_GENERIC_HUGETLB_ENCODE_H_ */
tools/include/asm-generic/hugetlb_encode.h +10 -10
@@ -20,15 +20,15 @@#define HUGETLB_FLAG_ENCODE_SHIFT 26#define HUGETLB_FLAG_ENCODE_MASK 0x3f -#define HUGETLB_FLAG_ENCODE_64KB (16 << HUGETLB_FLAG_ENCODE_SHIFT) -#define HUGETLB_FLAG_ENCODE_512KB (19 << HUGETLB_FLAG_ENCODE_SHIFT) -#define HUGETLB_FLAG_ENCODE_1MB (20 << HUGETLB_FLAG_ENCODE_SHIFT) -#define HUGETLB_FLAG_ENCODE_2MB (21 << HUGETLB_FLAG_ENCODE_SHIFT) -#define HUGETLB_FLAG_ENCODE_8MB (23 << HUGETLB_FLAG_ENCODE_SHIFT) -#define HUGETLB_FLAG_ENCODE_16MB (24 << HUGETLB_FLAG_ENCODE_SHIFT) -#define HUGETLB_FLAG_ENCODE_256MB (28 << HUGETLB_FLAG_ENCODE_SHIFT) -#define HUGETLB_FLAG_ENCODE_1GB (30 << HUGETLB_FLAG_ENCODE_SHIFT) -#define HUGETLB_FLAG_ENCODE_2GB (31 << HUGETLB_FLAG_ENCODE_SHIFT) -#define HUGETLB_FLAG_ENCODE_16GB (34 << HUGETLB_FLAG_ENCODE_SHIFT) +#define HUGETLB_FLAG_ENCODE_64KB (16U << HUGETLB_FLAG_ENCODE_SHIFT) +#define HUGETLB_FLAG_ENCODE_512KB (19U << HUGETLB_FLAG_ENCODE_SHIFT) +#define HUGETLB_FLAG_ENCODE_1MB (20U << HUGETLB_FLAG_ENCODE_SHIFT) +#define HUGETLB_FLAG_ENCODE_2MB (21U << HUGETLB_FLAG_ENCODE_SHIFT) +#define HUGETLB_FLAG_ENCODE_8MB (23U << HUGETLB_FLAG_ENCODE_SHIFT) +#define HUGETLB_FLAG_ENCODE_16MB (24U << HUGETLB_FLAG_ENCODE_SHIFT) +#define HUGETLB_FLAG_ENCODE_256MB (28U << HUGETLB_FLAG_ENCODE_SHIFT) +#define HUGETLB_FLAG_ENCODE_1GB (30U << HUGETLB_FLAG_ENCODE_SHIFT) +#define HUGETLB_FLAG_ENCODE_2GB (31U << HUGETLB_FLAG_ENCODE_SHIFT) +#define HUGETLB_FLAG_ENCODE_16GB (34U << HUGETLB_FLAG_ENCODE_SHIFT)#endif /* _ASM_GENERIC_HUGETLB_ENCODE_H_ */
Greg Kroah-Hartman
maintainerPATCH 86/290 remoteproc: k3-r5: Do not allow core1 to power up before core0 via sysfs
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Beleswar Padhi <[email protected]>
commit 3c8a9066d584f5010b6f4ba03bf6b19d28973d52 upstream.
PSC controller has a limitation that it can only power-up the second core when the first core is in ON state. Power-state for core0 should be equal to or higher than core1.
Therefore, prevent core1 from powering up before core0 during the start process from sysfs. Similarly, prevent core0 from shutting down before core1 has been shut down from sysfs.
--- drivers/remoteproc/ti_k3_r5_remoteproc.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)
drivers/remoteproc/ti_k3_r5_remoteproc.c +21 -2
@@ -429,7 +429,7 @@ static int k3_r5_rproc_start(struct rprostruct k3_r5_cluster *cluster = kproc->cluster;struct mbox_client *client = &kproc->client;struct device *dev = kproc->dev; -struct k3_r5_core *core; +struct k3_r5_core *core0, *core;u32 boot_addr;int ret;
@@ -478,6 +478,15 @@ static int k3_r5_rproc_start(struct rpro goto unroll_core_run; } }else { +/* do not allow core 1 to start before core 0 */ + core0 = list_first_entry(&cluster->cores, struct k3_r5_core, + elem); +if (core != core0 && core0->rproc->state ==RPROC_OFFLINE ) { +dev_err (dev,"%s: can not start core 1 before core 0\n" , + __func__); +return -EPERM ; + } + ret =k3_r5_core_run (core);if (ret) goto put_mbox;
@@ -518,7 +527,8 @@ static int k3_r5_rproc_stop(struct rproc {struct k3_r5_rproc *kproc = rproc->priv;struct k3_r5_cluster *cluster = kproc->cluster; -struct k3_r5_core *core = kproc->core; +struct device *dev = kproc->dev; +struct k3_r5_core *core1, *core = kproc->core;int ret;/* halt all applicable cores */
@@ -531,6 +541,15 @@ static int k3_r5_rproc_stop(struct rproc } } }else { +/* do not allow core 0 to stop before core 1 */ + core1 = list_last_entry(&cluster->cores, struct k3_r5_core, + elem); +if (core != core1 && core1->rproc->state !=RPROC_OFFLINE ) { +dev_err (dev,"%s: can not stop core 0 before core 1\n" , + __func__); +return -EPERM ; + } + ret =k3_r5_core_halt (core);if (ret) goto out;
Greg Kroah-Hartman
maintainerPATCH 121/290 drm/amd/display: Exit idle optimizations before HDCP execution
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Kazlauskas <[email protected]>
[ Upstream commit f30a3bea92bdab398531129d187629fb1d28f598 ]
[WHY]
PSP can access DCN registers during command submission and we need to ensure that DCN is not in PG before doing so.
[HOW]
Add a callback to DM to lock and notify DC for idle optimization exit. It can't be DC directly because of a potential race condition with the link protection thread and the rest of DM operation.
--- drivers/gpu/drm/amd/display/modules/hdcp/hdcp.c | 10 ++++++++++ drivers/gpu/drm/amd/display/modules/inc/mod_hdcp.h | 8 ++++++++ 2 files changed, 18 insertions(+)
drivers/gpu/drm/amd/display/modules/hdcp/hdcp.c +10 -0
@@ -86,6 +86,14 @@ static uint8_t is_cp_desired_hdcp2(struct mod_hdcp *hdcp) !hdcp->connection.is_hdcp2_revoked; } +static void exit_idle_optimizations (struct mod_hdcp *hdcp) +{ +struct mod_hdcp_dm *dm = &hdcp->config.dm; + +if (dm->funcs.exit_idle_optimizations) + dm->funcs.exit_idle_optimizations (dm->handle); +} +static enum mod_hdcp_status execution (struct mod_hdcp *hdcp,struct mod_hdcp_event_context *event_ctx,union mod_hdcp_transition_input *input)
@@ -448,6 +456,8 @@ enum mod_hdcp_status mod_hdcp_process_event(struct mod_hdcp *hdcp,memset (&event_ctx,0 ,sizeof (struct mod_hdcp_event_context )); event_ctx.event = event; +exit_idle_optimizations (hdcp); +/* execute and transition */ exec_status =execution (hdcp, &event_ctx, &hdcp->auth.trans_input); trans_status = transition(
drivers/gpu/drm/amd/display/modules/inc/mod_hdcp.h +8 -0
@@ -143,6 +143,13 @@ struct mod_hdcp_ddc { } funcs; }; +struct mod_hdcp_dm { +void *handle; +struct { +void (*exit_idle_optimizations)(void *handle); + } funcs; +}; +struct mod_hdcp_psp {void *handle;void *funcs;
@@ -252,6 +259,7 @@ struct mod_hdcp_display_query {struct mod_hdcp_config {struct mod_hdcp_psp psp;struct mod_hdcp_ddc ddc; +struct mod_hdcp_dm dm;uint8_t index; };
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 130/290 usb: misc: uss720: check for incompatible versions of the Belkin F5U002
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Henrie <[email protected]>
[ Upstream commit 3295f1b866bfbcabd625511968e8a5c541f9ab32 ]
The incompatible device in my possession has a sticker that says "F5U002 Rev 2" and "P80453-B", and lsusb identifies it as "050d:0002 Belkin Components IEEE-1284 Controller". There is a bug report from 2007 from Michael Trausch who was seeing the exact same errors that I saw in 2024 trying to use this cable.
--- drivers/usb/misc/uss720.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
drivers/usb/misc/uss720.c +13 -7
@@ -677,7 +677,7 @@ static int uss720_probe(struct usb_interface *intf,struct parport_uss720_private *priv;struct parport *pp;unsigned char reg; -int i; +int ret; dev_dbg(&intf->dev, "probe: vendor id 0x%x, device id 0x%x\n", le16_to_cpu(usbdev->descriptor.idVendor),
@@ -688,8 +688,8 @@ static int uss720_probe(struct usb_interface *intf,usb_put_dev (usbdev);return -ENODEV ; } - i =usb_set_interface (usbdev, intf->altsetting->desc.bInterfaceNumber,2 ); -dev_dbg (&intf->dev,"set interface result %d\n" , i); + ret =usb_set_interface (usbdev, intf->altsetting->desc.bInterfaceNumber,2 ); +dev_dbg (&intf->dev,"set interface result %d\n" , ret); interface = intf->cur_altsetting;
@@ -725,12 +725,18 @@ static int uss720_probe(struct usb_interface *intf,set_1284_register (pp,7 ,0x00 ,GFP_KERNEL );set_1284_register (pp,6 ,0x30 ,GFP_KERNEL );/* PS/2 mode */ set_1284_register (pp,2 ,0x0c ,GFP_KERNEL ); -/* debugging */ -get_1284_register (pp,0 , ®,GFP_KERNEL ); + +/* The Belkin F5U002 Rev 2 P80453-B USB parallel port adapter shares the +* device ID 050d:0002 with some other device that works with this +* driver, but it itself does not. Detect and handle the bad cable +* here. */ + ret =get_1284_register (pp,0 , ®,GFP_KERNEL );dev_dbg (&intf->dev,"reg: %7ph\n" , priv->reg); +if (ret <0 ) +return ret; - i =usb_find_last_int_in_endpoint (interface, &epd); -if (!i) { + ret =usb_find_last_int_in_endpoint (interface, &epd); +if (!ret) {dev_dbg (&intf->dev,"epaddr %d interval %d\n" , epd->bEndpointAddress, epd->bInterval); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 131/290 udf: udftime: prevent overflow in udf_disk_stamp_to_time()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Roman Smirnov <[email protected]>
[ Upstream commit 3b84adf460381169c085e4bc09e7b57e9e16db0a ]
An overflow can occur in a situation where src.centiseconds takes the value of 255. This situation is unlikely, but there is no validation check anywere in the code.
Found by Linux Verification Center (linuxtesting.org) with Svace.
Message-Id: <[email protected]>
--- fs/udf/udftime.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
fs/udf/udftime.c +8 -3
@@ -60,13 +60,18 @@ udf_disk_stamp_to_time(struct timespec64 *dest, struct timestamp src) dest->tv_sec =mktime64 (year, src.month, src.day, src.hour, src.minute, src.second); dest->tv_sec -= offset *60 ; - dest->tv_nsec =1000 * (src.centiseconds *10000 + - src.hundredsOfMicroseconds *100 + src.microseconds); +/* * Sanitize nanosecond field since reportedly some filesystems are * recorded with bogus sub-second values. */ - dest->tv_nsec %=NSEC_PER_SEC ; +if (src.centiseconds <100 && src.hundredsOfMicroseconds <100 && + src.microseconds <100 ) { + dest->tv_nsec =1000 * (src.centiseconds *10000 + + src.hundredsOfMicroseconds *100 + src.microseconds); + }else { + dest->tv_nsec =0 ; + } }void
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 132/290 PCI/PM: Avoid D3cold for HP Pavilion 17 PC/1972 PCIe Ports
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <[email protected]>
[ Upstream commit 256df20c590bf0e4d63ac69330cf23faddac3e08 ]
Hewlett-Packard HP Pavilion 17 Notebook PC/1972 is an Intel Ivy Bridge system with a muxless AMD Radeon dGPU. Attempting to use the dGPU fails with the following sequence:
ACPI Error: Aborting method \AMD3._ON due to previous error (AE_AML_LOOP_TIMEOUT) (20230628/psparse-529) radeon 0000:01:00.0: not ready 1023ms after resume; waiting
radeon 0000:01:00.0: not ready 2047ms after resume; waiting
radeon 0000:01:00.0: not ready 4095ms after resume; waiting
radeon 0000:01:00.0: not ready 8191ms after resume; waiting
radeon 0000:01:00.0: not ready 16383ms after resume; waiting
radeon 0000:01:00.0: not ready 32767ms after resume; waiting
radeon 0000:01:00.0: not ready 65535ms after resume; giving up
radeon 0000:01:00.0: Unable to change power state from D3cold to D0, device inaccessible
The issue is that the Root Port the dGPU is connected to can't handle the transition from D3cold to D0 so the dGPU can't properly exit runtime PM.
The existing logic in pci_bridge_d3_possible() checks for systems that are newer than 2015 to decide that D3 is safe. This would nominally work for an Ivy Bridge system (which was discontinued in 2015), but this system appears to have continued to receive BIOS updates until 2017 and so this existing logic doesn't appropriately capture it.
Add the system to bridge_d3_blacklist to prevent D3cold from being used.
--- drivers/pci/pci.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/pci/pci.c +12 -0
@@ -2840,6 +2840,18 @@ static const struct dmi_system_id bridge_d3_blacklist[] = { DMI_MATCH(DMI_BOARD_VERSION, "Continental Z2"), }, }, + { +/* +* Changing power state of root port dGPU is connected fails +* https://gitlab.freedesktop.org/drm/amd/-/issues/3229 +*/ + .ident = "Hewlett-Packard HP Pavilion 17 Notebook PC/1972", + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"Hewlett-Packard" ), +DMI_MATCH (DMI_BOARD_NAME ,"1972" ), + DMI_MATCH(DMI_BOARD_VERSION, "95.33"), + }, + }, #endif { } };
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 133/290 MIPS: Octeon: Add PCIe link status check
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Songyang Li <[email protected]>
[ Upstream commit 29b83a64df3b42c88c0338696feb6fdcd7f1f3b7 ]
The standard PCIe configuration read-write interface is used to access the configuration space of the peripheral PCIe devices of the mips processor after the PCIe link surprise down, it can generate kernel panic caused by "Data bus error". So it is necessary to add PCIe link status check for system protection. When the PCIe link is down or in training, assigning a value of 0 to the configuration address can prevent read-write behavior to the configuration space of peripheral PCIe devices, thereby preventing kernel panic.
--- arch/mips/pci/pcie-octeon.c | 6 ++++++ 1 file changed, 6 insertions(+) mode change 100644 => 100755 arch/mips/pci/pcie-octeon.c
arch/mips/pci/pcie-octeon.c +6 -0
@@ -230,12 +230,18 @@ static inline uint64_t __cvmx_pcie_build_config_addr(int pcie_port, int bus, {union cvmx_pcie_address pcie_addr;union cvmx_pciercx_cfg006 pciercx_cfg006; +union cvmx_pciercx_cfg032 pciercx_cfg032; pciercx_cfg006.u32 =cvmx_pcie_cfgx_read (pcie_port,CVMX_PCIERCX_CFG006 (pcie_port));if ((bus <= pciercx_cfg006.s.pbnum) && (dev !=0 ))return 0 ; + pciercx_cfg032.u32 = +cvmx_pcie_cfgx_read (pcie_port,CVMX_PCIERCX_CFG032 (pcie_port)); +if ((pciercx_cfg032.s.dlla ==0 ) || (pciercx_cfg032.s.lt ==1 )) +return 0 ; + pcie_addr.u64 =0 ; pcie_addr.config.upper =2 ; pcie_addr.config.io =1 ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 134/290 serial: exar: adding missing CTI and Exar PCI ids
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Parker Newman <[email protected]>
[ Upstream commit b86ae40ffcf5a16b9569b1016da4a08c4f352ca2 ]
- Added Connect Tech and Exar IDs not already in pci_ids.h
--- drivers/tty/serial/8250/8250_exar.c | 42 +++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)
drivers/tty/serial/8250/8250_exar.c +42 -0
@@ -41,8 +41,50 @@#define PCI_DEVICE_ID_COMMTECH_4228PCIE 0x0021#define PCI_DEVICE_ID_COMMTECH_4222PCIE 0x0022 +#define PCI_VENDOR_ID_CONNECT_TECH 0x12c4 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_SP_OPTO 0x0340 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_SP_OPTO_A 0x0341 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_SP_OPTO_B 0x0342 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_XPRS 0x0350 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_XPRS_A 0x0351 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_XPRS_B 0x0352 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_XPRS 0x0353 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_16_XPRS_A 0x0354 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_16_XPRS_B 0x0355 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_XPRS_OPTO 0x0360 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_XPRS_OPTO_A 0x0361 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_XPRS_OPTO_B 0x0362 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_SP 0x0370 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_SP_232 0x0371 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_SP_485 0x0372 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_4_SP 0x0373 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_6_2_SP 0x0374 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_6_SP 0x0375 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_SP_232_NS 0x0376 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_XP_OPTO_LEFT 0x0380 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_XP_OPTO_RIGHT 0x0381 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_XP_OPTO 0x0382 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_4_XPRS_OPTO 0x0392 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_XPRS_LP 0x03A0 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_XPRS_LP_232 0x03A1 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_XPRS_LP_485 0x03A2 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_XPRS_LP_232_NS 0x03A3 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCIE_XEG001 0x0602 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCIE_XR35X_BASE 0x1000 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCIE_XR35X_2 0x1002 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCIE_XR35X_4 0x1004 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCIE_XR35X_8 0x1008 +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCIE_XR35X_12 0x100C +#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCIE_XR35X_16 0x1010 +#define PCI_DEVICE_ID_CONNECT_TECH_PCI_XR79X_12_XIG00X 0x110c +#define PCI_DEVICE_ID_CONNECT_TECH_PCI_XR79X_12_XIG01X 0x110d +#define PCI_DEVICE_ID_CONNECT_TECH_PCI_XR79X_16 0x1110 +#define PCI_DEVICE_ID_EXAR_XR17V4358 0x4358#define PCI_DEVICE_ID_EXAR_XR17V8358 0x8358 +#define PCI_DEVICE_ID_EXAR_XR17V252 0x0252 +#define PCI_DEVICE_ID_EXAR_XR17V254 0x0254 +#define PCI_DEVICE_ID_EXAR_XR17V258 0x0258#define PCI_SUBDEVICE_ID_USR_2980 0x0128#define PCI_SUBDEVICE_ID_USR_2981 0x0129
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 135/290 MIPS: Routerboard 532: Fix vendor retry check code
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilpo Järvinen <[email protected]>
[ Upstream commit ae9daffd9028f2500c9ac1517e46d4f2b57efb80 ]
read_config_dword() contains strange condition checking ret for a number of values. The ret variable, however, is always zero because config_access() never returns anything else. Thus, the retry is always taken until number of tries is exceeded.
The code looks like it wants to check *val instead of ret to see if the read gave an error response.
--- arch/mips/pci/ops-rc32434.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/mips/pci/ops-rc32434.c +2 -2
@@ -112,8 +112,8 @@ static int read_config_dword(struct pci_bus *bus, unsigned int devfn,* gives them time to settle */ if (where ==PCI_VENDOR_ID ) { -if (ret ==0xffffffff || ret ==0x00000000 || - ret ==0x0000ffff || ret ==0xffff0000 ) { +if (*val ==0xffffffff || *val ==0x00000000 || + *val ==0x0000ffff || *val ==0xffff0000 ) {if (delay >4 )return 0 ; delay *=2 ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 136/290 mips: bmips: BCM6358: make sure CBR is correctly set
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Marangi <[email protected]>
[ Upstream commit ce5cdd3b05216b704a704f466fb4c2dff3778caf ]
It was discovered that some device have CBR address set to 0 causing kernel panic when arch_sync_dma_for_cpu_all is called.
This was notice in situation where the system is booted from TP1 and BMIPS_GET_CBR() returns 0 instead of a valid address and !!(read_c0_brcm_cmt_local() & (1 << 31)); not failing.
The current check whether RAC flush should be disabled or not are not enough hence lets check if CBR is a valid address or not.
--- arch/mips/bmips/setup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/mips/bmips/setup.c +2 -1
@@ -110,7 +110,8 @@ static void bcm6358_quirks(void)* RAC flush causes kernel panics on BCM6358 when booting from TP1 * because the bootloader is not initializing it properly. */ - bmips_rac_flush_disable = !!(read_c0_brcm_cmt_local () & (1 <<31 )); + bmips_rac_flush_disable = !!(read_c0_brcm_cmt_local () & (1 <<31 )) || + !!BMIPS_GET_CBR (); }static void bcm6368_quirks (void )
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 137/290 tracing: Build event generation tests only as modules
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu (Google) <[email protected]>
[ Upstream commit 3572bd5689b0812b161b40279e39ca5b66d73e88 ]
The kprobes and synth event generation test modules add events and lock (get a reference) those event file reference in module init function, and unlock and delete it in module exit function. This is because those are designed for playing as modules.
If we make those modules as built-in, those events are left locked in the kernel, and never be removed. This causes kprobe event self-test failure as below.
[ 97.349708] ------------[ cut here ]------------ [ 97.353453] WARNING: CPU: 3 PID: 1 at kernel/trace/trace_kprobe.c:2133 kprobe_trace_self_tests_init+0x3f1/0x480 [ 97.357106] Modules linked in: [ 97.358488] CPU: 3 PID: 1 Comm: swapper/0 Not tainted 6.9.0-g699646734ab5-dirty #14 [ 97.361556] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 [ 97.363880] RIP: 0010:kprobe_trace_self_tests_init+0x3f1/0x480 [ 97.365538] Code: a8 24 08 82 e9 ae fd ff ff 90 0f 0b 90 48 c7 c7 e5 aa 0b 82 e9 ee fc ff ff 90 0f 0b 90 48 c7 c7 2d 61 06 82 e9 8e fd ff ff 90 <0f> 0b 90 48 c7 c7 33 0b 0c 82 89 c6 e8 6e 03 1f ff 41 ff c7 e9 90 [ 97.370429] RSP: 0000:ffffc90000013b50 EFLAGS: 00010286 [ 97.371852] RAX: 00000000fffffff0 RBX: ffff888005919c00 RCX: 0000000000000000 [ 97.373829] RDX: ffff888003f40000 RSI: ffffffff8236a598 RDI: ffff888003f40a68 [ 97.375715] RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000000 [ 97.377675] R10: ffffffff811c9ae5 R11: ffffffff8120c4e0 R12: 0000000000000000 [ 97.379591] R13: 0000000000000001 R14: 0000000000000015 R15: 0000000000000000 [ 97.381536] FS: 0000000000000000(0000) GS:ffff88807dcc0000(0000) knlGS:0000000000000000 [ 97.383813] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 97.385449] CR2: 0000000000000000 CR3: 0000000002244000 CR4: 00000000000006b0 [ 97.387347] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 97.389277] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 97.391196] Call Trace: [ 97.391967] <TASK> [ 97.392647] ? __warn+0xcc/0x180 [ 97.393640] ? kprobe_trace_self_tests_init+0x3f1/0x480 [ 97.395181] ? report_bug+0xbd/0x150 [ 97.396234] ? handle_bug+0x3e/0x60 [ 97.397311] ? exc_invalid_op+0x1a/0x50 [ 97.398434] ? asm_exc_invalid_op+0x1a/0x20 [ 97.399652] ? trace_kprobe_is_busy+0x20/0x20 [ 97.400904] ? tracing_reset_all_online_cpus+0x15/0x90 [ 97.402304] ? kprobe_trace_self_tests_init+0x3f1/0x480 [ 97.403773] ? init_kprobe_trace+0x50/0x50 [ 97.404972] do_one_initcall+0x112/0x240 [ 97.406113] do_initcall_level+0x95/0xb0 [ 97.407286] ? kernel_init+0x1a/0x1a0 [ 97.408401] do_initcalls+0x3f/0x70 [ 97.409452] kernel_init_freeable+0x16f/0x1e0 [ 97.410662] ? rest_init+0x1f0/0x1f0 [ 97.411738] kernel_init+0x1a/0x1a0 [ 97.412788] ret_from_fork+0x39/0x50 [ 97.413817] ? rest_init+0x1f0/0x1f0 [ 97.414844] ret_from_fork_asm+0x11/0x20 [ 97.416285] </TASK> [ 97.417134] irq event stamp: 13437323 [ 97.418376] hardirqs last enabled at (13437337): [<ffffffff8110bc0c>] console_unlock+0x11c/0x150 [ 97.421285] hardirqs last disabled at (13437370): [<ffffffff8110bbf1>] console_unlock+0x101/0x150 [ 97.423838] softirqs last enabled at (13437366): [<ffffffff8108e17f>] handle_softirqs+0x23f/0x2a0 [ 97.426450] softirqs last disabled at (13437393): [<ffffffff8108e346>] __irq_exit_rcu+0x66/0xd0 [ 97.428850] ---[ end trace 0000000000000000 ]---
And also, since we can not cleanup dynamic_event file, ftracetest are failed too.
To avoid these issues, build these tests only as modules.
--- kernel/trace/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/trace/Kconfig +2 -2
@@ -824,7 +824,7 @@ config PREEMPTIRQ_DELAY_TEST config SYNTH_EVENT_GEN_TEST tristate "Test module for in-kernel synthetic event generation" - depends on SYNTH_EVENTS + depends on SYNTH_EVENTS && m help This option creates a test module to check the base functionality of in-kernel synthetic event definition and
@@ -837,7 +837,7 @@ config SYNTH_EVENT_GEN_TEST config KPROBE_EVENT_GEN_TEST tristate "Test module for in-kernel kprobe event generation" - depends on KPROBE_EVENTS + depends on KPROBE_EVENTS && m help This option creates a test module to check the base functionality of in-kernel kprobe event definition.
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 138/290 cipso: fix total option length computation
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ondrej Mosnacek <[email protected]>
[ Upstream commit 9f36169912331fa035d7b73a91252d7c2512eb1a ]
As evident from the definition of ip_options_get(), the IP option IPOPT_END is used to pad the IP option data array, not IPOPT_NOP. Yet the loop that walks the IP options to determine the total IP options length in cipso_v4_delopt() doesn't take IPOPT_END into account.
Fix it by recognizing the IPOPT_END value as the end of actual options.
--- net/ipv4/cipso_ipv4.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
net/ipv4/cipso_ipv4.c +8 -4
@@ -2016,12 +2016,16 @@ static int cipso_v4_delopt(struct ip_options_rcu __rcu **opt_ptr)* from there we can determine the new total option length */ iter =0 ; optlen_new =0 ; -while (iter < opt->opt.optlen) -if (opt->opt.__data[iter] !=IPOPT_NOP ) { +while (iter < opt->opt.optlen) { +if (opt->opt.__data[iter] ==IPOPT_END ) { +break ; + }else if (opt->opt.__data[iter] ==IPOPT_NOP ) { + iter++; + }else { iter += opt->opt.__data[iter +1 ]; optlen_new = iter; - }else - iter++; + } + } hdr_delta = opt->opt.optlen; opt->opt.optlen = (optlen_new +3 ) & ~3 ; hdr_delta -= opt->opt.optlen;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 139/290 netrom: Fix a memory leak in nr_heartbeat_expiry()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gavrilov Ilia <[email protected]>
[ Upstream commit 0b9130247f3b6a1122478471ff0e014ea96bb735 ]
syzbot reported a memory leak in nr_create() [0].
Commit 409db27e3a2e ("netrom: Fix use-after-free of a listening socket.") added sock_hold() to the nr_heartbeat_expiry() function, where
a) a socket has a SOCK_DESTROY flag or
b) a listening socket has a SOCK_DEAD flag.
But in the case "a," when the SOCK_DESTROY flag is set, the file descriptor has already been closed and the nr_release() function has been called. So it makes no sense to hold the reference count because no one will call another nr_destroy_socket() and put it as in the case "b."
nr_connect
nr_establish_data_link
nr_start_heartbeat
nr_release
switch (nr->state)
case NR_STATE_3
nr->state = NR_STATE_2
sock_set_flag(sk, SOCK_DESTROY);
nr_rx_frame
nr_process_rx_frame
switch (nr->state)
case NR_STATE_2
nr_state2_machine()
nr_disconnect()
nr_sk(sk)->state = NR_STATE_0
sock_set_flag(sk, SOCK_DEAD)
nr_heartbeat_expiry
switch (nr->state)
case NR_STATE_0
if (sock_flag(sk, SOCK_DESTROY) ||
(sk->sk_state == TCP_LISTEN
&& sock_flag(sk, SOCK_DEAD)))
sock_hold() // ( !!! )
nr_destroy_socket()To fix the memory leak, let's call sock_hold() only for a listening socket.
Found by InfoTeCS on behalf of Linux Verification Center (linuxtesting.org) with Syzkaller.
[0]: https://syzkaller.appspot.com/bug?extid=d327a1f3b12e1e206c16
--- net/netrom/nr_timer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/netrom/nr_timer.c +2 -1
@@ -121,7 +121,8 @@ static void nr_heartbeat_expiry(struct timer_list *t)is accepted() it isn't 'dead' so doesn't get removed. */ if (sock_flag (sk,SOCK_DESTROY ) || (sk->sk_state ==TCP_LISTEN &&sock_flag (sk,SOCK_DEAD ))) { -sock_hold (sk); +if (sk->sk_state ==TCP_LISTEN ) +sock_hold (sk);bh_unlock_sock (sk);nr_destroy_socket (sk); goto out;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 122/290 ASoC: Intel: sof_sdw: add JD2 quirk for HP Omen 14
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pierre-Louis Bossart <[email protected]>
[ Upstream commit 4fee07fbf47d2a5f1065d985459e5ce7bf7969f0 ]
The default JD1 does not seem to work, use JD2 instead.
--- sound/soc/intel/boards/sof_sdw.c | 9 +++++++++ 1 file changed, 9 insertions(+)
sound/soc/intel/boards/sof_sdw.c +9 -0
@@ -216,6 +216,15 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { }, .driver_data = (void *)(SOF_SDW_PCH_DMIC), }, + { + .callback = sof_sdw_quirk_cb, + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"HP" ), + DMI_MATCH(DMI_PRODUCT_NAME, "OMEN Transcend Gaming Laptop"), + }, + .driver_data = (void *)(RT711_JD2), + }, + /* LunarLake devices */ { .callback = sof_sdw_quirk_cb,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 140/290 ipv6: prevent possible NULL deref in fib6_nh_init()
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 2eab4543a2204092c3a7af81d7d6c506e59a03a6 ]
syzbot reminds us that in6_dev_get() can return NULL.
fib6_nh_init()
ip6_validate_gw( &idev )
ip6_route_check_nh( idev )
*idev = in6_dev_get(dev); // can be NULL
Oops: general protection fault, probably for non-canonical address 0xdffffc00000000bc: 0000 [#1] PREEMPT SMP KASAN PTI KASAN: null-ptr-deref in range [0x00000000000005e0-0x00000000000005e7] CPU: 0 PID: 11237 Comm: syz-executor.3 Not tainted 6.10.0-rc2-syzkaller-00249-gbe27b8965297 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 RIP: 0010:fib6_nh_init+0x640/0x2160 net/ipv6/route.c:3606 Code: 00 00 fc ff df 4c 8b 64 24 58 48 8b 44 24 28 4c 8b 74 24 30 48 89 c1 48 89 44 24 28 48 8d 98 e0 05 00 00 48 89 d8 48 c1 e8 03 <42> 0f b6 04 38 84 c0 0f 85 b3 17 00 00 8b 1b 31 ff 89 de e8 b8 8b RSP: 0018:ffffc900032775a0 EFLAGS: 00010202 RAX: 00000000000000bc RBX: 00000000000005e0 RCX: 0000000000000000 RDX: 0000000000000010 RSI: ffffc90003277a54 RDI: ffff88802b3a08d8 RBP: ffffc900032778b0 R08: 00000000000002fc R09: 0000000000000000 R10: 00000000000002fc R11: 0000000000000000 R12: ffff88802b3a08b8 R13: 1ffff9200064eec8 R14: ffffc90003277a00 R15: dffffc0000000000 FS: 00007f940feb06c0(0000) GS:ffff8880b9400000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 00000000245e8000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> ip6_route_info_create+0x99e/0x12b0 net/ipv6/route.c:3809 ip6_route_add+0x28/0x160 net/ipv6/route.c:3853 ipv6_route_ioctl+0x588/0x870 net/ipv6/route.c:4483 inet6_ioctl+0x21a/0x280 net/ipv6/af_inet6.c:579 sock_do_ioctl+0x158/0x460 net/socket.c:1222 sock_ioctl+0x629/0x8e0 net/socket.c:1341 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f940f07cea9
--- net/ipv6/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/route.c +1 -1
@@ -3488,7 +3488,7 @@ int fib6_nh_init(struct net *net, struct fib6_nh *fib6_nh,if (!dev) goto out; -if (idev->cnf.disable_ipv6) { +if (!idev || idev->cnf.disable_ipv6) {NL_SET_ERR_MSG (extack,"IPv6 is disabled on nexthop device" ); err = -EACCES ; goto out;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 141/290 ipv6: prevent possible NULL dereference in rt6_probe()
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 b86762dbe19a62e785c189f313cda5b989931f37 ]
syzbot caught a NULL dereference in rt6_probe() [1]
Bail out if __in6_dev_get() returns NULL.
[1]
Oops: general protection fault, probably for non-canonical address 0xdffffc00000000cb: 0000 [#1] PREEMPT SMP KASAN PTI KASAN: null-ptr-deref in range [0x0000000000000658-0x000000000000065f] CPU: 1 PID: 22444 Comm: syz-executor.0 Not tainted 6.10.0-rc2-syzkaller-00383-gb8481381d4e2 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 RIP: 0010:rt6_probe net/ipv6/route.c:656 [inline] RIP: 0010:find_match+0x8c4/0xf50 net/ipv6/route.c:758 Code: 14 fd f7 48 8b 85 38 ff ff ff 48 c7 45 b0 00 00 00 00 48 8d b8 5c 06 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 14 02 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 19 RSP: 0018:ffffc900034af070 EFLAGS: 00010203 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffc90004521000 RDX: 00000000000000cb RSI: ffffffff8990d0cd RDI: 000000000000065c RBP: ffffc900034af150 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000002 R12: 000000000000000a R13: 1ffff92000695e18 R14: ffff8880244a1d20 R15: 0000000000000000 FS: 00007f4844a5a6c0(0000) GS:ffff8880b9300000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b31b27000 CR3: 000000002d42c000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> rt6_nh_find_match+0xfa/0x1a0 net/ipv6/route.c:784 nexthop_for_each_fib6_nh+0x26d/0x4a0 net/ipv4/nexthop.c:1496 __find_rr_leaf+0x6e7/0xe00 net/ipv6/route.c:825 find_rr_leaf net/ipv6/route.c:853 [inline] rt6_select net/ipv6/route.c:897 [inline] fib6_table_lookup+0x57e/0xa30 net/ipv6/route.c:2195 ip6_pol_route+0x1cd/0x1150 net/ipv6/route.c:2231 pol_lookup_func include/net/ip6_fib.h:616 [inline] fib6_rule_lookup+0x386/0x720 net/ipv6/fib6_rules.c:121 ip6_route_output_flags_noref net/ipv6/route.c:2639 [inline] ip6_route_output_flags+0x1d0/0x640 net/ipv6/route.c:2651 ip6_dst_lookup_tail.constprop.0+0x961/0x1760 net/ipv6/ip6_output.c:1147 ip6_dst_lookup_flow+0x99/0x1d0 net/ipv6/ip6_output.c:1250 rawv6_sendmsg+0xdab/0x4340 net/ipv6/raw.c:898 inet_sendmsg+0x119/0x140 net/ipv4/af_inet.c:853 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] sock_write_iter+0x4b8/0x5c0 net/socket.c:1160 new_sync_write fs/read_write.c:497 [inline] vfs_write+0x6b6/0x1140 fs/read_write.c:590 ksys_write+0x1f8/0x260 fs/read_write.c:643 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f
--- net/ipv6/route.c | 2 ++ 1 file changed, 2 insertions(+)
net/ipv6/route.c +2 -0
@@ -632,6 +632,8 @@ static void rt6_probe(struct fib6_nh *fib6_nh)rcu_read_lock_bh (); last_probe =READ_ONCE (fib6_nh->last_probe); idev =__in6_dev_get (dev); +if (!idev) + goto out; neigh =__ipv6_neigh_lookup_noref (dev, nh_gw);if (neigh) {if (neigh->nud_state &NUD_VALID )
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 142/290 xfrm6: check ip6_dst_idev() return value in xfrm6_get_saddr()
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 d46401052c2d5614da8efea5788532f0401cb164 ]
ip6_dst_idev() can return NULL, xfrm6_get_saddr() must act accordingly.
syzbot reported:
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN PTI KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] CPU: 1 PID: 12 Comm: kworker/u8:1 Not tainted 6.10.0-rc2-syzkaller-00383-gb8481381d4e2 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Workqueue: wg-kex-wg1 wg_packet_handshake_send_worker RIP: 0010:xfrm6_get_saddr+0x93/0x130 net/ipv6/xfrm6_policy.c:64 Code: df 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 97 00 00 00 4c 8b ab d8 00 00 00 48 b8 00 00 00 00 00 fc ff df 4c 89 ea 48 c1 ea 03 <80> 3c 02 00 0f 85 86 00 00 00 4d 8b 6d 00 e8 ca 13 47 01 48 b8 00 RSP: 0018:ffffc90000117378 EFLAGS: 00010246 RAX: dffffc0000000000 RBX: ffff88807b079dc0 RCX: ffffffff89a0d6d7 RDX: 0000000000000000 RSI: ffffffff89a0d6e9 RDI: ffff88807b079e98 RBP: ffff88807ad73248 R08: 0000000000000007 R09: fffffffffffff000 R10: ffff88807b079dc0 R11: 0000000000000007 R12: ffffc90000117480 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff8880b9300000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f4586d00440 CR3: 0000000079042000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> xfrm_get_saddr net/xfrm/xfrm_policy.c:2452 [inline] xfrm_tmpl_resolve_one net/xfrm/xfrm_policy.c:2481 [inline] xfrm_tmpl_resolve+0xa26/0xf10 net/xfrm/xfrm_policy.c:2541 xfrm_resolve_and_create_bundle+0x140/0x2570 net/xfrm/xfrm_policy.c:2835 xfrm_bundle_lookup net/xfrm/xfrm_policy.c:3070 [inline] xfrm_lookup_with_ifid+0x4d1/0x1e60 net/xfrm/xfrm_policy.c:3201 xfrm_lookup net/xfrm/xfrm_policy.c:3298 [inline] xfrm_lookup_route+0x3b/0x200 net/xfrm/xfrm_policy.c:3309 ip6_dst_lookup_flow+0x15c/0x1d0 net/ipv6/ip6_output.c:1256 send6+0x611/0xd20 drivers/net/wireguard/socket.c:139 wg_socket_send_skb_to_peer+0xf9/0x220 drivers/net/wireguard/socket.c:178 wg_socket_send_buffer_to_peer+0x12b/0x190 drivers/net/wireguard/socket.c:200 wg_packet_send_handshake_initiation+0x227/0x360 drivers/net/wireguard/send.c:40 wg_packet_handshake_send_worker+0x1c/0x30 drivers/net/wireguard/send.c:51 process_one_work+0x9fb/0x1b60 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
--- net/ipv6/xfrm6_policy.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
net/ipv6/xfrm6_policy.c +7 -1
@@ -57,12 +57,18 @@ static int xfrm6_get_saddr(struct net *net, int oif, {struct dst_entry *dst;struct net_device *dev; +struct inet6_dev *idev; dst =xfrm6_dst_lookup (net,0 , oif,NULL , daddr, mark);if (IS_ERR (dst))return -EHOSTUNREACH ; - dev =ip6_dst_idev (dst)->dev; + idev =ip6_dst_idev (dst); +if (!idev) { +dst_release (dst); +return -EHOSTUNREACH ; + } + dev = idev->dev;ipv6_dev_get_saddr (dev_net (dev), dev, &daddr->in6,0 , &saddr->in6);dst_release (dst);return 0 ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 143/290 netns: Make get_net_ns() handle zero refcount net
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yue Haibing <[email protected]>
[ Upstream commit ff960f9d3edbe08a736b5a224d91a305ccc946b0 ]
Syzkaller hit a warning:refcount_t: addition on 0; use-after-free.
WARNING: CPU: 3 PID: 7890 at lib/refcount.c:25 refcount_warn_saturate+0xdf/0x1d0 Modules linked in: CPU: 3 PID: 7890 Comm: tun Not tainted 6.10.0-rc3-00100-gcaa4f9578aba-dirty #310 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 RIP: 0010:refcount_warn_saturate+0xdf/0x1d0 Code: 41 49 04 31 ff 89 de e8 9f 1e cd fe 84 db 75 9c e8 76 26 cd fe c6 05 b6 41 49 04 01 90 48 c7 c7 b8 8e 25 86 e8 d2 05 b5 fe 90 <0f> 0b 90 90 e9 79 ff ff ff e8 53 26 cd fe 0f b6 1 RSP: 0018:ffff8881067b7da0 EFLAGS: 00010286 RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff811c72ac RDX: ffff8881026a2140 RSI: ffffffff811c72b5 RDI: 0000000000000001 RBP: ffff8881067b7db0 R08: 0000000000000000 R09: 205b5d3730353139 R10: 0000000000000000 R11: 205d303938375420 R12: ffff8881086500c4 R13: ffff8881086500c4 R14: ffff8881086500b0 R15: ffff888108650040 FS: 00007f5b2961a4c0(0000) GS:ffff88823bd00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055d7ed36fd18 CR3: 00000001482f6000 CR4: 00000000000006f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> ? show_regs+0xa3/0xc0 ? __warn+0xa5/0x1c0 ? refcount_warn_saturate+0xdf/0x1d0 ? report_bug+0x1fc/0x2d0 ? refcount_warn_saturate+0xdf/0x1d0 ? handle_bug+0xa1/0x110 ? exc_invalid_op+0x3c/0xb0 ? asm_exc_invalid_op+0x1f/0x30 ? __warn_printk+0xcc/0x140 ? __warn_printk+0xd5/0x140 ? refcount_warn_saturate+0xdf/0x1d0 get_net_ns+0xa4/0xc0 ? __pfx_get_net_ns+0x10/0x10 open_related_ns+0x5a/0x130 __tun_chr_ioctl+0x1616/0x2370 ? __sanitizer_cov_trace_switch+0x58/0xa0 ? __sanitizer_cov_trace_const_cmp2+0x1c/0x30 ? __pfx_tun_chr_ioctl+0x10/0x10 tun_chr_ioctl+0x2f/0x40 __x64_sys_ioctl+0x11b/0x160 x64_sys_call+0x1211/0x20d0 do_syscall_64+0x9e/0x1d0 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f5b28f165d7 Code: b3 66 90 48 8b 05 b1 48 2d 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 81 48 2d 00 8 RSP: 002b:00007ffc2b59c5e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f5b28f165d7 RDX: 0000000000000000 RSI: 00000000000054e3 RDI: 0000000000000003 RBP: 00007ffc2b59c650 R08: 00007f5b291ed8c0 R09: 00007f5b2961a4c0 R10: 0000000029690010 R11: 0000000000000246 R12: 0000000000400730 R13: 00007ffc2b59cf40 R14: 0000000000000000 R15: 0000000000000000 </TASK> Kernel panic - not syncing: kernel: panic_on_warn set ...
This is trigger as below:
ns0 ns1tun_set_iff() //dev is tun0
tun->dev = dev
//ip link set tun0 netns ns1
put_net() //ref is 0
__tun_chr_ioctl() //TUNGETDEVNETNS
net = dev_net(tun->dev);
open_related_ns(&net->ns, get_net_ns); //ns1
get_net_ns()
get_net() //addition on 0
Use maybe_get_net() in get_net_ns in case net's ref is zero to fix this
--- net/core/net_namespace.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
net/core/net_namespace.c +7 -2
@@ -670,11 +670,16 @@ EXPORT_SYMBOL_GPL(__put_net);* get_net_ns - increment the refcount of the network namespace * @ns: common namespace (net) * -* Returns the net's common namespace. +* Returns the net's common namespace or ERR_PTR() if ref is zero. */ struct ns_common *get_net_ns (struct ns_common *ns) { - return &get_net(container_of(ns, struct net, ns))->ns; +struct net *net; + + net = maybe_get_net(container_of(ns, struct net, ns)); +if (net) +return &net->ns; +return ERR_PTR (-EINVAL ); }EXPORT_SYMBOL_GPL (get_net_ns);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 144/290 qca_spi: Make interrupt remembering atomic
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Wahren <[email protected]>
[ Upstream commit 2d7198278ece01818cd95a3beffbdf8b2a353fa0 ]
The whole mechanism to remember occurred SPI interrupts is not atomic, which could lead to unexpected behavior. So fix this by using atomic bit operations instead.
--- drivers/net/ethernet/qualcomm/qca_debug.c | 6 ++---- drivers/net/ethernet/qualcomm/qca_spi.c | 16 ++++++++-------- drivers/net/ethernet/qualcomm/qca_spi.h | 3 +-- 3 files changed, 11 insertions(+), 14 deletions(-)
drivers/net/ethernet/qualcomm/qca_debug.c +2 -4
@@ -110,10 +110,8 @@ qcaspi_info_show(struct seq_file *s, voiseq_printf (s,"IRQ : %d\n" , qca->spi_dev->irq); -seq_printf (s,"INTR REQ : %u\n" , - qca->intr_req); -seq_printf (s,"INTR SVC : %u\n" , - qca->intr_svc); +seq_printf (s,"INTR : %lx\n" , + qca->intr);seq_printf (s,"SPI max speed : %lu\n" , (unsigned long )qca->spi_dev->max_speed_hz);
drivers/net/ethernet/qualcomm/qca_spi.c +8 -8
@@ -49,6 +49,8 @@#define MAX_DMA_BURST_LEN 5000 +#define SPI_INTR 0 +/* Modules parameters */ #define QCASPI_CLK_SPEED_MIN 1000000#define QCASPI_CLK_SPEED_MAX 16000000
@@ -585,14 +587,14 @@ qcaspi_spi_thread(void *data)continue ; } -if ((qca->intr_req == qca->intr_svc) && +if (!test_bit (SPI_INTR , &qca->intr) && !qca->txr.skb[qca->txr.head])schedule ();set_current_state (TASK_RUNNING ); -netdev_dbg (qca->net_dev,"have work to do. int: %d, tx_skb: %p\n" , - qca->intr_req - qca->intr_svc, +netdev_dbg (qca->net_dev,"have work to do. int: %lu, tx_skb: %p\n" , + qca->intr, qca->txr.skb[qca->txr.head]);qcaspi_qca7k_sync (qca,QCASPI_EVENT_UPDATE );
@@ -606,8 +608,7 @@ qcaspi_spi_thread(void *data)msleep (QCASPI_QCA7K_REBOOT_TIME_MS ); } -if (qca->intr_svc != qca->intr_req) { - qca->intr_svc = qca->intr_req; +if (test_and_clear_bit (SPI_INTR , &qca->intr)) {start_spi_intr_handling (qca, &intr_cause);if (intr_cause &SPI_INT_CPU_ON ) {
@@ -669,7 +670,7 @@ qcaspi_intr_handler(int irq, void *data) {struct qcaspi *qca = data; - qca->intr_req++; +set_bit (SPI_INTR , &qca->intr);if (qca->spi_thread && qca->spi_thread->state !=TASK_RUNNING )wake_up_process (qca->spi_thread);
@@ -686,8 +687,7 @@ qcaspi_netdev_open(struct net_device *deif (!qca)return -EINVAL ; - qca->intr_req =1 ; - qca->intr_svc =0 ; +set_bit (SPI_INTR , &qca->intr); qca->sync =QCASPI_SYNC_UNKNOWN ;qcafrm_fsm_init_spi (&qca->frm_handle);
drivers/net/ethernet/qualcomm/qca_spi.h +1 -2
@@ -92,8 +92,7 @@ struct qcaspi {struct qcafrm_handle frm_handle;struct sk_buff *rx_skb; -unsigned int intr_req; -unsigned int intr_svc; +unsigned long intr;u16 reset_count;#ifdef CONFIG_DEBUG_FS
Greg Kroah-Hartman
maintainerPATCH 145/290 net/sched: act_api: rely on rcu in tcf_idr_check_alloc
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pedro Tammela <[email protected]>
[ Upstream commit 4b55e86736d5b492cf689125da2600f59c7d2c39 ]
Instead of relying only on the idrinfo->lock mutex for bind/alloc logic, rely on a combination of rcu + mutex + atomics to better scale the case where multiple rtnl-less filters are binding to the same action object.
Action binding happens when an action index is specified explicitly and
an action exists which such index exists. Example:
tc actions add action drop index 1
tc filter add ... matchall action drop index 1
tc filter add ... matchall action drop index 1
tc filter add ... matchall action drop index 1
tc filter ls ...
filter protocol all pref 49150 matchall chain 0 filter protocol all pref 49150 matchall chain 0 handle 0x1 not_in_hw
action order 1: gact action drop
random type none pass val 0
index 1 ref 4 bind 3
filter protocol all pref 49151 matchall chain 0 filter protocol all pref 49151 matchall chain 0 handle 0x1
not_in_hw
action order 1: gact action drop
random type none pass val 0
index 1 ref 4 bind 3
filter protocol all pref 49152 matchall chain 0 filter protocol all pref 49152 matchall chain 0 handle 0x1
not_in_hw
action order 1: gact action drop
random type none pass val 0
index 1 ref 4 bind 3
When no index is specified, as before, grab the mutex and allocate in the idr the next available id. In this version, as opposed to before, it's simplified to store the -EBUSY pointer instead of the previous alloc + replace combination.
When an index is specified, rely on rcu to find if there's an object in such index. If there's none, fallback to the above, serializing on the mutex and reserving the specified id. If there's one, it can be an -EBUSY pointer, in which case we just try again until it's an action, or an action. Given the rcu guarantees, the action found could be dead and therefore we need to bump the refcount if it's not 0, handling the case it's in fact 0.
As bind and the action refcount are already atomics, these increments can happen without the mutex protection while many tcf_idr_check_alloc race to bind to the same action instance.
In case binding encounters a parallel delete or add, it will return -EAGAIN in order to try again. Both filter and action apis already have the retry machinery in-place. In case it's an unlocked filter it retries under the rtnl lock.
Stable-dep-of: d864319871b0 ("net/sched: act_api: fix possible infinite loop in tcf_idr_check_alloc()")
--- net/sched/act_api.c | 65 ++++++++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 22 deletions(-)
net/sched/act_api.c +43 -22
@@ -507,6 +507,9 @@ EXPORT_SYMBOL(tcf_idr_cleanup);* its reference and bind counters, and return 1. Otherwise insert temporary * error pointer (to prevent concurrent users from inserting actions with same * index) and return 0. +* +* May return -EAGAIN for binding actions in case of a parallel add/delete on +* the requested index. */ int tcf_idr_check_alloc(struct tc_action_net *tn, u32 *index,
@@ -515,43 +518,61 @@ int tcf_idr_check_alloc(struct tc_action_net *tn, u32 *index,struct tcf_idrinfo *idrinfo = tn->idrinfo;struct tc_action *p;int ret; +u32 max; -again: -mutex_lock (&idrinfo->lock);if (*index) { +again: +rcu_read_lock (); p =idr_find (&idrinfo->action_idr, *index); +if (IS_ERR (p)) {/* This means that another process allocated * index but did not assign the pointer yet. */ -mutex_unlock (&idrinfo->lock); +rcu_read_unlock (); goto again; } -if (p) { -refcount_inc (&p->tcfa_refcnt); -if (bind) -atomic_inc (&p->tcfa_bindcnt); - *a = p; - ret =1 ; - }else { - *a =NULL ; - ret =idr_alloc_u32 (&idrinfo->action_idr,NULL , index, - *index,GFP_KERNEL ); -if (!ret) -idr_replace (&idrinfo->action_idr, -ERR_PTR (-EBUSY ), *index); +if (!p) { +/* Empty slot, try to allocate it */ + max = *index; +rcu_read_unlock (); + goto new; + } + +if (!refcount_inc_not_zero (&p->tcfa_refcnt)) { +/* Action was deleted in parallel */ +rcu_read_unlock (); +return -EAGAIN ; } + +if (bind) +atomic_inc (&p->tcfa_bindcnt); + *a = p; + +rcu_read_unlock (); + +return 1 ; }else { +/* Find a slot */ *index =1 ; - *a =NULL ; - ret =idr_alloc_u32 (&idrinfo->action_idr,NULL , index, -UINT_MAX ,GFP_KERNEL ); -if (!ret) -idr_replace (&idrinfo->action_idr,ERR_PTR (-EBUSY ), - *index); + max =UINT_MAX ; } + +new: + *a =NULL ; + +mutex_lock (&idrinfo->lock); + ret =idr_alloc_u32 (&idrinfo->action_idr,ERR_PTR (-EBUSY ), index, max, +GFP_KERNEL );mutex_unlock (&idrinfo->lock); + +/* N binds raced for action allocation, +* retry for all the ones that failed. +*/ +if (ret == -ENOSPC && *index == max) + ret = -EAGAIN ; +return ret; }EXPORT_SYMBOL (tcf_idr_check_alloc);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 146/290 net/sched: act_api: fix possible infinite loop in tcf_idr_check_alloc()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Ruth <[email protected]>
[ Upstream commit d864319871b05fadd153e0aede4811ca7008f5d6 ]
syzbot found hanging tasks waiting on rtnl_lock [1]
A reproducer is available in the syzbot bug.
When a request to add multiple actions with the same index is sent, the second request will block forever on the first request. This holds rtnl_lock, and causes tasks to hang.
Return -EAGAIN to prevent infinite looping, while keeping documented behavior.
[1]
INFO: task kworker/1:0:5088 blocked for more than 143 seconds. Not tainted 6.9.0-rc4-syzkaller-00173-g3cdb45594619 #0 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:kworker/1:0 state:D stack:23744 pid:5088 tgid:5088 ppid:2 flags:0x00004000 Workqueue: events_power_efficient reg_check_chans_work Call Trace: <TASK> context_switch kernel/sched/core.c:5409 [inline] __schedule+0xf15/0x5d00 kernel/sched/core.c:6746 __schedule_loop kernel/sched/core.c:6823 [inline] schedule+0xe7/0x350 kernel/sched/core.c:6838 schedule_preempt_disabled+0x13/0x30 kernel/sched/core.c:6895 __mutex_lock_common kernel/locking/mutex.c:684 [inline] __mutex_lock+0x5b8/0x9c0 kernel/locking/mutex.c:752 wiphy_lock include/net/cfg80211.h:5953 [inline] reg_leave_invalid_chans net/wireless/reg.c:2466 [inline] reg_check_chans_work+0x10a/0x10e0 net/wireless/reg.c:2481
--- net/sched/act_api.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
net/sched/act_api.c +1 -2
@@ -521,7 +521,6 @@ int tcf_idr_check_alloc(struct tc_action_net *tn, u32 *index,u32 max;if (*index) { -again:rcu_read_lock (); p =idr_find (&idrinfo->action_idr, *index);
@@ -530,7 +529,7 @@ int tcf_idr_check_alloc(struct tc_action_net *tn, u32 *index,* index but did not assign the pointer yet. */ rcu_read_unlock (); - goto again; +return -EAGAIN ; }if (!p) {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 147/290 tipc: force a dst refcount before doing decryption
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 2ebe8f840c7450ecbfca9d18ac92e9ce9155e269 ]
As it says in commit 3bc07321ccc2 ("xfrm: Force a dst refcount before entering the xfrm type handlers"):
"Crypto requests might return asynchronous. In this case we leave the
rcu protected region, so force a refcount on the skb's destination entry before we enter the xfrm type input/output handlers."
On TIPC decryption path it has the same problem, and skb_dst_force() should be called before doing decryption to avoid a possible crash.
Shuang reported this issue when this warning is triggered:
[] WARNING: include/net/dst.h:337 tipc_sk_rcv+0x1055/0x1ea0 [tipc] [] Kdump: loaded Tainted: G W --------- - - 4.18.0-496.el8.x86_64+debug [] Workqueue: crypto cryptd_queue_worker
[] RIP: 0010:tipc_sk_rcv+0x1055/0x1ea0 [tipc]
[] Call Trace:
[] tipc_sk_mcast_rcv+0x548/0xea0 [tipc]
[] tipc_rcv+0xcf5/0x1060 [tipc]
[] tipc_aead_decrypt_done+0x215/0x2e0 [tipc]
[] cryptd_aead_crypt+0xdb/0x190
[] cryptd_queue_worker+0xed/0x190
[] process_one_work+0x93d/0x17e0
--- net/tipc/node.c | 1 + 1 file changed, 1 insertion(+)
net/tipc/node.c +1 -0
@@ -2076,6 +2076,7 @@ void tipc_rcv(struct net *net, struct sk_buff *skb, struct tipc_bearer *b) }else { n =tipc_node_find_by_id (net, ehdr->id); } +skb_dst_force (skb);tipc_crypto_rcv (net, (n) ? n->crypto_rx :NULL , &skb, b);if (!skb)return ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 148/290 net/sched: act_ct: set net pointer when creating new nf_flow_table
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vlad Buslov <[email protected]>
[ Upstream commit fc54d9065f90dd25063883f404e6ff9a76913e73 ]
Following patches in series use the pointer to access flow table offload debug variables.
Stable-dep-of: 88c67aeb1407 ("sched: act_ct: add netns into the key of tcf_ct_flow_table")
--- net/sched/act_ct.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
net/sched/act_ct.c +3 -2
@@ -275,7 +275,7 @@ static struct nf_flowtable_type flowtable_ct = { .owner = THIS_MODULE, }; -static int tcf_ct_flow_table_get (struct tcf_ct_params *params) +static int tcf_ct_flow_table_get (struct net *net,struct tcf_ct_params *params) {struct tcf_ct_flow_table *ct_ft;int err = -ENOMEM ;
@@ -300,6 +300,7 @@ static int tcf_ct_flow_table_get(struct tcf_ct_params *params) err =nf_flow_table_init (&ct_ft->nf_ft);if (err) goto err_init; +write_pnet (&ct_ft->nf_ft.net, net);__module_get (THIS_MODULE ); out_unlock:
@@ -1291,7 +1292,7 @@ static int tcf_ct_init(struct net *net, struct nlattr *nla,if (err) goto cleanup; - err =tcf_ct_flow_table_get (params); + err =tcf_ct_flow_table_get (net, params);if (err) goto cleanup_params;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 149/290 sched: act_ct: add netns into the key of tcf_ct_flow_table
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 88c67aeb14070bab61d3dd8be96c8b42ebcaf53a ]
zones_ht is a global hashtable for flow_table with zone as key. However, it does not consider netns when getting a flow_table from zones_ht in tcf_ct_init(), and it means an act_ct action in netns A may get a flow_table that belongs to netns B if it has the same zone value.
In Shuang's test with the TOPO:
tcf2_c <---> tcf2_sw1 <---> tcf2_sw2 <---> tcf2_s
tcf2_sw1 and tcf2_sw2 saw the same flow and used the same flow table, which caused their ct entries entering unexpected states and the TCP connection not able to end normally.
This patch fixes the issue simply by adding netns into the key of tcf_ct_flow_table so that an act_ct action gets a flow_table that belongs to its own netns in tcf_ct_init().
Note that for easy coding we don't use tcf_ct_flow_table.nf_ft.net, as the ct_ft is initialized after inserting it to the hashtable in tcf_ct_flow_table_get() and also it requires to implement several functions in rhashtable_params including hashfn, obj_hashfn and obj_cmpfn.
--- net/sched/act_ct.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
net/sched/act_ct.c +11 -5
@@ -38,21 +38,26 @@ static struct workqueue_struct *act_ct_wq;static struct rhashtable zones_ht;static DEFINE_MUTEX (zones_mutex); +struct zones_ht_key { +struct net *net; +u16 zone; +}; +struct tcf_ct_flow_table {struct rhash_head node;/* In zones tables */ struct rcu_work rwork;struct nf_flowtable nf_ft;refcount_t ref; -u16 zone; +struct zones_ht_key key;bool dying; };static const struct rhashtable_params zones_params = { .head_offset = offsetof(struct tcf_ct_flow_table , node), - .key_offset = offsetof(struct tcf_ct_flow_table , zone), - .key_len = sizeof_field(struct tcf_ct_flow_table, zone), + .key_offset = offsetof(struct tcf_ct_flow_table , key), + .key_len = sizeof_field(struct tcf_ct_flow_table, key), .automatic_shrinking = true, };
@@ -277,11 +282,12 @@ static struct nf_flowtable_type flowtable_ct = {static int tcf_ct_flow_table_get (struct net *net,struct tcf_ct_params *params) { +struct zones_ht_key key = { .net = net, .zone = params->zone };struct tcf_ct_flow_table *ct_ft;int err = -ENOMEM ;mutex_lock (&zones_mutex); - ct_ft =rhashtable_lookup_fast (&zones_ht, ¶ms->zone, zones_params); + ct_ft =rhashtable_lookup_fast (&zones_ht, &key, zones_params);if (ct_ft &&refcount_inc_not_zero (&ct_ft->ref)) goto out_unlock;
@@ -290,7 +296,7 @@ static int tcf_ct_flow_table_get(struct net *net, struct tcf_ct_params *params) goto err_alloc;refcount_set (&ct_ft->ref,1 ); - ct_ft->zone = params->zone; + ct_ft->key = key; err =rhashtable_insert_fast (&zones_ht, &ct_ft->node, zones_params);if (err) goto err_insert;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 123/290 drm/lima: add mask irq callback to gp and pp
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Erico Nunes <[email protected]>
[ Upstream commit 49c13b4d2dd4a831225746e758893673f6ae961c ]
This is needed because we want to reset those devices in device-agnostic code such as lima_sched.
In particular, masking irqs will be useful before a hard reset to prevent race conditions.
--- drivers/gpu/drm/lima/lima_bcast.c | 12 ++++++++++++ drivers/gpu/drm/lima/lima_bcast.h | 3 +++ drivers/gpu/drm/lima/lima_gp.c | 8 ++++++++ drivers/gpu/drm/lima/lima_pp.c | 18 ++++++++++++++++++ drivers/gpu/drm/lima/lima_sched.h | 1 + 5 files changed, 42 insertions(+)
drivers/gpu/drm/lima/lima_bcast.c +12 -0
@@ -43,6 +43,18 @@ void lima_bcast_suspend(struct lima_ip *ip) } +int lima_bcast_mask_irq (struct lima_ip *ip) +{ +bcast_write (LIMA_BCAST_BROADCAST_MASK ,0 ); +bcast_write (LIMA_BCAST_INTERRUPT_MASK ,0 ); +return 0 ; +} + +int lima_bcast_reset (struct lima_ip *ip) +{ +return lima_bcast_hw_init (ip); +} +int lima_bcast_init (struct lima_ip *ip) {int i;
drivers/gpu/drm/lima/lima_bcast.h +3 -0
@@ -13,4 +13,7 @@ void lima_bcast_fini(struct lima_ip *ip);void lima_bcast_enable (struct lima_device *dev,int num_pp); +int lima_bcast_mask_irq (struct lima_ip *ip); +int lima_bcast_reset (struct lima_ip *ip); +#endif
drivers/gpu/drm/lima/lima_gp.c +8 -0
@@ -212,6 +212,13 @@ static void lima_gp_task_mmu_error(struct lima_sched_pipe *pipe)lima_sched_pipe_task_done (pipe); } +static void lima_gp_task_mask_irq (struct lima_sched_pipe *pipe) +{ +struct lima_ip *ip = pipe->processor[0 ]; + +gp_write (LIMA_GP_INT_MASK ,0 ); +} +static int lima_gp_task_recover (struct lima_sched_pipe *pipe) {struct lima_ip *ip = pipe->processor[0 ];
@@ -344,6 +351,7 @@ int lima_gp_pipe_init(struct lima_device *dev) pipe->task_error = lima_gp_task_error; pipe->task_mmu_error = lima_gp_task_mmu_error; pipe->task_recover = lima_gp_task_recover; + pipe->task_mask_irq = lima_gp_task_mask_irq;return 0 ; }
drivers/gpu/drm/lima/lima_pp.c +18 -0
@@ -408,6 +408,9 @@ static void lima_pp_task_error(struct lima_sched_pipe *pipe)lima_pp_hard_reset (ip); } + +if (pipe->bcast_processor) +lima_bcast_reset (pipe->bcast_processor); }static void lima_pp_task_mmu_error (struct lima_sched_pipe *pipe)
@@ -416,6 +419,20 @@ static void lima_pp_task_mmu_error(struct lima_sched_pipe *pipe)lima_sched_pipe_task_done (pipe); } +static void lima_pp_task_mask_irq (struct lima_sched_pipe *pipe) +{ +int i; + +for (i =0 ; i < pipe->num_processor; i++) { +struct lima_ip *ip = pipe->processor[i]; + +pp_write (LIMA_PP_INT_MASK ,0 ); + } + +if (pipe->bcast_processor) +lima_bcast_mask_irq (pipe->bcast_processor); +} +static struct kmem_cache *lima_pp_task_slab;static int lima_pp_task_slab_refcnt;
@@ -447,6 +464,7 @@ int lima_pp_pipe_init(struct lima_device *dev) pipe->task_fini = lima_pp_task_fini; pipe->task_error = lima_pp_task_error; pipe->task_mmu_error = lima_pp_task_mmu_error; + pipe->task_mask_irq = lima_pp_task_mask_irq;return 0 ; }
drivers/gpu/drm/lima/lima_sched.h +1 -0
@@ -83,6 +83,7 @@ struct lima_sched_pipe {void (*task_error)(struct lima_sched_pipe *pipe);void (*task_mmu_error)(struct lima_sched_pipe *pipe);int (*task_recover)(struct lima_sched_pipe *pipe); +void (*task_mask_irq)(struct lima_sched_pipe *pipe);struct work_struct recover_work; };
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 150/290 net: stmmac: No need to calculate speed divider when offload is disabled
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xiaolei Wang <[email protected]>
[ Upstream commit b8c43360f6e424131fa81d3ba8792ad8ff25a09e ]
commit be27b8965297 ("net: stmmac: replace priv->speed with the portTransmitRate from the tc-cbs parameters") introduced a problem. When deleting, it prompts "Invalid portTransmitRate 0 (idleSlope - sendSlope)" and exits. Add judgment on cbs.enable. Only when offload is enabled, speed divider needs to be calculated.
--- .../net/ethernet/stmicro/stmmac/stmmac_tc.c | 40 ++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c +22 -18
@@ -325,24 +325,28 @@ static int tc_setup_cbs(struct stmmac_priv *priv, port_transmit_rate_kbps = qopt->idleslope - qopt->sendslope; -/* Port Transmit Rate and Speed Divider */ -switch (div_s64 (port_transmit_rate_kbps,1000 )) { -case SPEED_10000 : -case SPEED_5000 : - ptr =32 ; -break ; -case SPEED_2500 : -case SPEED_1000 : - ptr =8 ; -break ; -case SPEED_100 : - ptr =4 ; -break ; -default : -netdev_err (priv->dev, -"Invalid portTransmitRate %lld (idleSlope - sendSlope)\n" , - port_transmit_rate_kbps); -return -EINVAL ; +if (qopt->enable) { +/* Port Transmit Rate and Speed Divider */ +switch (div_s64 (port_transmit_rate_kbps,1000 )) { +case SPEED_10000 : +case SPEED_5000 : + ptr =32 ; +break ; +case SPEED_2500 : +case SPEED_1000 : + ptr =8 ; +break ; +case SPEED_100 : + ptr =4 ; +break ; +default : +netdev_err (priv->dev, +"Invalid portTransmitRate %lld (idleSlope - sendSlope)\n" , + port_transmit_rate_kbps); +return -EINVAL ; + } + }else { + ptr =0 ; } mode_to_use = priv->plat->tx_queues_cfg[queue].mode_to_use;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 151/290 virtio_net: checksum offloading handling fix
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heng Qi <[email protected]>
[ Upstream commit 604141c036e1b636e2a71cf6e1aa09d1e45f40c2 ]
In virtio spec 0.95, VIRTIO_NET_F_GUEST_CSUM was designed to handle partially checksummed packets, and the validation of fully checksummed packets by the device is independent of VIRTIO_NET_F_GUEST_CSUM negotiation. However, the specification erroneously stated:
"If VIRTIO_NET_F_GUEST_CSUM is not negotiated, the device MUST set flags
to zero and SHOULD supply a fully checksummed packet to the driver."
This statement is inaccurate because even without VIRTIO_NET_F_GUEST_CSUM negotiation, the device can still set the VIRTIO_NET_HDR_F_DATA_VALID flag. Essentially, the device can facilitate the validation of these packets' checksums - a process known as RX checksum offloading - removing the need for the driver to do so.
This scenario is currently not implemented in the driver and requires correction. The necessary specification correction[1] has been made and approved in the virtio TC vote.
[1] https://lists.oasis-open.org/archives/virtio-comment/202401/msg00011.html
--- drivers/net/virtio_net.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/net/virtio_net.c +10 -2
@@ -3112,8 +3112,16 @@ static int virtnet_probe(struct virtio_device *vdev) dev->features |= dev->hw_features &NETIF_F_ALL_TSO ;/* (!csum && gso) case will be fixed by register_netdev() */ } -if (virtio_has_feature (vdev,VIRTIO_NET_F_GUEST_CSUM )) - dev->features |=NETIF_F_RXCSUM ; + +/* 1. With VIRTIO_NET_F_GUEST_CSUM negotiation, the driver doesn't +* need to calculate checksums for partially checksummed packets, +* as they're considered valid by the upper layer. +* 2. Without VIRTIO_NET_F_GUEST_CSUM negotiation, the driver only +* receives fully checksummed packets. The device may assist in +* validating these packets' checksums, so the driver won't have to. +*/ + dev->features |=NETIF_F_RXCSUM ; +if (virtio_has_feature (vdev,VIRTIO_NET_F_GUEST_TSO4 ) ||virtio_has_feature (vdev,VIRTIO_NET_F_GUEST_TSO6 )) dev->features |=NETIF_F_GRO_HW ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 152/290 netfilter: ipset: Fix suspicious rcu_dereference_protected()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jozsef Kadlecsik <[email protected]>
[ Upstream commit 8ecd06277a7664f4ef018abae3abd3451d64e7a6 ]
When destroying all sets, we are either in pernet exit phase or are executing a "destroy all sets command" from userspace. The latter was taken into account in ip_set_dereference() (nfnetlink mutex is held), but the former was not. The patch adds the required check to rcu_dereference_protected() in ip_set_dereference().
--- net/netfilter/ipset/ip_set_core.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
net/netfilter/ipset/ip_set_core.c +6 -5
@@ -53,12 +53,13 @@ MODULE_DESCRIPTION("core IP set support");MODULE_ALIAS_NFNL_SUBSYS (NFNL_SUBSYS_IPSET );/* When the nfnl mutex or ip_set_ref_lock is held: */ -#define ip_set_dereference (p) \ - rcu_dereference_protected(p, \ +#define ip_set_dereference (inst) \ + rcu_dereference_protected((inst)->ip_set_list, \ lockdep_nfnl_is_held(NFNL_SUBSYS_IPSET) || \ - lockdep_is_held(&ip_set_ref_lock)) + lockdep_is_held(&ip_set_ref_lock) || \ + (inst)->is_deleted)#define ip_set (inst, id) \ - ip_set_dereference((inst)->ip_set_list)[id] + ip_set_dereference(inst)[id]#define ip_set_ref_netlink (inst,id) \ rcu_dereference_raw((inst)->ip_set_list)[id]#define ip_set_dereference_nfnl (p) \
@@ -1137,7 +1138,7 @@ static int ip_set_create(struct net *net, struct sock *ctnl,if (!list) goto cleanup;/* nfnl mutex is held, both lists are valid */ - tmp =ip_set_dereference (inst->ip_set_list); + tmp =ip_set_dereference (inst);memcpy (list, tmp,sizeof (struct ip_set *) * inst->ip_set_max);rcu_assign_pointer (inst->ip_set_list, list);/* Make sure all current packets have passed through */
Signature · 1 line
2.43.0