5.15.161-rc1 review
Subsystems (6)
Greg Kroah-Hartman
maintainerPATCH 284/402 net: Always descend into dsa/ folder with CONFIG_NET_DSA enabled
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Fainelli <[email protected]>
[ Upstream commit b1fa60ec252fba39130107074becd12d0b3f83ec ]
Stephen reported that he was unable to get the dsa_loop driver to get probed, and the reason ended up being because he had CONFIG_FIXED_PHY=y in his kernel configuration. As Masahiro explained it:
"obj-m += dsa/" means everything under dsa/ must be modular.
If there is a built-in object under dsa/ with CONFIG_NET_DSA=m, you cannot do "obj-$(CONFIG_NET_DSA) += dsa/".
You need to change it back to "obj-y += dsa/".
This was the case here whereby CONFIG_NET_DSA=m, and so the obj-$(CONFIG_FIXED_PHY) += dsa_loop_bdinfo.o rule is not executed and the DSA loop mdio_board info structure is not registered with the kernel, and eventually the device is simply not found.
To preserve the intention of the original commit of limiting the amount of folder descending, conditionally descend into drivers/net/dsa when CONFIG_NET_DSA is enabled.
--- drivers/net/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/Makefile +3 -1
@@ -46,7 +46,9 @@ obj-$(CONFIG_ARCNET) += arcnet/ obj-$(CONFIG_DEV_APPLETALK) += appletalk/ obj-$(CONFIG_CAIF) += caif/ obj-$(CONFIG_CAN) += can/ -obj-$(CONFIG_NET_DSA) += dsa/ +ifdef CONFIG_NET_DSA +obj-y += dsa/ +endif obj-$(CONFIG_ETHERNET) += ethernet/ obj-$(CONFIG_FDDI) += fddi/ obj-$(CONFIG_HIPPI) += hippi/
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 285/402 ipv6: sr: fix missing sk_buff release in seg6_input_core
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrea Mayer <[email protected]>
[ Upstream commit 5447f9708d9e4c17a647b16a9cb29e9e02820bd9 ]
The seg6_input() function is responsible for adding the SRH into a packet, delegating the operation to the seg6_input_core(). This function uses the skb_cow_head() to ensure that there is sufficient headroom in the sk_buff for accommodating the link-layer header.
In the event that the skb_cow_header() function fails, the seg6_input_core() catches the error but it does not release the sk_buff, which will result in a memory leak.
This issue was introduced in commit af3b5158b89d ("ipv6: sr: fix BUG due to headroom too small after SRH push") and persists even after commit 7a3f5b0de364 ("netfilter: add netfilter hooks to SRv6 data plane"), where the entire seg6_input() code was refactored to deal with netfilter hooks.
The proposed patch addresses the identified memory leak by requiring the seg6_input_core() function to release the sk_buff in the event that skb_cow_head() fails.
--- net/ipv6/seg6_iptunnel.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
net/ipv6/seg6_iptunnel.c +6 -5
@@ -327,10 +327,8 @@ static int seg6_input_core(struct net *net, struct sock *sk,int err; err =seg6_do_srh (skb); -if (unlikely (err)) { -kfree_skb (skb); -return err; - } +if (unlikely (err)) + goto drop; slwt =seg6_lwt_lwtunnel (orig_dst->lwtstate);
@@ -355,7 +353,7 @@ static int seg6_input_core(struct net *net, struct sock *sk, err =skb_cow_head (skb,LL_RESERVED_SPACE (dst->dev));if (unlikely (err)) -return err; + goto drop;if (static_branch_unlikely (&nf_hooks_lwtunnel_enabled)) return NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_OUT,
@@ -363,6 +361,9 @@ static int seg6_input_core(struct net *net, struct sock *sk, skb_dst(skb)->dev, seg6_input_finish);return seg6_input_finish (dev_net (skb->dev),NULL , skb); +drop: +kfree_skb (skb); +return err; }static int seg6_input_nf (struct sk_buff *skb)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 286/402 nfc: nci: Fix uninit-value in nci_rx_work
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ryosuke Yasuoka <[email protected]>
[ Upstream commit e4a87abf588536d1cdfb128595e6e680af5cf3ed ]
syzbot reported the following uninit-value access issue [1]
nci_rx_work() parses received packet from ndev->rx_q. It should be validated header size, payload size and total packet size before processing the packet. If an invalid packet is detected, it should be silently discarded.
--- net/nfc/nci/core.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
net/nfc/nci/core.c +14 -1
@@ -1466,6 +1466,19 @@ int nci_core_ntf_packet(struct nci_dev * ndev->ops->n_core_ops); } +static bool nci_valid_size (struct sk_buff *skb) +{ +unsigned int hdr_size =NCI_CTRL_HDR_SIZE ; +BUILD_BUG_ON (NCI_CTRL_HDR_SIZE !=NCI_DATA_HDR_SIZE ); + +if (skb->len < hdr_size || + !nci_plen (skb->data) || + skb->len < hdr_size +nci_plen (skb->data)) { +return false; + } +return true; +} +/* ---- NCI TX Data worker thread ---- */ static void nci_tx_work (struct work_struct *work)
@@ -1516,7 +1529,7 @@ static void nci_rx_work(struct work_strunfc_send_to_raw_sock (ndev->nfc_dev, skb,RAW_PAYLOAD_NCI ,NFC_DIRECTION_RX ); -if (!nci_plen (skb->data)) { +if (!nci_valid_size (skb)) {kfree_skb (skb);break ; }
Greg Kroah-Hartman
maintainerPATCH 287/402 ASoC: tas2552: Add TX path for capturing AUDIO-OUT data
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shenghao Ding <[email protected]>
[ Upstream commit 7078ac4fd179a68d0bab448004fcd357e7a45f8d ]
TAS2552 is a Smartamp with I/V sense data, add TX path to support capturing I/V data.
--- sound/soc/codecs/tas2552.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
sound/soc/codecs/tas2552.c +13 -2
@@ -2,7 +2,8 @@/* * tas2552.c - ALSA SoC Texas Instruments TAS2552 Mono Audio Amplifier * -* Copyright (C) 2014 Texas Instruments Incorporated - https://www.ti.com +* Copyright (C) 2014 - 2024 Texas Instruments Incorporated - +* https://www.ti.com * * Author: Dan Murphy <[email protected]> */
@@ -119,12 +120,14 @@ static const struct snd_soc_dapm_widget tas2552_dapm_widgets[] = &tas2552_input_mux_control),SND_SOC_DAPM_AIF_IN ("DAC IN" ,"DAC Playback" ,0 ,SND_SOC_NOPM ,0 ,0 ), +SND_SOC_DAPM_AIF_OUT ("ASI OUT" ,"DAC Capture" ,0 ,SND_SOC_NOPM ,0 ,0 ),SND_SOC_DAPM_DAC ("DAC" ,NULL ,SND_SOC_NOPM ,0 ,0 ),SND_SOC_DAPM_OUT_DRV ("ClassD" ,TAS2552_CFG_2 ,7 ,0 ,NULL ,0 ),SND_SOC_DAPM_SUPPLY ("PLL" ,TAS2552_CFG_2 ,3 ,0 ,NULL ,0 ),SND_SOC_DAPM_POST ("Post Event" , tas2552_post_event), -SND_SOC_DAPM_OUTPUT ("OUT" ) +SND_SOC_DAPM_OUTPUT ("OUT" ), +SND_SOC_DAPM_INPUT ("DMIC" ) }; static const struct snd_soc_dapm_route tas2552_audio_map[] = {
@@ -134,6 +137,7 @@ static const struct snd_soc_dapm_route tas2552_audio_map[] = { {"ClassD", NULL, "Input selection"}, {"OUT", NULL, "ClassD"}, {"ClassD", NULL, "PLL"}, + {"ASI OUT", NULL, "DMIC"} };#ifdef CONFIG_PM
@@ -538,6 +542,13 @@ static struct snd_soc_dai_driver tas2552_dai[] = { .rates = SNDRV_PCM_RATE_8000_192000, .formats = TAS2552_FORMATS, }, + .capture = { + .stream_name = "Capture", + .channels_min = 2, + .channels_max = 2, + .rates = SNDRV_PCM_RATE_8000_192000, + .formats = TAS2552_FORMATS, + }, .ops = &tas2552_speaker_dai_ops, }, };
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 288/402 NFSv4: Fixup smatch warning for ambiguous return
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Coddington <[email protected]>
[ Upstream commit 37ffe06537af3e3ec212e7cbe941046fce0a822f ]
Dan Carpenter reports smatch warning for nfs4_try_migration() when a memory allocation failure results in a zero return value. In this case, a transient allocation failure error will likely be retried the next time the server responds with NFS4ERR_MOVED.
We can fixup the smatch warning with a small refactor: attempt all three allocations before testing and returning on a failure.
--- fs/nfs/nfs4state.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
fs/nfs/nfs4state.c +5 -7
@@ -2102,6 +2102,7 @@ static int nfs4_try_migration(struct nfs_server *server, const struct cred *cred {struct nfs_client *clp = server->nfs_client;struct nfs4_fs_locations *locations =NULL ; +struct nfs_fattr *fattr;struct inode *inode;struct page *page;int status, result;
@@ -2111,19 +2112,16 @@ static int nfs4_try_migration(struct nfs_server *server, const struct cred *cred (unsigned long long )server->fsid.minor, clp->cl_hostname); - result =0 ; page =alloc_page (GFP_KERNEL ); locations =kmalloc (sizeof (struct nfs4_fs_locations ),GFP_KERNEL ); -if (page ==NULL || locations ==NULL ) { -dprintk ("<-- %s: no memory\n" , __func__); - goto out; - } - locations->fattr =nfs_alloc_fattr (); -if (locations->fattr ==NULL ) { + fattr =nfs_alloc_fattr (); +if (page ==NULL || locations ==NULL || fattr ==NULL ) {dprintk ("<-- %s: no memory\n" , __func__); + result =0 ; goto out; } + locations->fattr = fattr; inode =d_inode (server->super->s_root); result =nfs4_proc_get_locations (server,NFS_FH (inode), locations, page, cred);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 289/402 sunrpc: fix NFSACL RPC retry on soft mount
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Aloni <[email protected]>
[ Upstream commit 0dc9f430027b8bd9073fdafdfcdeb1a073ab5594 ]
It used to be quite awhile ago since 1b63a75180c6 ('SUNRPC: Refactor rpc_clone_client()'), in 2012, that cl_timeout was copied in so that all mount parameters propagate to NFSACL clients. However since that change, if mount options as follows are given:
soft,timeo=50,retrans=16,vers=3
The resultant NFSACL client receives:
cl_softrtry: 1
cl_timeout: to_initval=60000, to_maxval=60000, to_increment=0, to_retries=2, to_exponential=0These values lead to NFSACL operations not being retried under the condition of transient network outages with soft mount. Instead, getacl call fails after 60 seconds with EIO.
The simple fix is to pass the existing client's cl_timeout as the new client timeout.
--- net/sunrpc/clnt.c | 1 + 1 file changed, 1 insertion(+)
net/sunrpc/clnt.c +1 -0
@@ -982,6 +982,7 @@ struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *old, .authflavor = old->cl_auth->au_flavor, .cred = old->cl_cred, .stats = old->cl_stats, + .timeout = old->cl_timeout, };struct rpc_clnt *clnt;int err;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 290/402 rpcrdma: fix handling for RDMA_CM_EVENT_DEVICE_REMOVAL
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Aloni <[email protected]>
[ Upstream commit 4836da219781ec510c4c0303df901aa643507a7a ]
Under the scenario of IB device bonding, when bringing down one of the ports, or all ports, we saw xprtrdma entering a non-recoverable state where it is not even possible to complete the disconnect and shut it down the mount, requiring a reboot. Following debug, we saw that transport connect never ended after receiving the RDMA_CM_EVENT_DEVICE_REMOVAL callback.
The DEVICE_REMOVAL callback is irrespective of whether the CM_ID is connected, and ESTABLISHED may not have happened. So need to work with each of these states accordingly.
--- net/sunrpc/xprtrdma/verbs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
net/sunrpc/xprtrdma/verbs.c +5 -1
@@ -258,7 +258,11 @@ rpcrdma_cm_event_handler(struct rdma_cm_id *id, struct rdma_cm_event *event)case RDMA_CM_EVENT_DEVICE_REMOVAL :pr_info ("rpcrdma: removing device %s for %pISpc\n" , ep->re_id->device->name, sap); - fallthrough; +switch (xchg (&ep->re_connect_status, -ENODEV )) { +case 0 : goto wake_connect_worker; +case 1 : goto disconnected; + } +return 0 ;case RDMA_CM_EVENT_ADDR_CHANGE : ep->re_connect_status = -ENODEV ; goto disconnected;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 291/402 af_unix: Update unix_sk(sk)->oob_skb under sk_receive_queue lock.
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuniyuki Iwashima <[email protected]>
[ Upstream commit 9841991a446c87f90f66f4b9fee6fe934c1336a2 ]
Billy Jheng Bing-Jhong reported a race between __unix_gc() and queue_oob().
__unix_gc() tries to garbage-collect close()d inflight sockets, and then if the socket has MSG_OOB in unix_sk(sk)->oob_skb, GC will drop the reference and set NULL to it locklessly.
However, the peer socket still can send MSG_OOB message and queue_oob() can update unix_sk(sk)->oob_skb concurrently, leading NULL pointer dereference. [0]
To fix the issue, let's update unix_sk(sk)->oob_skb under the sk_receive_queue's lock and take it everywhere we touch oob_skb.
Note that we defer kfree_skb() in manage_oob() to silence lockdep false-positive (See [1]).
[0]:
BUG: kernel NULL pointer dereference, address: 0000000000000008 PF: supervisor write access in kernel mode PF: error_code(0x0002) - not-present page PGD 8000000009f5e067 P4D 8000000009f5e067 PUD 9f5d067 PMD 0 Oops: 0002 [#1] PREEMPT SMP PTI CPU: 3 PID: 50 Comm: kworker/3:1 Not tainted 6.9.0-rc5-00191-gd091e579b864 #110 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014 Workqueue: events delayed_fput RIP: 0010:skb_dequeue (./include/linux/skbuff.h:2386 ./include/linux/skbuff.h:2402 net/core/skbuff.c:3847) Code: 39 e3 74 3e 8b 43 10 48 89 ef 83 e8 01 89 43 10 49 8b 44 24 08 49 c7 44 24 08 00 00 00 00 49 8b 14 24 49 c7 04 24 00 00 00 00 <48> 89 42 08 48 89 10 e8 e7 c5 42 00 4c 89 e0 5b 5d 41 5c c3 cc cc RSP: 0018:ffffc900001bfd48 EFLAGS: 00000002 RAX: 0000000000000000 RBX: ffff8880088f5ae8 RCX: 00000000361289f9 RDX: 0000000000000000 RSI: 0000000000000206 RDI: ffff8880088f5b00 RBP: ffff8880088f5b00 R08: 0000000000080000 R09: 0000000000000001 R10: 0000000000000003 R11: 0000000000000001 R12: ffff8880056b6a00 R13: ffff8880088f5280 R14: 0000000000000001 R15: ffff8880088f5a80 FS: 0000000000000000(0000) GS:ffff88807dd80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000008 CR3: 0000000006314000 CR4: 00000000007506f0 PKRU: 55555554 Call Trace: <TASK> unix_release_sock (net/unix/af_unix.c:654) unix_release (net/unix/af_unix.c:1050) __sock_release (net/socket.c:660) sock_close (net/socket.c:1423) __fput (fs/file_table.c:423) delayed_fput (fs/file_table.c:444 (discriminator 3)) process_one_work (kernel/workqueue.c:3259) worker_thread (kernel/workqueue.c:3329 kernel/workqueue.c:3416) kthread (kernel/kthread.c:388) ret_from_fork (arch/x86/kernel/process.c:153) ret_from_fork_asm (arch/x86/entry/entry_64.S:257) </TASK> Modules linked in:
CR2: 0000000000000008
--- net/unix/af_unix.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-)
net/unix/af_unix.c +22 -6
@@ -2005,13 +2005,15 @@ static int queue_oob(struct socket *sock, struct msghdr *msg, struct sock *othermaybe_add_creds (skb, sock, other);skb_get (skb); +scm_stat_add (other, skb); + +spin_lock (&other->sk_receive_queue.lock);if (ousk->oob_skb)consume_skb (ousk->oob_skb); -WRITE_ONCE (ousk->oob_skb, skb); +__skb_queue_tail (&other->sk_receive_queue, skb); +spin_unlock (&other->sk_receive_queue.lock); -scm_stat_add (other, skb); -skb_queue_tail (&other->sk_receive_queue, skb);sk_send_sigurg (other);unix_state_unlock (other); other->sk_data_ready (other);
@@ -2516,8 +2518,10 @@ static int unix_stream_recv_urg(struct unix_stream_read_state *state)mutex_lock (&u->iolock);unix_state_lock (sk); +spin_lock (&sk->sk_receive_queue.lock);if (sock_flag (sk,SOCK_URGINLINE ) || !u->oob_skb) { +spin_unlock (&sk->sk_receive_queue.lock);unix_state_unlock (sk);mutex_unlock (&u->iolock);return -EINVAL ;
@@ -2529,6 +2533,8 @@ static int unix_stream_recv_urg(struct unix_stream_read_state *state)WRITE_ONCE (u->oob_skb,NULL ); elseskb_get (oob_skb ); + +spin_unlock (&sk->sk_receive_queue.lock);unix_state_unlock (sk); chunk = state->recv_actor (oob_skb,0 , chunk, state);
@@ -2557,6 +2563,10 @@ static struct sk_buff *manage_oob(struct sk_buff *skb, struct sock *sk,consume_skb (skb); skb =NULL ; }else { +struct sk_buff *unlinked_skb =NULL ; + +spin_lock (&sk->sk_receive_queue.lock); +if (skb == u->oob_skb) {if (copied) { skb =NULL ;
@@ -2568,13 +2578,19 @@ static struct sk_buff *manage_oob(struct sk_buff *skb, struct sock *sk, }else if (flags &MSG_PEEK ) { skb =NULL ; }else { -skb_unlink (skb, &sk->sk_receive_queue); +__skb_unlink (skb, &sk->sk_receive_queue);WRITE_ONCE (u->oob_skb,NULL ); -if (!WARN_ON_ONCE (skb_unref (skb))) -kfree_skb (skb); + unlinked_skb = skb; skb =skb_peek (&sk->sk_receive_queue); } } + +spin_unlock (&sk->sk_receive_queue.lock); + +if (unlinked_skb) { +WARN_ON_ONCE (skb_unref (unlinked_skb)); +kfree_skb (unlinked_skb); + } }return skb; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 292/402 ipv6: sr: fix memleak in seg6_hmac_init_algo
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hangbin Liu <[email protected]>
[ Upstream commit efb9f4f19f8e37fde43dfecebc80292d179f56c6 ]
seg6_hmac_init_algo returns without cleaning up the previous allocations if one fails, so it's going to leak all that memory and the crypto tfms.
Update seg6_hmac_exit to only free the memory when allocated, so we can reuse the code directly.
--- net/ipv6/seg6_hmac.c | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-)
net/ipv6/seg6_hmac.c +28 -14
@@ -354,6 +354,7 @@ static int seg6_hmac_init_algo(void)struct crypto_shash *tfm;struct shash_desc *shash;int i, alg_count, cpu; +int ret = -ENOMEM ; alg_count =ARRAY_SIZE (hmac_algos);
@@ -364,12 +365,14 @@ static int seg6_hmac_init_algo(void) algo = &hmac_algos[i]; algo->tfms = alloc_percpu(struct crypto_shash *);if (!algo->tfms) -return -ENOMEM ; + goto error_out;for_each_possible_cpu (cpu) { tfm =crypto_alloc_shash (algo->name,0 ,0 ); -if (IS_ERR (tfm)) -return PTR_ERR (tfm); +if (IS_ERR (tfm)) { + ret =PTR_ERR (tfm); + goto error_out; + } p_tfm =per_cpu_ptr (algo->tfms, cpu); *p_tfm = tfm; }
@@ -381,18 +384,22 @@ static int seg6_hmac_init_algo(void) algo->shashs = alloc_percpu(struct shash_desc *);if (!algo->shashs) -return -ENOMEM ; + goto error_out;for_each_possible_cpu (cpu) { shash =kzalloc_node (shsize,GFP_KERNEL ,cpu_to_node (cpu));if (!shash) -return -ENOMEM ; + goto error_out; *per_cpu_ptr (algo->shashs, cpu) = shash; } }return 0 ; + +error_out: +seg6_hmac_exit (); +return ret; }int __init seg6_hmac_init (void )
@@ -412,22 +419,29 @@ int __net_init seg6_hmac_net_init(struct net *net)void seg6_hmac_exit (void ) {struct seg6_hmac_algo *algo =NULL ; +struct crypto_shash *tfm; +struct shash_desc *shash;int i, alg_count, cpu; alg_count =ARRAY_SIZE (hmac_algos);for (i =0 ; i < alg_count; i++) { algo = &hmac_algos[i]; -for_each_possible_cpu (cpu) { -struct crypto_shash *tfm; -struct shash_desc *shash; - shash = *per_cpu_ptr (algo->shashs, cpu); -kfree (shash); - tfm = *per_cpu_ptr (algo->tfms, cpu); -crypto_free_shash (tfm); +if (algo->shashs) { +for_each_possible_cpu (cpu) { + shash = *per_cpu_ptr (algo->shashs, cpu); +kfree (shash); + } +free_percpu (algo->shashs); + } + +if (algo->tfms) { +for_each_possible_cpu (cpu) { + tfm = *per_cpu_ptr (algo->tfms, cpu); +crypto_free_shash (tfm); + } +free_percpu (algo->tfms); } -free_percpu (algo->tfms); -free_percpu (algo->shashs); } }EXPORT_SYMBOL (seg6_hmac_exit);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 293/402 tcp: Fix shift-out-of-bounds in dctcp_update_alpha().
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuniyuki Iwashima <[email protected]>
[ Upstream commit 3ebc46ca8675de6378e3f8f40768e180bb8afa66 ]
In dctcp_update_alpha(), we use a module parameter dctcp_shift_g as follows:
alpha -= min_not_zero(alpha, alpha >> dctcp_shift_g); ... delivered_ce <<= (10 - dctcp_shift_g);
It seems syzkaller started fuzzing module parameters and triggered shift-out-of-bounds [0] by setting 100 to dctcp_shift_g:
memcpy((void*)0x20000080,
"/sys/module/tcp_dctcp/parameters/dctcp_shift_g\000", 47);
res = syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x20000080ul,
/*flags=*/2ul, /*mode=*/0ul);
memcpy((void*)0x20000000, "100\000", 4);
syscall(__NR_write, /*fd=*/r[0], /*val=*/0x20000000ul, /*len=*/4ul);Let's limit the max value of dctcp_shift_g by param_set_uint_minmax().
With this patch:
# echo 10 > /sys/module/tcp_dctcp/parameters/dctcp_shift_g # cat /sys/module/tcp_dctcp/parameters/dctcp_shift_g 10 # echo 11 > /sys/module/tcp_dctcp/parameters/dctcp_shift_g -bash: echo: write error: Invalid argument
[0]:
UBSAN: shift-out-of-bounds in net/ipv4/tcp_dctcp.c:143:12 shift exponent 100 is too large for 32-bit type 'u32' (aka 'unsigned int') CPU: 0 PID: 8083 Comm: syz-executor345 Not tainted 6.9.0-05151-g1b294a1f3561 #2 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 Call Trace: <TASK> __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x201/0x300 lib/dump_stack.c:114 ubsan_epilogue lib/ubsan.c:231 [inline] __ubsan_handle_shift_out_of_bounds+0x346/0x3a0 lib/ubsan.c:468 dctcp_update_alpha+0x540/0x570 net/ipv4/tcp_dctcp.c:143 tcp_in_ack_event net/ipv4/tcp_input.c:3802 [inline] tcp_ack+0x17b1/0x3bc0 net/ipv4/tcp_input.c:3948 tcp_rcv_state_process+0x57a/0x2290 net/ipv4/tcp_input.c:6711 tcp_v4_do_rcv+0x764/0xc40 net/ipv4/tcp_ipv4.c:1937 sk_backlog_rcv include/net/sock.h:1106 [inline] __release_sock+0x20f/0x350 net/core/sock.c:2983 release_sock+0x61/0x1f0 net/core/sock.c:3549 mptcp_subflow_shutdown+0x3d0/0x620 net/mptcp/protocol.c:2907 mptcp_check_send_data_fin+0x225/0x410 net/mptcp/protocol.c:2976 __mptcp_close+0x238/0xad0 net/mptcp/protocol.c:3072 mptcp_close+0x2a/0x1a0 net/mptcp/protocol.c:3127 inet_release+0x190/0x1f0 net/ipv4/af_inet.c:437 __sock_release net/socket.c:659 [inline] sock_close+0xc0/0x240 net/socket.c:1421 __fput+0x41b/0x890 fs/file_table.c:422 task_work_run+0x23b/0x300 kernel/task_work.c:180 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0x9c8/0x2540 kernel/exit.c:878 do_group_exit+0x201/0x2b0 kernel/exit.c:1027 __do_sys_exit_group kernel/exit.c:1038 [inline] __se_sys_exit_group kernel/exit.c:1036 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1036 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xe4/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x67/0x6f RIP: 0033:0x7f6c2b5005b6 Code: Unable to access opcode bytes at 0x7f6c2b50058c. RSP: 002b:00007ffe883eb948 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 00007f6c2b5862f0 RCX: 00007f6c2b5005b6 RDX: 0000000000000001 RSI: 000000000000003c RDI: 0000000000000001 RBP: 0000000000000001 R08: 00000000000000e7 R09: ffffffffffffffc0 R10: 0000000000000006 R11: 0000000000000246 R12: 00007f6c2b5862f0 R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000001 </TASK>
--- net/ipv4/tcp_dctcp.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
net/ipv4/tcp_dctcp.c +12 -1
@@ -55,7 +55,18 @@ struct dctcp { };static unsigned int dctcp_shift_g__read_mostly =4 ;/* g = 1/2^4 */ -module_param (dctcp_shift_g, uint,0644 ); + +static int dctcp_shift_g_set (const char *val,const struct kernel_param *kp) +{ +return param_set_uint_minmax (val, kp,0 ,10 ); +} + +static const struct kernel_param_ops dctcp_shift_g_ops = { + .set = dctcp_shift_g_set, + .get = param_get_uint, +}; + +module_param_cb (dctcp_shift_g, &dctcp_shift_g_ops, &dctcp_shift_g,0644 );MODULE_PARM_DESC (dctcp_shift_g,"parameter g for updating dctcp_alpha" );static unsigned int dctcp_alpha_on_init__read_mostly =DCTCP_MAX_ALPHA ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 294/402 openvswitch: Set the skbuff pkt_type for proper pmtud support.
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aaron Conole <[email protected]>
[ Upstream commit 30a92c9e3d6b073932762bef2ac66f4ee784c657 ]
Open vSwitch is originally intended to switch at layer 2, only dealing with Ethernet frames. With the introduction of l3 tunnels support, it crossed into the realm of needing to care a bit about some routing details when making forwarding decisions. If an oversized packet would need to be fragmented during this forwarding decision, there is a chance for pmtu to get involved and generate a routing exception. This is gated by the skbuff->pkt_type field.
When a flow is already loaded into the openvswitch module this field is set up and transitioned properly as a packet moves from one port to another. In the case that a packet execute is invoked after a flow is newly installed this field is not properly initialized. This causes the pmtud mechanism to omit sending the required exception messages across the tunnel boundary and a second attempt needs to be made to make sure that the routing exception is properly setup. To fix this, we set the outgoing packet's pkt_type to PACKET_OUTGOING, since it can only get to the openvswitch module via a port device or packet command.
Even for bridge ports as users, the pkt_type needs to be reset when doing the transmit as the packet is truly outgoing and routing needs to get involved post packet transformations, in the case of VXLAN/GENEVE/udp-tunnel packets. In general, the pkt_type on output gets ignored, since we go straight to the driver, but in the case of tunnel ports they go through IP routing layer.
This issue is periodically encountered in complex setups, such as large openshift deployments, where multiple sets of tunnel traversal occurs. A way to recreate this is with the ovn-heater project that can setup a networking environment which mimics such large deployments. We need larger environments for this because we need to ensure that flow misses occur. In these environment, without this patch, we can see:
./ovn_cluster.sh start
podman exec ovn-chassis-1 ip r a 170.168.0.5/32 dev eth1 mtu 1200 podman exec ovn-chassis-1 ip netns exec sw01p1 ip r flush cache podman exec ovn-chassis-1 ip netns exec sw01p1 \
ping 21.0.0.3 -M do -s 1300 -c2
PING 21.0.0.3 (21.0.0.3) 1300(1328) bytes of data. From 21.0.0.3 icmp_seq=2 Frag needed and DF set (mtu = 1142)
--- 21.0.0.3 ping statistics ---
...
Using tcpdump, we can also see the expected ICMP FRAG_NEEDED message is not sent into the server.
With this patch, setting the pkt_type, we see the following:
podman exec ovn-chassis-1 ip netns exec sw01p1 \
ping 21.0.0.3 -M do -s 1300 -c2
PING 21.0.0.3 (21.0.0.3) 1300(1328) bytes of data. From 21.0.0.3 icmp_seq=1 Frag needed and DF set (mtu = 1222)
ping: local error: message too long, mtu=1222
--- 21.0.0.3 ping statistics ---
...
In this case, the first ping request receives the FRAG_NEEDED message and a local routing exception is created.
Reported-at: https://issues.redhat.com/browse/FDP-164
--- net/openvswitch/actions.c | 6 ++++++ 1 file changed, 6 insertions(+)
net/openvswitch/actions.c +6 -0
@@ -924,6 +924,12 @@ static void do_output(struct datapath *dp, struct sk_buff *skb, int out_port,pskb_trim (skb,ovs_mac_header_len (key)); } +/* Need to set the pkt_type to involve the routing layer. The +* packet movement through the OVS datapath doesn't generally +* use routing, but this is needed for tunnel cases. +*/ + skb->pkt_type =PACKET_OUTGOING ; +if (likely (!mru || (skb->len <= mru + vport->dev->hard_header_len))) {ovs_vport_send (vport, skb,ovs_key_mac_proto (key));
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 295/402 arm64: asm-bug: Add .align 2 to the end of __BUG_ENTRY
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiangfeng Xiao <[email protected]>
[ Upstream commit ffbf4fb9b5c12ff878a10ea17997147ea4ebea6f ]
When CONFIG_DEBUG_BUGVERBOSE=n, we fail to add necessary padding bytes to bug_table entries, and as a result the last entry in a bug table will be ignored, potentially leading to an unexpected panic(). All prior entries in the table will be handled correctly.
The arm64 ABI requires that struct fields of up to 8 bytes are naturally-aligned, with padding added within a struct such that struct are suitably aligned within arrays.
When CONFIG_DEBUG_BUGVERPOSE=y, the layout of a bug_entry is:
struct bug_entry {
signed int bug_addr_disp; // 4 bytes
signed int file_disp; // 4 bytes
unsigned short line; // 2 bytes
unsigned short flags; // 2 bytes
}
... with 12 bytes total, requiring 4-byte alignment.
When CONFIG_DEBUG_BUGVERBOSE=n, the layout of a bug_entry is:
struct bug_entry {
signed int bug_addr_disp; // 4 bytes
unsigned short flags; // 2 bytes
< implicit padding > // 2 bytes
}
... with 8 bytes total, with 6 bytes of data and 2 bytes of trailing padding, requiring 4-byte alginment.
When we create a bug_entry in assembly, we align the start of the entry to 4 bytes, which implicitly handles padding for any prior entries. However, we do not align the end of the entry, and so when CONFIG_DEBUG_BUGVERBOSE=n, the final entry lacks the trailing padding bytes.
For the main kernel image this is not a problem as find_bug() doesn't depend on the trailing padding bytes when searching for entries:
for (bug = __start___bug_table; bug < __stop___bug_table; ++bug) if (bugaddr == bug_addr(bug)) return bug;
However for modules, module_bug_finalize() depends on the trailing bytes when calculating the number of entries:
mod->num_bugs = sechdrs[i].sh_size / sizeof(struct bug_entry);
... and as the last bug_entry lacks the necessary padding bytes, this entry will not be counted, e.g. in the case of a single entry:
sechdrs[i].sh_size == 6 sizeof(struct bug_entry) == 8; sechdrs[i].sh_size / sizeof(struct bug_entry) == 0;
Consequently module_find_bug() will miss the last bug_entry when it does:
for (i = 0; i < mod->num_bugs; ++i, ++bug) if (bugaddr == bug_addr(bug)) goto out;
... which can lead to a kenrel panic due to an unhandled bug.
This can be demonstrated with the following module:
static int __init buginit(void)
{
WARN(1, "hello\n");
return 0;
}
static void __exit bugexit(void)
{
}
module_init(buginit);
module_exit(bugexit);
MODULE_LICENSE("GPL");... which will trigger a kernel panic when loaded:
------------[ cut here ]------------ hello Unexpected kernel BRK exception at EL1 Internal error: BRK handler: 00000000f2000800 [#1] PREEMPT SMP Modules linked in: hello(O+) CPU: 0 PID: 50 Comm: insmod Tainted: G O 6.9.1 #8 Hardware name: linux,dummy-virt (DT) pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : buginit+0x18/0x1000 [hello] lr : buginit+0x18/0x1000 [hello] sp : ffff800080533ae0 x29: ffff800080533ae0 x28: 0000000000000000 x27: 0000000000000000 x26: ffffaba8c4e70510 x25: ffff800080533c30 x24: ffffaba8c4a28a58 x23: 0000000000000000 x22: 0000000000000000 x21: ffff3947c0eab3c0 x20: ffffaba8c4e3f000 x19: ffffaba846464000 x18: 0000000000000006 x17: 0000000000000000 x16: ffffaba8c2492834 x15: 0720072007200720 x14: 0720072007200720 x13: ffffaba8c49b27c8 x12: 0000000000000312 x11: 0000000000000106 x10: ffffaba8c4a0a7c8 x9 : ffffaba8c49b27c8 x8 : 00000000ffffefff x7 : ffffaba8c4a0a7c8 x6 : 80000000fffff000 x5 : 0000000000000107 x4 : 0000000000000000 x3 : 0000000000000000 x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff3947c0eab3c0 Call trace: buginit+0x18/0x1000 [hello] do_one_initcall+0x80/0x1c8 do_init_module+0x60/0x218 load_module+0x1ba4/0x1d70 __do_sys_init_module+0x198/0x1d0 __arm64_sys_init_module+0x1c/0x28 invoke_syscall+0x48/0x114 el0_svc_common.constprop.0+0x40/0xe0 do_el0_svc+0x1c/0x28 el0_svc+0x34/0xd8 el0t_64_sync_handler+0x120/0x12c el0t_64_sync+0x190/0x194 Code: d0ffffe0 910003fd 91000000 9400000b (d4210000) ---[ end trace 0000000000000000 ]--- Kernel panic - not syncing: BRK handler: Fatal exception
Fix this by always aligning the end of a bug_entry to 4 bytes, which is correct regardless of CONFIG_DEBUG_BUGVERBOSE.
--- arch/arm64/include/asm/asm-bug.h | 1 + 1 file changed, 1 insertion(+)
arch/arm64/include/asm/asm-bug.h +1 -0
@@ -28,6 +28,7 @@ 14470: .long 14471f - 14470b; \_BUGVERBOSE_LOCATION (__FILE__, __LINE__) \ .short flags; \ + .align 2; \ .popsection; \ 14471:#else
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 296/402 virtio: delete vq in vp_find_vqs_msix() when request_irq() fails
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiri Pirko <[email protected]>
[ Upstream commit 89875151fccdd024d571aa884ea97a0128b968b6 ]
When request_irq() fails, error path calls vp_del_vqs(). There, as vq is present in the list, free_irq() is called for the same vector. That causes following splat:
[ 0.414355] Trying to free already-free IRQ 27 [ 0.414403] WARNING: CPU: 1 PID: 1 at kernel/irq/manage.c:1899 free_irq+0x1a1/0x2d0 [ 0.414510] Modules linked in: [ 0.414540] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 6.9.0-rc4+ #27 [ 0.414540] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-1.fc39 04/01/2014 [ 0.414540] RIP: 0010:free_irq+0x1a1/0x2d0 [ 0.414540] Code: 1e 00 48 83 c4 08 48 89 e8 5b 5d 41 5c 41 5d 41 5e 41 5f c3 cc cc cc cc 90 8b 74 24 04 48 c7 c7 98 80 6c b1 e8 00 c9 f7 ff 90 <0f> 0b 90 90 48 89 ee 4c 89 ef e8 e0 20 b8 00 49 8b 47 40 48 8b 40 [ 0.414540] RSP: 0000:ffffb71480013ae0 EFLAGS: 00010086 [ 0.414540] RAX: 0000000000000000 RBX: ffffa099c2722000 RCX: 0000000000000000 [ 0.414540] RDX: 0000000000000000 RSI: ffffb71480013998 RDI: 0000000000000001 [ 0.414540] RBP: 0000000000000246 R08: 00000000ffffdfff R09: 0000000000000001 [ 0.414540] R10: 00000000ffffdfff R11: ffffffffb18729c0 R12: ffffa099c1c91760 [ 0.414540] R13: ffffa099c1c916a4 R14: ffffa099c1d2f200 R15: ffffa099c1c91600 [ 0.414540] FS: 0000000000000000(0000) GS:ffffa099fec40000(0000) knlGS:0000000000000000 [ 0.414540] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 0.414540] CR2: 0000000000000000 CR3: 0000000008e3e001 CR4: 0000000000370ef0 [ 0.414540] Call Trace: [ 0.414540] <TASK> [ 0.414540] ? __warn+0x80/0x120 [ 0.414540] ? free_irq+0x1a1/0x2d0 [ 0.414540] ? report_bug+0x164/0x190 [ 0.414540] ? handle_bug+0x3b/0x70 [ 0.414540] ? exc_invalid_op+0x17/0x70 [ 0.414540] ? asm_exc_invalid_op+0x1a/0x20 [ 0.414540] ? free_irq+0x1a1/0x2d0 [ 0.414540] vp_del_vqs+0xc1/0x220 [ 0.414540] vp_find_vqs_msix+0x305/0x470 [ 0.414540] vp_find_vqs+0x3e/0x1a0 [ 0.414540] vp_modern_find_vqs+0x1b/0x70 [ 0.414540] init_vqs+0x387/0x600 [ 0.414540] virtnet_probe+0x50a/0xc80 [ 0.414540] virtio_dev_probe+0x1e0/0x2b0 [ 0.414540] really_probe+0xc0/0x2c0 [ 0.414540] ? __pfx___driver_attach+0x10/0x10 [ 0.414540] __driver_probe_device+0x73/0x120 [ 0.414540] driver_probe_device+0x1f/0xe0 [ 0.414540] __driver_attach+0x88/0x180 [ 0.414540] bus_for_each_dev+0x85/0xd0 [ 0.414540] bus_add_driver+0xec/0x1f0 [ 0.414540] driver_register+0x59/0x100 [ 0.414540] ? __pfx_virtio_net_driver_init+0x10/0x10 [ 0.414540] virtio_net_driver_init+0x90/0xb0 [ 0.414540] do_one_initcall+0x58/0x230 [ 0.414540] kernel_init_freeable+0x1a3/0x2d0 [ 0.414540] ? __pfx_kernel_init+0x10/0x10 [ 0.414540] kernel_init+0x1a/0x1c0 [ 0.414540] ret_from_fork+0x31/0x50 [ 0.414540] ? __pfx_kernel_init+0x10/0x10 [ 0.414540] ret_from_fork_asm+0x1a/0x30 [ 0.414540] </TASK>
Fix this by calling deleting the current vq when request_irq() fails.
Message-Id: <[email protected]>
--- drivers/virtio/virtio_pci_common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/virtio/virtio_pci_common.c +3 -1
@@ -339,8 +339,10 @@ static int vp_find_vqs_msix(struct virtio_device *vdev, unsigned nvqs, vring_interrupt,0 , vp_dev->msix_names[msix_vec], vqs[i]); -if (err) +if (err) { +vp_del_vq (vqs[i]); goto error_find; + } }return 0 ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 297/402 riscv: stacktrace: Make walk_stackframe cross pt_regs frame
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guo Ren <[email protected]>
[ Upstream commit 7ecdadf7f8c659524f6b2aebf6be7bf619764d90 ]
The current walk_stackframe with FRAME_POINTER would stop unwinding at ret_from_exception:
BUG: sleeping function called from invalid context at kernel/locking/rwsem.c:1518 in_atomic(): 0, irqs_disabled(): 1, non_block: 0, pid: 1, name: init CPU: 0 PID: 1 Comm: init Not tainted 5.10.113-00021-g15c15974895c-dirty #192 Call Trace: [<ffffffe0002038c8>] walk_stackframe+0x0/0xee [<ffffffe000aecf48>] show_stack+0x32/0x4a [<ffffffe000af1618>] dump_stack_lvl+0x72/0x8e [<ffffffe000af1648>] dump_stack+0x14/0x1c [<ffffffe000239ad2>] ___might_sleep+0x12e/0x138 [<ffffffe000239aec>] __might_sleep+0x10/0x18 [<ffffffe000afe3fe>] down_read+0x22/0xa4 [<ffffffe000207588>] do_page_fault+0xb0/0x2fe [<ffffffe000201b80>] ret_from_exception+0x0/0xc
The optimization would help walk_stackframe cross the pt_regs frame and get more backtrace of debug info:
BUG: sleeping function called from invalid context at kernel/locking/rwsem.c:1518 in_atomic(): 0, irqs_disabled(): 1, non_block: 0, pid: 1, name: init CPU: 0 PID: 1 Comm: init Not tainted 5.10.113-00021-g15c15974895c-dirty #192 Call Trace: [<ffffffe0002038c8>] walk_stackframe+0x0/0xee [<ffffffe000aecf48>] show_stack+0x32/0x4a [<ffffffe000af1618>] dump_stack_lvl+0x72/0x8e [<ffffffe000af1648>] dump_stack+0x14/0x1c [<ffffffe000239ad2>] ___might_sleep+0x12e/0x138 [<ffffffe000239aec>] __might_sleep+0x10/0x18 [<ffffffe000afe3fe>] down_read+0x22/0xa4 [<ffffffe000207588>] do_page_fault+0xb0/0x2fe [<ffffffe000201b80>] ret_from_exception+0x0/0xc [<ffffffe000613c06>] riscv_intc_irq+0x1a/0x72 [<ffffffe000201b80>] ret_from_exception+0x0/0xc [<ffffffe00033f44a>] vma_link+0x54/0x160 [<ffffffe000341d7a>] mmap_region+0x2cc/0x4d0 [<ffffffe000342256>] do_mmap+0x2d8/0x3ac [<ffffffe000326318>] vm_mmap_pgoff+0x70/0xb8 [<ffffffe00032638a>] vm_mmap+0x2a/0x36 [<ffffffe0003cfdde>] elf_map+0x72/0x84 [<ffffffe0003d05f8>] load_elf_binary+0x69a/0xec8 [<ffffffe000376240>] bprm_execve+0x246/0x53a [<ffffffe00037786c>] kernel_execve+0xe8/0x124 [<ffffffe000aecdf2>] run_init_process+0xfa/0x10c [<ffffffe000aece16>] try_to_run_init_process+0x12/0x3c [<ffffffe000afa920>] kernel_init+0xb4/0xf8 [<ffffffe000201b80>] ret_from_exception+0x0/0xc
Here is the error injection test code for the above output:
drivers/irqchip/irq-riscv-intc.c:
static asmlinkage void riscv_intc_irq(struct pt_regs *regs)
{
unsigned long cause = regs->cause & ~CAUSE_IRQ_FLAG;+ u32 tmp; __get_user(tmp, (u32 *)0);
Stable-dep-of: a2a4d4a6a0bf ("riscv: stacktrace: fixed walk_stackframe()")
--- arch/riscv/kernel/entry.S | 3 ++- arch/riscv/kernel/stacktrace.c | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-)
arch/riscv/kernel/entry.S +2 -1
@@ -231,7 +231,7 @@ ret_from_syscall_rejected: andi t0, t0, _TIF_SYSCALL_WORK bnez t0, handle_syscall_trace_exit -ret_from_exception: +SYM_CODE_START_NOALIGN(ret_from_exception) REG_L s0, PT_STATUS(sp) csrc CSR_STATUS, SR_IE #ifdef CONFIG_TRACE_IRQFLAGS
@@ -245,6 +245,7 @@ ret_from_exception: andi s0, s0, SR_SPP #endif bnez s0, resume_kernel +SYM_CODE_END(ret_from_exception) resume_userspace: /* Interrupts must be disabled here so flags are checked atomically */
arch/riscv/kernel/stacktrace.c +9 -0
@@ -18,6 +18,8 @@ register unsigned long sp_in_global __asm__("sp");#ifdef CONFIG_FRAME_POINTER +extern asmlinkage void ret_from_exception(void); + void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,bool (*fn)(void *,unsigned long ),void *arg) {
@@ -62,6 +64,13 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs, fp = frame->fp; pc =ftrace_graph_ret_addr (current,NULL , frame->ra, &frame->ra); +if (pc == (unsigned long )ret_from_exception) { +if (unlikely (!__kernel_text_address (pc) || !fn (arg, pc))) +break ; + + pc = ((struct pt_regs *)sp)->epc; + fp = ((struct pt_regs *)sp)->s0; + } } }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 298/402 riscv: stacktrace: fixed walk_stackframe()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Bystrin <[email protected]>
[ Upstream commit a2a4d4a6a0bf5eba66f8b0b32502cc20d82715a0 ]
If the load access fault occures in a leaf function (with CONFIG_FRAME_POINTER=y), when wrong stack trace will be displayed:
[<ffffffff804853c2>] regmap_mmio_read32le+0xe/0x1c ---[ end trace 0000000000000000 ]---
Registers dump:
ra 0xffffffff80485758 <regmap_mmio_read+36>
sp 0xffffffc80200b9a0
fp 0xffffffc80200b9b0
pc 0xffffffff804853ba <regmap_mmio_read32le+6>Stack dump:
0xffffffc80200b9a0: 0xffffffc80200b9e0 0xffffffc80200b9e0
0xffffffc80200b9b0: 0xffffffff8116d7e8 0x0000000000000100
0xffffffc80200b9c0: 0xffffffd8055b9400 0xffffffd8055b9400
0xffffffc80200b9d0: 0xffffffc80200b9f0 0xffffffff8047c526
0xffffffc80200b9e0: 0xffffffc80200ba30 0xffffffff8047fe9aThe assembler dump of the function preambula:
add sp,sp,-16
sd s0,8(sp)
add s0,sp,16In the fist stack frame, where ra is not stored on the stack we can observe:
0(sp) 8(sp)
.---------------------------------------------.
sp->| frame->fp | frame->ra (saved fp) |
|---------------------------------------------|
fp->| .... | .... |
|---------------------------------------------|
| | |and in the code check is performed:
if (regs && (regs->epc == pc) && (frame->fp & 0x7))
I see no reason to check frame->fp value at all, because it is can be uninitialized value on the stack. A better way is to check frame->ra to be an address on the stack. After the stacktrace shows as expect:
[<ffffffff804853c2>] regmap_mmio_read32le+0xe/0x1c [<ffffffff80485758>] regmap_mmio_read+0x24/0x52 [<ffffffff8047c526>] _regmap_bus_reg_read+0x1a/0x22 [<ffffffff8047fe9a>] _regmap_read+0x5c/0xea [<ffffffff80480376>] _regmap_update_bits+0x76/0xc0 ... ---[ end trace 0000000000000000 ]---
As pointed by Samuel Holland it is incorrect to remove check of the stackframe entirely.
Changes since v2 [2]:
- Add accidentally forgotten curly brace
Changes since v1 [1]:
- Instead of just dropping frame->fp check, replace it with validation of frame->ra, which should be a stack address.
- Move frame pointer validation into the separate function.
[1] https://lore.kernel.org/linux-riscv/[email protected]/
[2] https://lore.kernel.org/linux-riscv/[email protected]/
--- arch/riscv/kernel/stacktrace.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-)
arch/riscv/kernel/stacktrace.c +14 -6
@@ -20,6 +20,16 @@ register unsigned long sp_in_global __asm__("sp"); extern asmlinkage void ret_from_exception(void); +static inline int fp_is_valid (unsigned long fp,unsigned long sp) +{ +unsigned long low, high; + + low = sp +sizeof (struct stackframe ); + high =ALIGN (sp,THREAD_SIZE ); + +return !(fp < low || fp > high || fp &0x07 ); +} + void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,bool (*fn)(void *,unsigned long ),void *arg) {
@@ -43,21 +53,19 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs, }for (;;) { -unsigned long low, high;struct stackframe *frame;if (unlikely (!__kernel_text_address (pc) || (level++ >=0 && !fn (arg, pc))))break ; -/* Validate frame pointer */ - low = sp +sizeof (struct stackframe ); - high =ALIGN (sp,THREAD_SIZE ); -if (unlikely (fp < low || fp > high || fp &0x7 )) +if (unlikely (!fp_is_valid (fp, sp)))break ; +/* Unwind stack frame */ frame = (struct stackframe *)fp -1 ; sp = fp; -if (regs && (regs->epc == pc) && (frame->fp &0x7 )) { +if (regs && (regs->epc == pc) &&fp_is_valid (frame->ra, sp)) { +/* We hit function where ra is not saved on the stack */ fp = frame->ra; pc = regs->ra; }else {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 299/402 net: fec: avoid lock evasion when reading pps_enable
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Fang <[email protected]>
[ Upstream commit 3b1c92f8e5371700fada307cc8fd2c51fa7bc8c1 ]
The assignment of pps_enable is protected by tmreg_lock, but the read operation of pps_enable is not. So the Coverity tool reports a lock evasion warning which may cause data race to occur when running in a multithread environment. Although this issue is almost impossible to occur, we'd better fix it, at least it seems more logically reasonable, and it also prevents Coverity from continuing to issue warnings.
--- drivers/net/ethernet/freescale/fec_ptp.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/net/ethernet/freescale/fec_ptp.c +8 -6
@@ -103,14 +103,13 @@ static int fec_ptp_enable_pps(struct fec_enet_private *fep, uint enable)u64 ns; val =0 ; -if (fep->pps_enable == enable) -return 0 ; - - fep->pps_channel =DEFAULT_PPS_CHANNEL ; - fep->reload_period =PPS_OUPUT_RELOAD_PERIOD ; -spin_lock_irqsave (&fep->tmreg_lock, flags); +if (fep->pps_enable == enable) { +spin_unlock_irqrestore (&fep->tmreg_lock, flags); +return 0 ; + } +if (enable) {/* clear capture or output compare interrupt status if have. */
@@ -441,6 +440,9 @@ static int fec_ptp_enable(struct ptp_clock_info *ptp,int ret =0 ;if (rq->type ==PTP_CLK_REQ_PPS ) { + fep->pps_channel =DEFAULT_PPS_CHANNEL ; + fep->reload_period =PPS_OUPUT_RELOAD_PERIOD ; + ret =fec_ptp_enable_pps (fep, on);return ret;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 300/402 tls: fix missing memory barrier in tls_init
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dae R. Jeong <[email protected]>
[ Upstream commit 91e61dd7a0af660408e87372d8330ceb218be302 ]
In tls_init(), a write memory barrier is missing, and store-store reordering may cause NULL dereference in tls_{setsockopt,getsockopt}.
CPU0 CPU1
----- -----
// In tls_init()
// In tls_ctx_create()
ctx = kzalloc()ctx->sk_proto = READ_ONCE(sk->sk_prot) -(1)
// In update_sk_prot()WRITE_ONCE(sk->sk_prot, tls_prots) -(2)
// In sock_common_setsockopt()
READ_ONCE(sk->sk_prot)->setsockopt()
// In tls_{setsockopt,getsockopt}()
ctx->sk_proto->setsockopt() -(3)In the above scenario, when (1) and (2) are reordered, (3) can observe the NULL value of ctx->sk_proto, causing NULL dereference.
To fix it, we rely on rcu_assign_pointer() which implies the release barrier semantic. By moving rcu_assign_pointer() after ctx->sk_proto is initialized, we can ensure that ctx->sk_proto are visible when changing sk->sk_prot.
--- net/tls/tls_main.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
net/tls/tls_main.c +9 -1
@@ -636,9 +636,17 @@ struct tls_context *tls_ctx_create(struct sock *sk)return NULL ;mutex_init (&ctx->tx_lock); -rcu_assign_pointer (icsk->icsk_ulp_data, ctx); ctx->sk_proto =READ_ONCE (sk->sk_prot); ctx->sk = sk; +/* Release semantic of rcu_assign_pointer() ensures that +* ctx->sk_proto is visible before changing sk->sk_prot in +* update_sk_prot(), and prevents reading uninitialized value in +* tls_{getsockopt, setsockopt}. Note that we do not need a +* read barrier in tls_{getsockopt,setsockopt} as there is an +* address dependency between sk->sk_proto->{getsockopt,setsockopt} +* and ctx->sk_proto. +*/ +rcu_assign_pointer (icsk->icsk_ulp_data, ctx);return ctx; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 301/402 nfc: nci: Fix kcov check in nci_rx_work()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tetsuo Handa <[email protected]>
[ Upstream commit 19e35f24750ddf860c51e51c68cf07ea181b4881 ]
Commit 7e8cdc97148c ("nfc: Add KCOV annotations") added kcov_remote_start_common()/kcov_remote_stop() pair into nci_rx_work(), with an assumption that kcov_remote_stop() is called upon continue of the for loop. But commit d24b03535e5e ("nfc: nci: Fix uninit-value in nci_dev_up and nci_ntf_packet") forgot to call kcov_remote_stop() before break of the for loop.
Stable-dep-of: 6671e352497c ("nfc: nci: Fix handling of zero-length payload packets in nci_rx_work()")
--- net/nfc/nci/core.c | 1 + 1 file changed, 1 insertion(+)
net/nfc/nci/core.c +1 -0
@@ -1531,6 +1531,7 @@ static void nci_rx_work(struct work_struct *work)if (!nci_valid_size (skb)) {kfree_skb (skb); +kcov_remote_stop ();break ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 302/402 nfc: nci: Fix handling of zero-length payload packets in nci_rx_work()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ryosuke Yasuoka <[email protected]>
[ Upstream commit 6671e352497ca4bb07a96c48e03907065ff77d8a ]
When nci_rx_work() receives a zero-length payload packet, it should not discard the packet and exit the loop. Instead, it should continue processing subsequent packets.
--- net/nfc/nci/core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
net/nfc/nci/core.c +1 -2
@@ -1531,8 +1531,7 @@ static void nci_rx_work(struct work_struct *work)if (!nci_valid_size (skb)) {kfree_skb (skb); -kcov_remote_stop (); -break ; +continue ; }/* Process frame */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 303/402 ice: Interpret .set_channels() input differently
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Larysa Zaremba <[email protected]>
[ Upstream commit 05d6f442f31f901d27dbc64fd504a8ec7d5013de ]
A bug occurs because a safety check guarding AF_XDP-related queues in ethnl_set_channels(), does not trigger. This happens, because kernel and ice driver interpret the ethtool command differently.
How the bug occurs:
1. ethtool -l <IFNAME> -> combined: 40
2. Attach AF_XDP to queue 30
3. ethtool -L <IFNAME> rx 15 tx 15
combined number is not specified, so command becomes {rx_count = 15, tx_count = 15, combined_count = 40}.
4. ethnl_set_channels checks, if there are any AF_XDP of queues from the new (combined_count + rx_count) to the old one, so from 55 to 40, check does not trigger.
5. ice interprets rx 15 tx 15 as 15 combined channels and deletes the queue that AF_XDP is attached to.
Interpret the command in a way that is more consistent with ethtool manual [0] (--show-channels and --set-channels).
Considering that in the ice driver only the difference between RX and TX queues forms dedicated channels, change the correct way to set number of channels to:
ethtool -L <IFNAME> combined 10 /* For symmetric queues */ ethtool -L <IFNAME> combined 8 tx 2 rx 0 /* For asymmetric queues */
[0] https://man7.org/linux/man-pages/man8/ethtool.8.html
--- drivers/net/ethernet/intel/ice/ice_ethtool.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-)
drivers/net/ethernet/intel/ice/ice_ethtool.c +2 -17
@@ -3394,7 +3394,6 @@ static int ice_set_channels(struct net_device *dev, struct ethtool_channels *ch)struct ice_pf *pf = vsi->back;int new_rx =0 , new_tx =0 ;bool locked = false; -u32 curr_combined;int ret =0 ;/* do not support changing channels in Safe Mode */
@@ -3411,22 +3410,8 @@ static int ice_set_channels(struct net_device *dev, struct ethtool_channels *ch)return -EOPNOTSUPP ; } - curr_combined =ice_get_combined_cnt (vsi); - -/* these checks are for cases where user didn't specify a particular -* value on cmd line but we get non-zero value anyway via -* get_channels(); look at ethtool.c in ethtool repository (the user -* space part), particularly, do_schannels() routine -*/ -if (ch->rx_count == vsi->num_rxq - curr_combined) - ch->rx_count =0 ; -if (ch->tx_count == vsi->num_txq - curr_combined) - ch->tx_count =0 ; -if (ch->combined_count == curr_combined) - ch->combined_count =0 ; - -if (!(ch->combined_count || (ch->rx_count && ch->tx_count))) { -netdev_err (dev,"Please specify at least 1 Rx and 1 Tx channel\n" ); +if (ch->rx_count && ch->tx_count) { +netdev_err (dev,"Dedicated RX or TX channels cannot be used simultaneously\n" );return -EINVAL ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 304/402 netfilter: nfnetlink_queue: acquire rcu_read_lock() in instance_destroy_rcu()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit dc21c6cc3d6986d938efbf95de62473982c98dec ]
syzbot reported that nf_reinject() could be called without rcu_read_lock() :
WARNING: suspicious RCU usage 6.9.0-rc7-syzkaller-02060-g5c1672705a1a #0 Not tainted
net/netfilter/nfnetlink_queue.c:263 suspicious rcu_dereference_check() usage!
other info that might help us debug this:
rcu_scheduler_active = 2, debug_locks = 1
2 locks held by syz-executor.4/13427:
#0: ffffffff8e334f60 (rcu_callback){....}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #0: ffffffff8e334f60 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2190 [inline] #0: ffffffff8e334f60 (rcu_callback){....}-{0:0}, at: rcu_core+0xa86/0x1830 kernel/rcu/tree.c:2471 #1: ffff88801ca92958 (&inst->lock){+.-.}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:356 [inline] #1: ffff88801ca92958 (&inst->lock){+.-.}-{2:2}, at: nfqnl_flush net/netfilter/nfnetlink_queue.c:405 [inline] #1: ffff88801ca92958 (&inst->lock){+.-.}-{2:2}, at: instance_destroy_rcu+0x30/0x220 net/netfilter/nfnetlink_queue.c:172
stack backtrace: CPU: 0 PID: 13427 Comm: syz-executor.4 Not tainted 6.9.0-rc7-syzkaller-02060-g5c1672705a1a #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: <IRQ> __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 lockdep_rcu_suspicious+0x221/0x340 kernel/locking/lockdep.c:6712 nf_reinject net/netfilter/nfnetlink_queue.c:323 [inline] nfqnl_reinject+0x6ec/0x1120 net/netfilter/nfnetlink_queue.c:397 nfqnl_flush net/netfilter/nfnetlink_queue.c:410 [inline] instance_destroy_rcu+0x1ae/0x220 net/netfilter/nfnetlink_queue.c:172 rcu_do_batch kernel/rcu/tree.c:2196 [inline] rcu_core+0xafd/0x1830 kernel/rcu/tree.c:2471 handle_softirqs+0x2d6/0x990 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu+0xf4/0x1c0 kernel/softirq.c:637 irq_exit_rcu+0x9/0x30 kernel/softirq.c:649 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043 </IRQ> <TASK>
--- net/netfilter/nfnetlink_queue.c | 2 ++ 1 file changed, 2 insertions(+)
net/netfilter/nfnetlink_queue.c +2 -0
@@ -167,7 +167,9 @@ instance_destroy_rcu(struct rcu_head *head) struct nfqnl_instance *inst = container_of(head, struct nfqnl_instance, rcu); +rcu_read_lock ();nfqnl_flush (inst,NULL ,0 ); +rcu_read_unlock ();kfree (inst);module_put (THIS_MODULE ); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 305/402 netfilter: nft_payload: restore vlan q-in-q match support
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <[email protected]>
[ Upstream commit aff5c01fa1284d606f8e7cbdaafeef2511bb46c1 ]
Revert f6ae9f120dad ("netfilter: nft_payload: add C-VLAN support").
f41f72d09ee1 ("netfilter: nft_payload: simplify vlan header handling") already allows to match on inner vlan tags by subtract the vlan header size to the payload offset which has been popped and stored in skbuff metadata fields.
--- net/netfilter/nft_payload.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-)
net/netfilter/nft_payload.c +7 -16
@@ -45,36 +45,27 @@ nft_payload_copy_vlan(u32 *d, const struct sk_buff *skb, u8 offset, u8 len)int mac_off =skb_mac_header (skb) - skb->data;u8 *vlanh, *dst_u8 = (u8 *) d;struct vlan_ethhdr veth; -u8 vlan_hlen =0 ; - -if ((skb->protocol ==htons (ETH_P_8021AD ) || - skb->protocol ==htons (ETH_P_8021Q )) && - offset >=VLAN_ETH_HLEN && offset <VLAN_ETH_HLEN +VLAN_HLEN ) - vlan_hlen +=VLAN_HLEN ; vlanh = (u8 *) &veth; -if (offset <VLAN_ETH_HLEN + vlan_hlen) { +if (offset <VLAN_ETH_HLEN ) {u8 ethlen = len; -if (vlan_hlen && -skb_copy_bits (skb, mac_off, &veth,VLAN_ETH_HLEN ) <0 ) -return false; -else if (!nft_payload_rebuild_vlan_hdr (skb, mac_off, &veth)) +if (!nft_payload_rebuild_vlan_hdr (skb, mac_off, &veth))return false; -if (offset + len >VLAN_ETH_HLEN + vlan_hlen) - ethlen -= offset + len -VLAN_ETH_HLEN - vlan_hlen; +if (offset + len >VLAN_ETH_HLEN ) + ethlen -= offset + len -VLAN_ETH_HLEN ; -memcpy (dst_u8, vlanh + offset - vlan_hlen, ethlen); +memcpy (dst_u8, vlanh + offset, ethlen); len -= ethlen;if (len ==0 )return true; dst_u8 += ethlen; - offset =ETH_HLEN + vlan_hlen; + offset =ETH_HLEN ; }else { - offset -=VLAN_HLEN + vlan_hlen; + offset -=VLAN_HLEN ; }return skb_copy_bits (skb, offset + mac_off, dst_u8, len) ==0 ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 306/402 spi: Dont mark message DMA mapped when no transfer in it is
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Shevchenko <[email protected]>
[ Upstream commit 9f788ba457b45b0ce422943fcec9fa35c4587764 ]
There is no need to set the DMA mapped flag of the message if it has no mapped transfers. Moreover, it may give the code a chance to take the wrong paths, i.e. to exercise DMA related APIs on unmapped data. Make __spi_map_msg() to bail earlier on the above mentioned cases.
--- drivers/spi/spi.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/spi/spi.c +4 -0
@@ -1047,6 +1047,7 @@ static int __spi_map_msg(struct spi_controller *ctlr, struct spi_message *msg)else rx_dev = ctlr->dev.parent; + ret = -ENOMSG ;list_for_each_entry (xfer, &msg->transfers, transfer_list) {if (!ctlr->can_dma (ctlr, msg->spi, xfer))continue ;
@@ -1070,6 +1071,9 @@ static int __spi_map_msg(struct spi_controller *ctlr, struct spi_message *msg) } } } +/* No transfer has been mapped, bail out with success */ +if (ret) +return 0 ; ctlr->cur_msg_mapped = true;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 307/402 dma-mapping: benchmark: fix node id validation
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fedor Pchelkin <[email protected]>
[ Upstream commit 1ff05e723f7ca30644b8ec3fb093f16312e408ad ]
While validating node ids in map_benchmark_ioctl(), node_possible() may be provided with invalid argument outside of [0,MAX_NUMNODES-1] range leading to:
BUG: KASAN: wild-memory-access in map_benchmark_ioctl (kernel/dma/map_benchmark.c:214) Read of size 8 at addr 1fffffff8ccb6398 by task dma_map_benchma/971 CPU: 7 PID: 971 Comm: dma_map_benchma Not tainted 6.9.0-rc6 #37 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) Call Trace: <TASK>
dump_stack_lvl (lib/dump_stack.c:117)kasan_report (mm/kasan/report.c:603)kasan_check_range (mm/kasan/generic.c:189)variable_test_bit (arch/x86/include/asm/bitops.h:227) [inline] arch_test_bit (arch/x86/include/asm/bitops.h:239) [inline] _test_bit at (include/asm-generic/bitops/instrumented-non-atomic.h:142) [inline] node_state (include/linux/nodemask.h:423) [inline] map_benchmark_ioctl (kernel/dma/map_benchmark.c:214) full_proxy_unlocked_ioctl (fs/debugfs/file.c:333)__x64_sys_ioctl (fs/ioctl.c:890)do_syscall_64 (arch/x86/entry/common.c:83) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130)
Compare node ids with sane bounds first. NUMA_NO_NODE is considered a special valid case meaning that benchmarking kthreads won't be bound to a cpuset of a given node.
Found by Linux Verification Center (linuxtesting.org).
--- kernel/dma/map_benchmark.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/dma/map_benchmark.c +2 -1
@@ -231,7 +231,8 @@ static long map_benchmark_ioctl(struct file *file, unsigned int cmd, }if (map->bparam.node !=NUMA_NO_NODE && - !node_possible (map->bparam.node)) { + (map->bparam.node <0 || map->bparam.node >=MAX_NUMNODES || + !node_possible (map->bparam.node))) {pr_err ("invalid numa node\n" );return -EINVAL ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 308/402 dma-mapping: benchmark: handle NUMA_NO_NODE correctly
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fedor Pchelkin <[email protected]>
[ Upstream commit e64746e74f717961250a155e14c156616fcd981f ]
cpumask_of_node() can be called for NUMA_NO_NODE inside do_map_benchmark() resulting in the following sanitizer report:
UBSAN: array-index-out-of-bounds in ./arch/x86/include/asm/topology.h:72:28 index -1 is out of range for type 'cpumask [64][1]' CPU: 1 PID: 990 Comm: dma_map_benchma Not tainted 6.9.0-rc6 #29 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) Call Trace: <TASK>
dump_stack_lvl (lib/dump_stack.c:117)ubsan_epilogue (lib/ubsan.c:232) __ubsan_handle_out_of_bounds (lib/ubsan.c:429) cpumask_of_node (arch/x86/include/asm/topology.h:72) [inline] do_map_benchmark (kernel/dma/map_benchmark.c:104) map_benchmark_ioctl (kernel/dma/map_benchmark.c:246) full_proxy_unlocked_ioctl (fs/debugfs/file.c:333) __x64_sys_ioctl (fs/ioctl.c:890)do_syscall_64 (arch/x86/entry/common.c:83) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130)
Use cpumask_of_node() in place when binding a kernel thread to a cpuset of a particular node.
Note that the provided node id is checked inside map_benchmark_ioctl(). It's just a NUMA_NO_NODE case which is not handled properly later.
Found by Linux Verification Center (linuxtesting.org).
--- kernel/dma/map_benchmark.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
kernel/dma/map_benchmark.c +1 -2
@@ -124,7 +124,6 @@ static int do_map_benchmark(struct map_benchmark_data *map)struct task_struct **tsk;int threads = map->bparam.threads;int node = map->bparam.node; -const cpumask_t *cpu_mask =cpumask_of_node (node);u64 loops;int ret =0 ;int i;
@@ -145,7 +144,7 @@ static int do_map_benchmark(struct map_benchmark_data *map) }if (node !=NUMA_NO_NODE ) -kthread_bind_mask (tsk[i], cpu_mask); +kthread_bind_mask (tsk[i],cpumask_of_node (node)); }/* clear the old value in the previous benchmark */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 309/402 nvmet: fix ns enable/disable possible hang
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sagi Grimberg <[email protected]>
[ Upstream commit f97914e35fd98b2b18fb8a092e0a0799f73afdfe ]
When disabling an nvmet namespace, there is a period where the subsys->lock is released, as the ns disable waits for backend IO to complete, and the ns percpu ref to be properly killed. The original intent was to avoid taking the subsystem lock for a prolong period as other processes may need to acquire it (for example new incoming connections).
However, it opens up a window where another process may come in and enable the ns, (re)intiailizing the ns percpu_ref, causing the disable sequence to hang.
Solve this by taking the global nvmet_config_sem over the entire configfs enable/disable sequence.
--- drivers/nvme/target/configfs.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/nvme/target/configfs.c +8 -0
@@ -530,10 +530,18 @@ static ssize_t nvmet_ns_enable_store(struct config_item *item,if (strtobool (page, &enable))return -EINVAL ; +/* +* take a global nvmet_config_sem because the disable routine has a +* window where it releases the subsys-lock, giving a chance to +* a parallel enable to concurrently execute causing the disable to +* have a misaccounting of the ns percpu_ref. +*/ +down_write (&nvmet_config_sem);if (enable) ret =nvmet_ns_enable (ns);else nvmet_ns_disable (ns); +up_write (&nvmet_config_sem);return ret ? ret : count; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 310/402 net: phy: micrel: set soft_reset callback to genphy_soft_reset for KSZ8061
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathieu Othacehe <[email protected]>
[ Upstream commit 128d54fbcb14b8717ecf596d3dbded327b9980b3 ]
Following a similar reinstate for the KSZ8081 and KSZ9031.
Older kernels would use the genphy_soft_reset if the PHY did not implement a .soft_reset.
The KSZ8061 errata described here:
https://ww1.microchip.com/downloads/en/DeviceDoc/KSZ8061-Errata-DS80000688B.pdf
and worked around with 232ba3a51c ("net: phy: Micrel KSZ8061: link failure after cable connect") is back again without this soft reset.
--- drivers/net/phy/micrel.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/phy/micrel.c +1 -0
@@ -1669,6 +1669,7 @@ static struct phy_driver ksphy_driver[] = { .phy_id_mask = MICREL_PHY_ID_MASK,/* PHY_BASIC_FEATURES */ .config_init = ksz8061_config_init, + .soft_reset = genphy_soft_reset, .config_intr = kszphy_config_intr, .handle_interrupt = kszphy_handle_interrupt, .suspend = genphy_suspend,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 311/402 net/mlx5e: Fix IPsec tunnel mode offload feature check
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rahul Rameshbabu <[email protected]>
[ Upstream commit 9a52f6d44f4521773b4699b4ed34b8e21d5a175c ]
Remove faulty check disabling checksum offload and GSO for offload of simple IPsec tunnel L4 traffic. Comment previously describing the deleted code incorrectly claimed the check prevented double tunnel (or three layers of ip headers).
--- .../mellanox/mlx5/core/en_accel/ipsec_rxtx.h | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.h +5 -12
@@ -105,18 +105,11 @@ mlx5e_ipsec_feature_check(struct sk_buff *skb, netdev_features_t features)if (!x || !x->xso.offload_handle) goto out_disable; -if (xo->inner_ipproto) { -/* Cannot support tunnel packet over IPsec tunnel mode -* because we cannot offload three IP header csum -*/ -if (x->props.mode ==XFRM_MODE_TUNNEL ) - goto out_disable; - -/* Only support UDP or TCP L4 checksum */ -if (xo->inner_ipproto !=IPPROTO_UDP && - xo->inner_ipproto !=IPPROTO_TCP ) - goto out_disable; - } +/* Only support UDP or TCP L4 checksum */ +if (xo->inner_ipproto && + xo->inner_ipproto !=IPPROTO_UDP && + xo->inner_ipproto !=IPPROTO_TCP ) + goto out_disable;return features;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 312/402 net/mlx5e: Use rx_missed_errors instead of rx_dropped for reporting buffer exhaustion
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Carolina Jubran <[email protected]>
[ Upstream commit 5c74195d5dd977e97556e6fa76909b831c241230 ]
Previously, the driver incorrectly used rx_dropped to report device buffer exhaustion.
According to the documentation, rx_dropped should not be used to count packets dropped due to buffer exhaustion, which is the purpose of rx_missed_errors.
Use rx_missed_errors as intended for counting packets dropped due to buffer exhaustion.
--- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +1 -1
@@ -3185,7 +3185,7 @@ mlx5e_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats)mlx5e_fold_sw_stats64 (priv, stats); } - stats->rx_dropped = priv->stats.qcnt.rx_out_of_buffer; + stats->rx_missed_errors = priv->stats.qcnt.rx_out_of_buffer; stats->rx_length_errors = PPORT_802_3_GET(pstats, a_in_range_length_errors) +
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 313/402 dma-buf/sw-sync: dont enable IRQ from sync_print_obj()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tetsuo Handa <[email protected]>
[ Upstream commit b794918961516f667b0c745aebdfebbb8a98df39 ]
Since commit a6aa8fca4d79 ("dma-buf/sw-sync: Reduce irqsave/irqrestore from known context") by error replaced spin_unlock_irqrestore() with spin_unlock_irq() for both sync_debugfs_show() and sync_print_obj() despite sync_print_obj() is called from sync_debugfs_show(), lockdep complains inconsistent lock state warning.
Use plain spin_{lock,unlock}() for sync_print_obj(), for sync_debugfs_show() is already using spin_{lock,unlock}_irq().
--- drivers/dma-buf/sync_debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/dma-buf/sync_debug.c +2 -2
@@ -110,12 +110,12 @@ static void sync_print_obj(struct seq_file *s, struct sync_timeline *obj)seq_printf (s,"%s: %d\n" , obj->name, obj->value); -spin_lock_irq (&obj->lock); +spin_lock (&obj->lock);/* Caller already disabled IRQ. */ list_for_each (pos, &obj->pt_list) { struct sync_pt *pt = container_of(pos, struct sync_pt, link);sync_print_fence (s, &pt->base, false); } -spin_unlock_irq (&obj->lock); +spin_unlock (&obj->lock); } static void sync_print_sync_file(struct seq_file *s,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 314/402 bpf: Fix potential integer overflow in resolve_btfids
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Friedrich Vock <[email protected]>
[ Upstream commit 44382b3ed6b2787710c8ade06c0e97f5970a47c8 ]
err is a 32-bit integer, but elf_update returns an off_t, which is 64-bit at least on 64-bit platforms. If symbols_patch is called on a binary between 2-4GB in size, the result will be negative when cast to a 32-bit integer, which the code assumes means an error occurred. This can wrongly trigger build failures when building very large kernel images.
--- tools/bpf/resolve_btfids/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/bpf/resolve_btfids/main.c +1 -1
@@ -643,7 +643,7 @@ static int sets_patch(struct object *obj)static int symbols_patch (struct object *obj) { -int err; +off_t err; if (__symbols_patch(obj, &obj->structs) || __symbols_patch(obj, &obj->unions) ||
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 315/402 enic: Validate length of nl attributes in enic_set_vf_port
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Roded Zats <[email protected]>
[ Upstream commit e8021b94b0412c37bcc79027c2e382086b6ce449 ]
enic_set_vf_port assumes that the nl attribute IFLA_PORT_PROFILE is of length PORT_PROFILE_MAX and that the nl attributes IFLA_PORT_INSTANCE_UUID, IFLA_PORT_HOST_UUID are of length PORT_UUID_MAX. These attributes are validated (in the function do_setlink in rtnetlink.c) using the nla_policy ifla_port_policy. The policy defines IFLA_PORT_PROFILE as NLA_STRING, IFLA_PORT_INSTANCE_UUID as NLA_BINARY and IFLA_PORT_HOST_UUID as NLA_STRING. That means that the length validation using the policy is for the max size of the attributes and not on exact size so the length of these attributes might be less than the sizes that enic_set_vf_port expects. This might cause an out of bands
read access in the memcpys of the data of these
attributes in enic_set_vf_port.
--- drivers/net/ethernet/cisco/enic/enic_main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/net/ethernet/cisco/enic/enic_main.c +12 -0
@@ -1117,18 +1117,30 @@ static int enic_set_vf_port(struct net_device *netdev, int vf, pp->request =nla_get_u8 (port[IFLA_PORT_REQUEST ]);if (port[IFLA_PORT_PROFILE ]) { +if (nla_len (port[IFLA_PORT_PROFILE ]) !=PORT_PROFILE_MAX ) { +memcpy (pp, &prev_pp,sizeof (*pp)); +return -EINVAL ; + } pp->set |=ENIC_SET_NAME ;memcpy (pp->name,nla_data (port[IFLA_PORT_PROFILE ]),PORT_PROFILE_MAX ); }if (port[IFLA_PORT_INSTANCE_UUID ]) { +if (nla_len (port[IFLA_PORT_INSTANCE_UUID ]) !=PORT_UUID_MAX ) { +memcpy (pp, &prev_pp,sizeof (*pp)); +return -EINVAL ; + } pp->set |=ENIC_SET_INSTANCE ;memcpy (pp->instance_uuid,nla_data (port[IFLA_PORT_INSTANCE_UUID ]),PORT_UUID_MAX ); }if (port[IFLA_PORT_HOST_UUID ]) { +if (nla_len (port[IFLA_PORT_HOST_UUID ]) !=PORT_UUID_MAX ) { +memcpy (pp, &prev_pp,sizeof (*pp)); +return -EINVAL ; + } pp->set |=ENIC_SET_HOST ;memcpy (pp->host_uuid,nla_data (port[IFLA_PORT_HOST_UUID ]),PORT_UUID_MAX );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 316/402 net: usb: smsc95xx: fix changing LED_SEL bit value updated from EEPROM
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Parthiban Veerasooran <[email protected]>
[ Upstream commit 52a2f0608366a629d43dacd3191039c95fef74ba ]
LED Select (LED_SEL) bit in the LED General Purpose IO Configuration register is used to determine the functionality of external LED pins (Speed Indicator, Link and Activity Indicator, Full Duplex Link Indicator). The default value for this bit is 0 when no EEPROM is present. If a EEPROM is present, the default value is the value of the LED Select bit in the Configuration Flags of the EEPROM. A USB Reset or Lite Reset (LRST) will cause this bit to be restored to the image value last loaded from EEPROM, or to be set to 0 if no EEPROM is present.
While configuring the dual purpose GPIO/LED pins to LED outputs in the LED General Purpose IO Configuration register, the LED_SEL bit is changed as 0 and resulting the configured value from the EEPROM is cleared. The issue is fixed by using read-modify-write approach.
--- drivers/net/usb/smsc95xx.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/net/usb/smsc95xx.c +7 -4
@@ -842,7 +842,7 @@ static int smsc95xx_start_rx_path(struct usbnet *dev, int in_pm)static int smsc95xx_reset (struct usbnet *dev) {struct smsc95xx_priv *pdata = dev->driver_priv; -u32 read_buf, write_buf, burst_cap; +u32 read_buf, burst_cap;int ret =0 , timeout;netif_dbg (dev, ifup, dev->net,"entering smsc95xx_reset\n" );
@@ -984,10 +984,13 @@ static int smsc95xx_reset(struct usbnet *dev)return ret;netif_dbg (dev, ifup, dev->net,"ID_REV = 0x%08x\n" , read_buf); + ret =smsc95xx_read_reg (dev,LED_GPIO_CFG , &read_buf); +if (ret <0 ) +return ret;/* Configure GPIO pins as LED outputs */ - write_buf =LED_GPIO_CFG_SPD_LED |LED_GPIO_CFG_LNK_LED | -LED_GPIO_CFG_FDX_LED ; - ret =smsc95xx_write_reg (dev,LED_GPIO_CFG , write_buf); + read_buf |=LED_GPIO_CFG_SPD_LED |LED_GPIO_CFG_LNK_LED | +LED_GPIO_CFG_FDX_LED ; + ret =smsc95xx_write_reg (dev,LED_GPIO_CFG , read_buf);if (ret <0 )return ret;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 317/402 bpf: Allow delete from sockmap/sockhash only if update is allowed
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jakub Sitnicki <[email protected]>
[ Upstream commit 98e948fb60d41447fd8d2d0c3b8637fc6b6dc26d ]
We have seen an influx of syzkaller reports where a BPF program attached to a tracepoint triggers a locking rule violation by performing a map_delete on a sockmap/sockhash.
We don't intend to support this artificial use scenario. Extend the existing verifier allowed-program-type check for updating sockmap/sockhash to also cover deleting from a map.
Quoted 1 line
From now on only BPF programs which were previously allowed to update
sockmap/sockhash can delete from these map types.
--- kernel/bpf/verifier.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
kernel/bpf/verifier.c +7 -3
@@ -5568,7 +5568,8 @@ static bool may_update_sockmap(struct bpf_verifier_env *env, int func_id)enum bpf_attach_type eatype = env->prog->expected_attach_type;enum bpf_prog_type type =resolve_prog_type (env->prog); -if (func_id != BPF_FUNC_map_update_elem) +if (func_id != BPF_FUNC_map_update_elem && + func_id != BPF_FUNC_map_delete_elem)return false;/* It's not possible to get access to a locked struct sock in these
@@ -5579,6 +5580,11 @@ static bool may_update_sockmap(struct bpf_verifier_env *env, int func_id)if (eatype ==BPF_TRACE_ITER )return true;break ; +case BPF_PROG_TYPE_SOCK_OPS : +/* map_update allowed only via dedicated helpers with event type checks */ +if (func_id == BPF_FUNC_map_delete_elem) +return true; +break ;case BPF_PROG_TYPE_SOCKET_FILTER :case BPF_PROG_TYPE_SCHED_CLS :case BPF_PROG_TYPE_SCHED_ACT :
@@ -5666,7 +5672,6 @@ static int check_map_func_compatibility(struct bpf_verifier_env *env,case BPF_MAP_TYPE_SOCKMAP : if (func_id != BPF_FUNC_sk_redirect_map && func_id != BPF_FUNC_sock_map_update && - func_id != BPF_FUNC_map_delete_elem && func_id != BPF_FUNC_msg_redirect_map && func_id != BPF_FUNC_sk_select_reuseport && func_id != BPF_FUNC_map_lookup_elem &&
@@ -5676,7 +5681,6 @@ static int check_map_func_compatibility(struct bpf_verifier_env *env,case BPF_MAP_TYPE_SOCKHASH : if (func_id != BPF_FUNC_sk_redirect_hash && func_id != BPF_FUNC_sock_hash_update && - func_id != BPF_FUNC_map_delete_elem && func_id != BPF_FUNC_msg_redirect_hash && func_id != BPF_FUNC_sk_select_reuseport && func_id != BPF_FUNC_map_lookup_elem &&
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 318/402 net:fec: Add fec_enet_deinit()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xiaolei Wang <[email protected]>
[ Upstream commit bf0497f53c8535f99b72041529d3f7708a6e2c0d ]
When fec_probe() fails or fec_drv_remove() needs to release the fec queue and remove a NAPI context, therefore add a function corresponding to fec_enet_init() and call fec_enet_deinit() which does the opposite to release memory and remove a NAPI context.
--- drivers/net/ethernet/freescale/fec_main.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/net/ethernet/freescale/fec_main.c +10 -0
@@ -3627,6 +3627,14 @@ static int fec_enet_init(struct net_device *ndev)return ret; } +static void fec_enet_deinit (struct net_device *ndev) +{ +struct fec_enet_private *fep =netdev_priv (ndev); + +netif_napi_del (&fep->napi); +fec_enet_free_queue (ndev); +} +#ifdef CONFIG_OF static int fec_reset_phy (struct platform_device *pdev) {
@@ -4023,6 +4031,7 @@ fec_probe(struct platform_device *pdev)fec_enet_mii_remove (fep); failed_mii_init: failed_irq: +fec_enet_deinit (ndev); failed_init:fec_ptp_stop (pdev); failed_reset:
@@ -4085,6 +4094,7 @@ fec_drv_remove(struct platform_device *pdev)pm_runtime_put_noidle (&pdev->dev);pm_runtime_disable (&pdev->dev); +fec_enet_deinit (ndev);free_netdev (ndev);return 0 ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 319/402 netfilter: nft_payload: move struct nft_payload_set definition where it belongs
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <[email protected]>
[ Upstream commit ac1f8c049319847b1b4c6b387fdb2e3f7fb84ffc ]
Not required to expose this header in nf_tables_core.h, move it to where it is used, ie. nft_payload.
Stable-dep-of: 33c563ebf8d3 ("netfilter: nft_payload: skbuff vlan metadata mangle support")
--- include/net/netfilter/nf_tables_core.h | 10 ---------- net/netfilter/nft_payload.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-)
include/net/netfilter/nf_tables_core.h +0 -10
@@ -74,16 +74,6 @@ struct nft_payload {u8 dreg; }; -struct nft_payload_set { -enum nft_payload_bases base:8 ; -u8 offset; -u8 len; -u8 sreg; -u8 csum_type; -u8 csum_offset; -u8 csum_flags; -}; -extern const struct nft_expr_ops nft_payload_fast_ops;extern const struct nft_expr_ops nft_bitwise_fast_ops;
net/netfilter/nft_payload.c +10 -0
@@ -629,6 +629,16 @@ static int nft_payload_csum_inet(struct sk_buff *skb, const u32 *src,return 0 ; } +struct nft_payload_set { +enum nft_payload_bases base:8 ; +u8 offset; +u8 len; +u8 sreg; +u8 csum_type; +u8 csum_offset; +u8 csum_flags; +}; +static void nft_payload_set_eval (const struct nft_expr *expr,struct nft_regs *regs,const struct nft_pktinfo *pkt)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 320/402 netfilter: nft_payload: rebuild vlan header when needed
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <[email protected]>
[ Upstream commit de6843be3082d416eaf2a00b72dad95c784ca980 ]
Skip rebuilding the vlan header when accessing destination and source mac address.
Stable-dep-of: 33c563ebf8d3 ("netfilter: nft_payload: skbuff vlan metadata mangle support")
--- net/netfilter/nft_payload.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/netfilter/nft_payload.c +2 -1
@@ -127,7 +127,8 @@ void nft_payload_eval(const struct nft_expr *expr,if (!skb_mac_header_was_set (skb) ||skb_mac_header_len (skb) ==0 ) goto err; -if (skb_vlan_tag_present (skb)) { +if (skb_vlan_tag_present (skb) && + priv->offset >= offsetof(struct ethhdr , h_proto)) {if (!nft_payload_copy_vlan (dest, skb, priv->offset, priv->len)) goto err;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 321/402 netfilter: nft_payload: rebuild vlan header on h_proto access
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <[email protected]>
[ Upstream commit af84f9e447a65b4b9f79e7e5d69e19039b431c56 ]
nft can perform merging of adjacent payload requests. This means that:
ether saddr 00:11 ... ether type 8021ad ...
is a single payload expression, for 8 bytes, starting at the ethernet source offset.
Check that offset+length is fully within the source/destination mac addersses.
This bug prevents 'ether type' from matching the correct h_proto in case vlan tag got stripped.
Stable-dep-of: 33c563ebf8d3 ("netfilter: nft_payload: skbuff vlan metadata mangle support")
--- net/netfilter/nft_payload.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
net/netfilter/nft_payload.c +12 -1
@@ -110,6 +110,17 @@ static int nft_payload_inner_offset(const struct nft_pktinfo *pkt)return pkt->inneroff; } +static bool nft_payload_need_vlan_copy (const struct nft_payload *priv) +{ +unsigned int len = priv->offset + priv->len; + +/* data past ether src/dst requested, copy needed */ +if (len > offsetof(struct ethhdr , h_proto)) +return true; + +return false; +} +void nft_payload_eval (const struct nft_expr *expr,struct nft_regs *regs,const struct nft_pktinfo *pkt)
@@ -128,7 +139,7 @@ void nft_payload_eval(const struct nft_expr *expr, goto err;if (skb_vlan_tag_present (skb) && - priv->offset >= offsetof(struct ethhdr , h_proto)) { +nft_payload_need_vlan_copy (priv)) {if (!nft_payload_copy_vlan (dest, skb, priv->offset, priv->len)) goto err;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 322/402 netfilter: nft_payload: skbuff vlan metadata mangle support
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <[email protected]>
[ Upstream commit 33c563ebf8d3deed7d8addd20d77398ac737ef9a ]
Userspace assumes vlan header is present at a given offset, but vlan offload allows to store this in metadata fields of the skbuff. Hence mangling vlan results in a garbled packet. Handle this transparently by adding a parser to the kernel.
If vlan metadata is present and payload offset is over 12 bytes (source and destination mac address fields), then subtract vlan header present in vlan metadata, otherwise mangle vlan metadata based on offset and length, extracting data from the source register.
This is similar to:
8cfd23e67401 ("netfilter: nft_payload: work around vlan header stripping")
to deal with vlan payload mangling.
--- net/netfilter/nft_payload.c | 72 +++++++++++++++++++++++++++++++++---- 1 file changed, 65 insertions(+), 7 deletions(-)
net/netfilter/nft_payload.c +65 -7
@@ -110,12 +110,12 @@ static int nft_payload_inner_offset(const struct nft_pktinfo *pkt)return pkt->inneroff; } -static bool nft_payload_need_vlan_copy (const struct nft_payload *priv) +static bool nft_payload_need_vlan_adjust (u32 offset,u32 len) { -unsigned int len = priv->offset + priv->len; +unsigned int boundary = offset + len;/* data past ether src/dst requested, copy needed */ -if (len > offsetof(struct ethhdr , h_proto)) +if (boundary > offsetof(struct ethhdr , h_proto))return true;return false;
@@ -139,7 +139,7 @@ void nft_payload_eval(const struct nft_expr *expr, goto err;if (skb_vlan_tag_present (skb) && -nft_payload_need_vlan_copy (priv)) { +nft_payload_need_vlan_adjust (priv->offset, priv->len)) {if (!nft_payload_copy_vlan (dest, skb, priv->offset, priv->len)) goto err;
@@ -651,21 +651,79 @@ struct nft_payload_set {u8 csum_flags; }; +/* This is not struct vlan_hdr. */ +struct nft_payload_vlan_hdr { +__be16 h_vlan_proto; +__be16 h_vlan_TCI; +}; + +static bool +nft_payload_set_vlan (const u32 *src,struct sk_buff *skb,u8 offset,u8 len, +int *vlan_hlen) +{ +struct nft_payload_vlan_hdr *vlanh; +__be16 vlan_proto; +u16 vlan_tci; + +if (offset >= offsetof(struct vlan_ethhdr , h_vlan_encapsulated_proto)) { + *vlan_hlen =VLAN_HLEN ; +return true; + } + +switch (offset) { +case offsetof(struct vlan_ethhdr , h_vlan_proto): +if (len ==2 ) { + vlan_proto =nft_reg_load_be16 (src); + skb->vlan_proto = vlan_proto; + }else if (len ==4 ) { + vlanh = (struct nft_payload_vlan_hdr *)src; +__vlan_hwaccel_put_tag (skb, vlanh->h_vlan_proto, +ntohs (vlanh->h_vlan_TCI)); + }else { +return false; + } +break ; +case offsetof(struct vlan_ethhdr , h_vlan_TCI): +if (len !=2 ) +return false; + + vlan_tci =ntohs (nft_reg_load_be16 (src)); + skb->vlan_tci = vlan_tci; +break ; +default : +return false; + } + +return true; +} +static void nft_payload_set_eval (const struct nft_expr *expr,struct nft_regs *regs,const struct nft_pktinfo *pkt) {const struct nft_payload_set *priv =nft_expr_priv (expr); -struct sk_buff *skb = pkt->skb;const u32 *src = ®s->data[priv->sreg]; -int offset, csum_offset; +int offset, csum_offset, vlan_hlen =0 ; +struct sk_buff *skb = pkt->skb;__wsum fsum, tsum;switch (priv->base) {case NFT_PAYLOAD_LL_HEADER :if (!skb_mac_header_was_set (skb)) goto err; - offset =skb_mac_header (skb) - skb->data; + +if (skb_vlan_tag_present (skb) && +nft_payload_need_vlan_adjust (priv->offset, priv->len)) { +if (!nft_payload_set_vlan (src, skb, + priv->offset, priv->len, + &vlan_hlen)) + goto err; + +if (!vlan_hlen) +return ; + } + + offset =skb_mac_header (skb) - skb->data - vlan_hlen;break ;case NFT_PAYLOAD_NETWORK_HEADER : offset =skb_network_offset (skb);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 323/402 netfilter: tproxy: bail out if IP has been disabled on the device
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <[email protected]>
[ Upstream commit 21a673bddc8fd4873c370caf9ae70ffc6d47e8d3 ]
syzbot reports:
general protection fault, probably for non-canonical address 0xdffffc0000000003: 0000 [#1] PREEMPT SMP KASAN PTI KASAN: null-ptr-deref in range [0x0000000000000018-0x000000000000001f] [..] RIP: 0010:nf_tproxy_laddr4+0xb7/0x340 net/ipv4/netfilter/nf_tproxy_ipv4.c:62 Call Trace: nft_tproxy_eval_v4 net/netfilter/nft_tproxy.c:56 [inline] nft_tproxy_eval+0xa9a/0x1a00 net/netfilter/nft_tproxy.c:168
__in_dev_get_rcu() can return NULL, so check for this.
--- net/ipv4/netfilter/nf_tproxy_ipv4.c | 2 ++ 1 file changed, 2 insertions(+)
net/ipv4/netfilter/nf_tproxy_ipv4.c +2 -0
@@ -58,6 +58,8 @@ __be32 nf_tproxy_laddr4(struct sk_buff *skb, __be32 user_laddr, __be32 daddr) laddr =0 ; indev =__in_dev_get_rcu (skb->dev); +if (!indev) +return daddr;in_dev_for_each_ifa_rcu (ifa, indev) {if (ifa->ifa_flags &IFA_F_SECONDARY )
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 324/402 kconfig: fix comparison to constant symbols, m, n
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masahiro Yamada <[email protected]>
[ Upstream commit aabdc960a283ba78086b0bf66ee74326f49e218e ]
Currently, comparisons to 'm' or 'n' result in incorrect output.
[Test Code]
config MODULES
def_bool y
modules
config A
def_tristate m
config B
def_bool A > n
CONFIG_B is unset, while CONFIG_B=y is expected.
The reason for the issue is because Kconfig compares the tristate values as strings.
Currently, the .type fields in the constant symbol definitions, symbol_{yes,mod,no} are unspecified, i.e., S_UNKNOWN.
When expr_calc_value() evaluates 'A > n', it checks the types of 'A' and 'n' to determine how to compare them.
The left-hand side, 'A', is a tristate symbol with a value of 'm', which corresponds to a numeric value of 1. (Internally, 'y', 'm', and 'n' are represented as 2, 1, and 0, respectively.)
The right-hand side, 'n', has an unknown type, so it is treated as the string "n" during the comparison.
expr_calc_value() compares two values numerically only when both can have numeric values. Otherwise, they are compared as strings.
symbol numeric value ASCII code
-------------------------------------
y 2 0x79
m 1 0x6d
n 0 0x6e'm' is greater than 'n' if compared numerically (since 1 is greater than 0), but smaller than 'n' if compared as strings (since the ASCII code 0x6d is smaller than 0x6e).
Specifying .type=S_TRISTATE for symbol_{yes,mod,no} fixes the above test code.
Doing so, however, would cause a regression to the following test code.
[Test Code 2]
config MODULES
def_bool n
modules
config A
def_tristate n
config B
def_bool A = m
You would get CONFIG_B=y, while CONFIG_B should not be set.
The reason is because sym_get_string_value() turns 'm' into 'n' when the module feature is disabled. Consequently, expr_calc_value() evaluates 'A = n' instead of 'A = m'. This oddity has been hidden because the type of 'm' was previously S_UNKNOWN instead of S_TRISTATE.
sym_get_string_value() should not tweak the string because the tristate value has already been correctly calculated. There is no reason to return the string "n" where its tristate value is mod.
--- scripts/kconfig/symbol.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
scripts/kconfig/symbol.c +4 -2
@@ -13,18 +13,21 @@struct symbol symbol_yes = { .name ="y" , + .type =S_TRISTATE , .curr = {"y" , yes }, .flags =SYMBOL_CONST |SYMBOL_VALID , };struct symbol symbol_mod = { .name ="m" , + .type =S_TRISTATE , .curr = {"m" , mod }, .flags =SYMBOL_CONST |SYMBOL_VALID , };struct symbol symbol_no = { .name ="n" , + .type =S_TRISTATE , .curr = {"n" , no }, .flags =SYMBOL_CONST |SYMBOL_VALID , };
@@ -775,8 +778,7 @@ const char *sym_get_string_value(struct symbol *sym)case no:return "n" ;case mod: -sym_calc_value (modules_sym); -return (modules_sym->curr.tri == no) ?"n" :"m" ; +return "m" ;case yes:return "y" ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 325/402 spi: stm32: Dont warn about spurious interrupts
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Uwe Kleine-König <[email protected]>
[ Upstream commit 95d7c452a26564ef0c427f2806761b857106d8c4 ]
The dev_warn to notify about a spurious interrupt was introduced with the reasoning that these are unexpected. However spurious interrupts tend to trigger continously and the error message on the serial console prevents that the core's detection of spurious interrupts kicks in (which disables the irq) and just floods the console.
--- drivers/spi/spi-stm32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-stm32.c +1 -1
@@ -884,7 +884,7 @@ static irqreturn_t stm32h7_spi_irq_thread(int irq, void *dev_id) mask |=STM32H7_SPI_SR_TXP |STM32H7_SPI_SR_RXP ;if (!(sr & mask)) { -dev_warn (spi->dev,"spurious IT (sr=0x%08x, ier=0x%08x)\n" , +dev_vdbg (spi->dev,"spurious IT (sr=0x%08x, ier=0x%08x)\n" , sr, ier);spin_unlock_irqrestore (&spi->lock, flags);return IRQ_NONE ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 326/402 net: ena: Add capabilities field with support for ENI stats capability
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arthur Kiyanovski <[email protected]>
[ Upstream commit a2d5d6a70fa5211e071747876fa6a7621c7257fd ]
This bitmask field indicates what capabilities are supported by the device.
The capabilities field differs from the 'supported_features' field which indicates what sub-commands for the set/get feature commands are supported. The sub-commands are specified in the 'feature_id' field of the 'ena_admin_set_feat_cmd' struct in the following way:
struct ena_admin_set_feat_cmd cmd;
cmd.aq_common_descriptor.opcode = ENA_ADMIN_SET_FEATURE;
cmd.feat_common.feature_The 'capabilities' field, on the other hand, specifies different capabilities of the device. For example, whether the device supports querying of ENI stats.
Also add an enumerator which contains all the capabilities. The first added capability macro is for ENI stats feature.
Capabilities are queried along with the other device attributes (in ena_com_get_dev_attr_feat()) during device initialization and are stored in the ena_com_dev struct. They can be later queried using the ena_com_get_cap() helper function.
Stable-dep-of: 2dc8b1e7177d ("net: ena: Fix redundant device NUMA node override")
--- drivers/net/ethernet/amazon/ena/ena_admin_defs.h | 10 +++++++++- drivers/net/ethernet/amazon/ena/ena_com.c | 8 ++++++++ drivers/net/ethernet/amazon/ena/ena_com.h | 13 +++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-)
drivers/net/ethernet/amazon/ena/ena_admin_defs.h +9 -1
@@ -48,6 +48,11 @@ enum ena_admin_aq_feature_id { ENA_ADMIN_FEATURES_OPCODE_NUM = 32, }; +/* device capabilities */ +enum ena_admin_aq_caps_id { +ENA_ADMIN_ENI_STATS =0 , +}; +enum ena_admin_placement_policy_type {/* descriptors and headers are in host memory */ ENA_ADMIN_PLACEMENT_POLICY_HOST =1 ,
@@ -455,7 +460,10 @@ struct ena_admin_device_attr_feature_desc {*/ u32 supported_features; -u32 reserved3; +/* bitmap of ena_admin_aq_caps_id, which represents device +* capabilities. +*/ +u32 capabilities;/* Indicates how many bits are used physical address access. */ u32 phys_addr_width;
drivers/net/ethernet/amazon/ena/ena_com.c +8 -0
@@ -1974,6 +1974,7 @@ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_dev, sizeof(get_resp.u.dev_attr)); ena_dev->supported_features = get_resp.u.dev_attr.supported_features; + ena_dev->capabilities = get_resp.u.dev_attr.capabilities;if (ena_dev->supported_features &BIT (ENA_ADMIN_MAX_QUEUES_EXT )) { rc = ena_com_get_feature(ena_dev, &get_resp,
@@ -2226,6 +2227,13 @@ int ena_com_get_eni_stats(struct ena_com_dev *ena_dev,struct ena_com_stats_ctx ctx;int ret; +if (!ena_com_get_cap (ena_dev,ENA_ADMIN_ENI_STATS )) { +netdev_err (ena_dev->net_device, +"Capability %d isn't supported\n" , +ENA_ADMIN_ENI_STATS ); +return -EOPNOTSUPP ; + } +memset (&ctx,0x0 ,sizeof (ctx)); ret =ena_get_dev_stats (ena_dev, &ctx,ENA_ADMIN_GET_STATS_TYPE_ENI );if (likely (ret ==0 ))
drivers/net/ethernet/amazon/ena/ena_com.h +13 -0
@@ -314,6 +314,7 @@ struct ena_com_dev {struct ena_rss rss;u32 supported_features; +u32 capabilities;u32 dma_addr_bits;struct ena_host_attribute host_attr;
@@ -967,6 +968,18 @@ static inline void ena_com_disable_adaptive_moderation(struct ena_com_dev *ena_d ena_dev->adaptive_coalescing = false; } +/* ena_com_get_cap - query whether device supports a capability. +* @ena_dev: ENA communication layer struct +* @cap_id: enum value representing the capability +* +* @return - true if capability is supported or false otherwise +*/ +static inline bool ena_com_get_cap (struct ena_com_dev *ena_dev, +enum ena_admin_aq_caps_id cap_id) +{ +return !!(ena_dev->capabilities &BIT (cap_id)); +} +/* ena_com_update_intr_reg - Prepare interrupt register * @intr_reg: interrupt register to update. * @rx_delay_interval: Rx interval in usecs
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 327/402 net: ena: Extract recurring driver reset code into a function
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arthur Kiyanovski <[email protected]>
[ Upstream commit 9fe890cc5bb84d6859d9a2422830b7fd6fd20521 ]
Create an inline function for resetting the driver to reduce code duplication.
Stable-dep-of: 2dc8b1e7177d ("net: ena: Fix redundant device NUMA node override")
--- drivers/net/ethernet/amazon/ena/ena_netdev.c | 45 ++++++-------------- drivers/net/ethernet/amazon/ena/ena_netdev.h | 9 ++++ 2 files changed, 23 insertions(+), 31 deletions(-)
drivers/net/ethernet/amazon/ena/ena_netdev.c +14 -31
@@ -103,7 +103,7 @@ static void ena_tx_timeout(struct net_device *dev, unsigned int txqueue)if (test_and_set_bit (ENA_FLAG_TRIGGER_RESET , &adapter->flags))return ; - adapter->reset_reason =ENA_REGS_RESET_OS_NETDEV_WD ; +ena_reset_device (adapter,ENA_REGS_RESET_OS_NETDEV_WD );ena_increase_stat (&adapter->dev_stats.tx_timeout,1 , &adapter->syncp);netif_err (adapter, tx_err, dev,"Transmit time out\n" );
@@ -166,11 +166,9 @@ static int ena_xmit_common(struct net_device *dev, "Failed to prepare tx bufs\n");ena_increase_stat (&ring->tx_stats.prepare_ctx_err,1 , &ring->syncp); -if (rc != -ENOMEM ) { - adapter->reset_reason = -ENA_REGS_RESET_DRIVER_INVALID_STATE ; -set_bit (ENA_FLAG_TRIGGER_RESET , &adapter->flags); - } +if (rc != -ENOMEM ) +ena_reset_device (adapter, +ENA_REGS_RESET_DRIVER_INVALID_STATE );return rc; }
@@ -1297,10 +1295,8 @@ static int handle_invalid_req_id(struct ena_ring *ring, u16 req_id, req_id);ena_increase_stat (&ring->tx_stats.bad_req_id,1 , &ring->syncp); +ena_reset_device (ring->adapter,ENA_REGS_RESET_INV_TX_REQ_ID ); -/* Trigger device reset */ - ring->adapter->reset_reason =ENA_REGS_RESET_INV_TX_REQ_ID ; -set_bit (ENA_FLAG_TRIGGER_RESET , &ring->adapter->flags);return -EFAULT ; }
@@ -1463,10 +1459,7 @@ static struct sk_buff *ena_rx_skb(struct ena_ring *rx_ring,netif_err (adapter, rx_err, rx_ring->netdev,"Page is NULL. qid %u req_id %u\n" , rx_ring->qid, req_id);ena_increase_stat (&rx_ring->rx_stats.bad_req_id,1 , &rx_ring->syncp); - adapter->reset_reason =ENA_REGS_RESET_INV_RX_REQ_ID ; -/* Make sure reset reason is set before triggering the reset */ -smp_mb__before_atomic (); -set_bit (ENA_FLAG_TRIGGER_RESET , &adapter->flags); +ena_reset_device (adapter,ENA_REGS_RESET_INV_RX_REQ_ID );return NULL ; }
@@ -1806,15 +1799,12 @@ static int ena_clean_rx_irq(struct ena_ring *rx_ring, struct napi_struct *napi,if (rc == -ENOSPC ) {ena_increase_stat (&rx_ring->rx_stats.bad_desc_num,1 , &rx_ring->syncp); - adapter->reset_reason =ENA_REGS_RESET_TOO_MANY_RX_DESCS ; +ena_reset_device (adapter,ENA_REGS_RESET_TOO_MANY_RX_DESCS ); }else {ena_increase_stat (&rx_ring->rx_stats.bad_req_id,1 , &rx_ring->syncp); - adapter->reset_reason =ENA_REGS_RESET_INV_RX_REQ_ID ; +ena_reset_device (adapter,ENA_REGS_RESET_INV_RX_REQ_ID ); } - -set_bit (ENA_FLAG_TRIGGER_RESET , &adapter->flags); -return 0 ; }
@@ -3740,9 +3730,8 @@ static int check_for_rx_interrupt_queue(struct ena_adapter *adapter,netif_err (adapter, rx_err, adapter->netdev,"Potential MSIX issue on Rx side Queue = %d. Reset the device\n" , rx_ring->qid); - adapter->reset_reason =ENA_REGS_RESET_MISS_INTERRUPT ; -smp_mb__before_atomic (); -set_bit (ENA_FLAG_TRIGGER_RESET , &adapter->flags); + +ena_reset_device (adapter,ENA_REGS_RESET_MISS_INTERRUPT );return -EIO ; }
@@ -3779,9 +3768,7 @@ static int check_missing_comp_in_tx_queue(struct ena_adapter *adapter,netif_err (adapter, tx_err, adapter->netdev,"Potential MSIX issue on Tx side Queue = %d. Reset the device\n" , tx_ring->qid); - adapter->reset_reason =ENA_REGS_RESET_MISS_INTERRUPT ; -smp_mb__before_atomic (); -set_bit (ENA_FLAG_TRIGGER_RESET , &adapter->flags); +ena_reset_device (adapter,ENA_REGS_RESET_MISS_INTERRUPT );return -EIO ; }
@@ -3807,9 +3794,7 @@ static int check_missing_comp_in_tx_queue(struct ena_adapter *adapter,"The number of lost tx completions is above the threshold (%d > %d). Reset the device\n" , missed_tx, adapter->missing_tx_completion_threshold); - adapter->reset_reason = -ENA_REGS_RESET_MISS_TX_CMPL ; -set_bit (ENA_FLAG_TRIGGER_RESET , &adapter->flags); +ena_reset_device (adapter,ENA_REGS_RESET_MISS_TX_CMPL ); rc = -EIO ; }
@@ -3933,8 +3918,7 @@ static void check_for_missing_keep_alive(struct ena_adapter *adapter) "Keep alive watchdog timeout.\n");ena_increase_stat (&adapter->dev_stats.wd_expired,1 , &adapter->syncp); - adapter->reset_reason =ENA_REGS_RESET_KEEP_ALIVE_TO ; -set_bit (ENA_FLAG_TRIGGER_RESET , &adapter->flags); +ena_reset_device (adapter,ENA_REGS_RESET_KEEP_ALIVE_TO ); } }
@@ -3945,8 +3929,7 @@ static void check_for_admin_com_state(struct ena_adapter *adapter) "ENA admin queue is not in running state!\n");ena_increase_stat (&adapter->dev_stats.admin_q_pause,1 , &adapter->syncp); - adapter->reset_reason =ENA_REGS_RESET_ADMIN_TO ; -set_bit (ENA_FLAG_TRIGGER_RESET , &adapter->flags); +ena_reset_device (adapter,ENA_REGS_RESET_ADMIN_TO ); } }
drivers/net/ethernet/amazon/ena/ena_netdev.h +9 -0
@@ -410,6 +410,15 @@ int ena_set_rx_copybreak(struct ena_adapter *adapter, u32 rx_copybreak);int ena_get_sset_count (struct net_device *netdev,int sset); +static inline void ena_reset_device (struct ena_adapter *adapter, +enum ena_regs_reset_reason_types reset_reason) +{ + adapter->reset_reason = reset_reason; +/* Make sure reset reason is set before triggering the reset */ +smp_mb__before_atomic (); +set_bit (ENA_FLAG_TRIGGER_RESET , &adapter->flags); +} +enum ena_xdp_errors_t {ENA_XDP_ALLOWED =0 ,ENA_XDP_CURRENT_MTU_TOO_LARGE ,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 328/402 net: ena: Do not waste napi skb cache
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hyeonggon Yoo <[email protected]>
[ Upstream commit 7354a426e063e108c0a3590f13abc77573172576 ]
By profiling, discovered that ena device driver allocates skb by build_skb() and frees by napi_skb_cache_put(). Because the driver does not use napi skb cache in allocation path, napi skb cache is periodically filled and flushed. This is waste of napi skb cache.
As ena_alloc_skb() is called only in napi, Use napi_build_skb() and napi_alloc_skb() when allocating skb.
This patch was tested on aws a1.metal instance.
[ [email protected]: Use napi_alloc_skb() instead of
netdev_alloc_skb_ip_align() to keep things consistent. ]
Stable-dep-of: 2dc8b1e7177d ("net: ena: Fix redundant device NUMA node override")
--- drivers/net/ethernet/amazon/ena/ena_netdev.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/ethernet/amazon/ena/ena_netdev.c +2 -3
@@ -1418,10 +1418,9 @@ static struct sk_buff *ena_alloc_skb(struct ena_ring *rx_ring, void *first_frag)struct sk_buff *skb;if (!first_frag) - skb =netdev_alloc_skb_ip_align (rx_ring->netdev, - rx_ring->rx_copybreak); + skb =napi_alloc_skb (rx_ring->napi, rx_ring->rx_copybreak);else - skb =build_skb (first_frag,ENA_PAGE_SIZE ); + skb =napi_build_skb (first_frag,ENA_PAGE_SIZE );if (unlikely (!skb)) { ena_increase_stat(&rx_ring->rx_stats.skb_alloc_fail, 1,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 329/402 net: ena: Add dynamic recycling mechanism for rx buffers
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Arinzon <[email protected]>
[ Upstream commit f7d625adeb7bc6a9ec83d32d9615889969d64484 ]
The current implementation allocates page-sized rx buffers. As traffic may consist of different types and sizes of packets, in various cases, buffers are not fully used.
This change (Dynamic RX Buffers - DRB) uses part of the allocated rx page needed for the incoming packet, and returns the rest of the unused page to be used again as an rx buffer for future packets. A threshold of 2K for unused space has been set in order to declare whether the remainder of the page can be reused again as an rx buffer.
As a page may be reused, dma_sync_single_for_cpu() is added in order to sync the memory to the CPU side after it was owned by the HW. In addition, when the rx page can no longer be reused, it is being unmapped using dma_page_unmap(), which implicitly syncs and then unmaps the entire page. In case the kernel still handles the skbs pointing to the previous buffers from that rx page, it may access garbage pointers, caused by the implicit sync overwriting them. The implicit dma sync is removed by replacing dma_page_unmap() with dma_unmap_page_attrs() with DMA_ATTR_SKIP_CPU_SYNC flag.
The functionality is disabled for XDP traffic to avoid handling several descriptors per packet.
Stable-dep-of: 2dc8b1e7177d ("net: ena: Fix redundant device NUMA node override")
--- .../device_drivers/ethernet/amazon/ena.rst | 32 +++++ .../net/ethernet/amazon/ena/ena_admin_defs.h | 6 +- drivers/net/ethernet/amazon/ena/ena_netdev.c | 136 ++++++++++++------ drivers/net/ethernet/amazon/ena/ena_netdev.h | 4 + 4 files changed, 136 insertions(+), 42 deletions(-)
Documentation/networking/device_drivers/ethernet/amazon/ena.rst +32 -0
@@ -205,6 +205,7 @@ Adaptive coalescing can be switched on/off through `ethtool(8)`'s More information about Adaptive Interrupt Moderation (DIM) can be found in Documentation/networking/net_dim.rst +.. _`RX copybreak`: RX copybreak ============ The rx_copybreak is initialized by default to ENA_DEFAULT_RX_COPYBREAK
@@ -315,3 +316,34 @@ Rx - The new SKB is updated with the necessary information (protocol, checksum hw verify result, etc), and then passed to the network stack, using the NAPI interface function :code:`napi_gro_receive()`. + +Dynamic RX Buffers (DRB) +------------------------ + +Each RX descriptor in the RX ring is a single memory page (which is either 4KB +or 16KB long depending on system's configurations). +To reduce the memory allocations required when dealing with a high rate of small +packets, the driver tries to reuse the remaining RX descriptor's space if more +than 2KB of this page remain unused. + +A simple example of this mechanism is the following sequence of events: + +:: + + 1. Driver allocates page-sized RX buffer and passes it to hardware + +----------------------+ + |4KB RX Buffer | + +----------------------+ + + 2. A 300Bytes packet is received on this buffer + + 3. The driver increases the ref count on this page and returns it back to + HW as an RX buffer of size 4KB - 300Bytes = 3796 Bytes + +----+--------------------+ + |****|3796 Bytes RX Buffer| + +----+--------------------+ + +This mechanism isn't used when an XDP program is loaded, or when the +RX packet is less than rx_copybreak bytes (in which case the packet is +copied out of the RX buffer into the linear part of a new skb allocated +for it and the RX buffer remains the same size, see `RX copybreak`_).
drivers/net/ethernet/amazon/ena/ena_admin_defs.h +5 -1
@@ -869,7 +869,9 @@ struct ena_admin_host_info {* 2 : interrupt_moderation * 3 : rx_buf_mirroring * 4 : rss_configurable_function_key -* 31:5 : reserved +* 5 : reserved +* 6 : rx_page_reuse +* 31:7 : reserved */ u32 driver_supported_features; };
@@ -1184,6 +1186,8 @@ struct ena_admin_ena_mmio_req_read_less_resp {#define ENA_ADMIN_HOST_INFO_RX_BUF_MIRRORING_MASK BIT(3)#define ENA_ADMIN_HOST_INFO_RSS_CONFIGURABLE_FUNCTION_KEY_SHIFT 4#define ENA_ADMIN_HOST_INFO_RSS_CONFIGURABLE_FUNCTION_KEY_MASK BIT(4) +#define ENA_ADMIN_HOST_INFO_RX_PAGE_REUSE_SHIFT 6 +#define ENA_ADMIN_HOST_INFO_RX_PAGE_REUSE_MASK BIT(6)/* aenq_common_desc */ #define ENA_ADMIN_AENQ_COMMON_DESC_PHASE_MASK BIT(0)
drivers/net/ethernet/amazon/ena/ena_netdev.c +95 -41
268 lines not on this page · raw message
drivers/net/ethernet/amazon/ena/ena_netdev.h +4 -0
@@ -50,6 +50,8 @@#define ENA_DEFAULT_RING_SIZE (1024)#define ENA_MIN_RING_SIZE (256) +#define ENA_MIN_RX_BUF_SIZE (2048) +#define ENA_MIN_NUM_IO_QUEUES (1)#define ENA_TX_WAKEUP_THRESH (MAX_SKB_FRAGS + 2)
@@ -186,7 +188,9 @@ struct ena_tx_buffer {struct ena_rx_buffer {struct sk_buff *skb;struct page *page; +dma_addr_t dma_addr;u32 page_offset; +u32 buf_offset;struct ena_com_buf ena_buf; }____cacheline_aligned ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 330/402 net: ena: Reduce lines with longer column width boundary
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Arinzon <[email protected]>
[ Upstream commit 50613650c3d6255cef13a129ccaa919ca73a6743 ]
This patch reduces some of the lines by removing newlines where more variables or print strings can be pushed back to the previous line while still adhering to the styling guidelines.
Stable-dep-of: 2dc8b1e7177d ("net: ena: Fix redundant device NUMA node override")
--- drivers/net/ethernet/amazon/ena/ena_com.c | 315 +++++++----------- drivers/net/ethernet/amazon/ena/ena_eth_com.c | 49 ++- drivers/net/ethernet/amazon/ena/ena_eth_com.h | 15 +- drivers/net/ethernet/amazon/ena/ena_netdev.c | 32 +- 4 files changed, 151 insertions(+), 260 deletions(-)
drivers/net/ethernet/amazon/ena/ena_com.c +112 -203
@@ -90,8 +90,7 @@ static int ena_com_admin_init_sq(struct ena_com_admin_queue *admin_queue)struct ena_com_admin_sq *sq = &admin_queue->sq;u16 size =ADMIN_SQ_SIZE (admin_queue->q_depth); - sq->entries =dma_alloc_coherent (admin_queue->q_dmadev, size, - &sq->dma_addr,GFP_KERNEL ); + sq->entries =dma_alloc_coherent (admin_queue->q_dmadev, size, &sq->dma_addr,GFP_KERNEL );if (!sq->entries) {netdev_err (ena_dev->net_device,"Memory allocation failed\n" );
@@ -113,8 +112,7 @@ static int ena_com_admin_init_cq(struct ena_com_admin_queue *admin_queue)struct ena_com_admin_cq *cq = &admin_queue->cq;u16 size =ADMIN_CQ_SIZE (admin_queue->q_depth); - cq->entries =dma_alloc_coherent (admin_queue->q_dmadev, size, - &cq->dma_addr,GFP_KERNEL ); + cq->entries =dma_alloc_coherent (admin_queue->q_dmadev, size, &cq->dma_addr,GFP_KERNEL );if (!cq->entries) {netdev_err (ena_dev->net_device,"Memory allocation failed\n" );
@@ -136,8 +134,7 @@ static int ena_com_admin_init_aenq(struct ena_com_dev *ena_dev, ena_dev->aenq.q_depth =ENA_ASYNC_QUEUE_DEPTH ; size =ADMIN_AENQ_SIZE (ENA_ASYNC_QUEUE_DEPTH ); - aenq->entries =dma_alloc_coherent (ena_dev->dmadev, size, - &aenq->dma_addr,GFP_KERNEL ); + aenq->entries =dma_alloc_coherent (ena_dev->dmadev, size, &aenq->dma_addr,GFP_KERNEL );if (!aenq->entries) {netdev_err (ena_dev->net_device,"Memory allocation failed\n" );
@@ -155,14 +152,13 @@ static int ena_com_admin_init_aenq(struct ena_com_dev *ena_dev, aenq_caps =0 ; aenq_caps |= ena_dev->aenq.q_depth &ENA_REGS_AENQ_CAPS_AENQ_DEPTH_MASK ; - aenq_caps |= (sizeof (struct ena_admin_aenq_entry ) - <<ENA_REGS_AENQ_CAPS_AENQ_ENTRY_SIZE_SHIFT ) & -ENA_REGS_AENQ_CAPS_AENQ_ENTRY_SIZE_MASK ; + aenq_caps |= + (sizeof (struct ena_admin_aenq_entry ) <<ENA_REGS_AENQ_CAPS_AENQ_ENTRY_SIZE_SHIFT ) & +ENA_REGS_AENQ_CAPS_AENQ_ENTRY_SIZE_MASK ;writel (aenq_caps, ena_dev->reg_bar +ENA_REGS_AENQ_CAPS_OFF );if (unlikely (!aenq_handlers)) { -netdev_err (ena_dev->net_device, -"AENQ handlers pointer is NULL\n" ); +netdev_err (ena_dev->net_device,"AENQ handlers pointer is NULL\n" );return -EINVAL ; }
@@ -189,14 +185,12 @@ static struct ena_comp_ctx *get_comp_ctxt(struct ena_com_admin_queue *admin_queu }if (unlikely (!admin_queue->comp_ctx)) { -netdev_err (admin_queue->ena_dev->net_device, -"Completion context is NULL\n" ); +netdev_err (admin_queue->ena_dev->net_device,"Completion context is NULL\n" );return NULL ; }if (unlikely (admin_queue->comp_ctx[command_id].occupied && capture)) { -netdev_err (admin_queue->ena_dev->net_device, -"Completion context is occupied\n" ); +netdev_err (admin_queue->ena_dev->net_device,"Completion context is occupied\n" );return NULL ; }
@@ -226,8 +220,7 @@ static struct ena_comp_ctx *__ena_com_submit_admin_cmd(struct ena_com_admin_queu/* In case of queue FULL */ cnt = (u16 )atomic_read (&admin_queue->outstanding_cmds);if (cnt >= admin_queue->q_depth) { -netdev_dbg (admin_queue->ena_dev->net_device, -"Admin queue is full.\n" ); +netdev_dbg (admin_queue->ena_dev->net_device,"Admin queue is full.\n" ); admin_queue->stats.out_of_space++;return ERR_PTR (-ENOSPC ); }
@@ -274,8 +267,7 @@ static int ena_com_init_comp_ctxt(struct ena_com_admin_queue *admin_queue)struct ena_comp_ctx *comp_ctx;u16 i; - admin_queue->comp_ctx = -devm_kzalloc (admin_queue->q_dmadev, size,GFP_KERNEL ); + admin_queue->comp_ctx =devm_kzalloc (admin_queue->q_dmadev, size,GFP_KERNEL );if (unlikely (!admin_queue->comp_ctx)) {netdev_err (ena_dev->net_device,"Memory allocation failed\n" );return -ENOMEM ;
@@ -336,20 +328,17 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_dev, dev_node =dev_to_node (ena_dev->dmadev);set_dev_node (ena_dev->dmadev, ctx->numa_node); io_sq->desc_addr.virt_addr = -dma_alloc_coherent (ena_dev->dmadev, size, - &io_sq->desc_addr.phys_addr, +dma_alloc_coherent (ena_dev->dmadev, size, &io_sq->desc_addr.phys_addr,GFP_KERNEL );set_dev_node (ena_dev->dmadev, dev_node);if (!io_sq->desc_addr.virt_addr) { io_sq->desc_addr.virt_addr =dma_alloc_coherent (ena_dev->dmadev, size, - &io_sq->desc_addr.phys_addr, -GFP_KERNEL ); + &io_sq->desc_addr.phys_addr,GFP_KERNEL ); }if (!io_sq->desc_addr.virt_addr) { -netdev_err (ena_dev->net_device, -"Memory allocation failed\n" ); +netdev_err (ena_dev->net_device,"Memory allocation failed\n" );return -ENOMEM ; } }
@@ -367,16 +356,14 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_dev, dev_node =dev_to_node (ena_dev->dmadev);set_dev_node (ena_dev->dmadev, ctx->numa_node); - io_sq->bounce_buf_ctrl.base_buffer = -devm_kzalloc (ena_dev->dmadev, size,GFP_KERNEL ); + io_sq->bounce_buf_ctrl.base_buffer =devm_kzalloc (ena_dev->dmadev, size,GFP_KERNEL );set_dev_node (ena_dev->dmadev, dev_node);if (!io_sq->bounce_buf_ctrl.base_buffer) io_sq->bounce_buf_ctrl.base_buffer =devm_kzalloc (ena_dev->dmadev, size,GFP_KERNEL );if (!io_sq->bounce_buf_ctrl.base_buffer) { -netdev_err (ena_dev->net_device, -"Bounce buffer memory allocation failed\n" ); +netdev_err (ena_dev->net_device,"Bounce buffer memory allocation failed\n" );return -ENOMEM ; }
@@ -425,13 +412,11 @@ static int ena_com_init_io_cq(struct ena_com_dev *ena_dev, prev_node =dev_to_node (ena_dev->dmadev);set_dev_node (ena_dev->dmadev, ctx->numa_node); io_cq->cdesc_addr.virt_addr = -dma_alloc_coherent (ena_dev->dmadev, size, - &io_cq->cdesc_addr.phys_addr,GFP_KERNEL ); +dma_alloc_coherent (ena_dev->dmadev, size, &io_cq->cdesc_addr.phys_addr,GFP_KERNEL );set_dev_node (ena_dev->dmadev, prev_node);if (!io_cq->cdesc_addr.virt_addr) { io_cq->cdesc_addr.virt_addr = -dma_alloc_coherent (ena_dev->dmadev, size, - &io_cq->cdesc_addr.phys_addr, +dma_alloc_coherent (ena_dev->dmadev, size, &io_cq->cdesc_addr.phys_addr,GFP_KERNEL ); }
@@ -514,8 +499,8 @@ static int ena_com_comp_status_to_errno(struct ena_com_admin_queue *admin_queue, u8 comp_status) {if (unlikely (comp_status !=0 )) -netdev_err (admin_queue->ena_dev->net_device, -"Admin command failed[%u]\n" , comp_status); +netdev_err (admin_queue->ena_dev->net_device,"Admin command failed[%u]\n" , + comp_status);switch (comp_status) {case ENA_ADMIN_SUCCESS :
@@ -580,8 +565,7 @@ static int ena_com_wait_and_process_admin_cq_polling(struct ena_comp_ctx *comp_c }if (unlikely (comp_ctx->status ==ENA_CMD_ABORTED )) { -netdev_err (admin_queue->ena_dev->net_device, -"Command was aborted\n" ); +netdev_err (admin_queue->ena_dev->net_device,"Command was aborted\n" );spin_lock_irqsave (&admin_queue->q_lock, flags); admin_queue->stats.aborted_cmd++;spin_unlock_irqrestore (&admin_queue->q_lock, flags);
@@ -589,8 +573,7 @@ static int ena_com_wait_and_process_admin_cq_polling(struct ena_comp_ctx *comp_c goto err; } -WARN (comp_ctx->status !=ENA_CMD_COMPLETED ,"Invalid comp status %d\n" , - comp_ctx->status); +WARN (comp_ctx->status !=ENA_CMD_COMPLETED ,"Invalid comp status %d\n" , comp_ctx->status); ret =ena_com_comp_status_to_errno (admin_queue, comp_ctx->comp_status); err:
@@ -634,8 +617,7 @@ static int ena_com_set_llq(struct ena_com_dev *ena_dev) sizeof(resp));if (unlikely (ret)) -netdev_err (ena_dev->net_device, -"Failed to set LLQ configurations: %d\n" , ret); +netdev_err (ena_dev->net_device,"Failed to set LLQ configurations: %d\n" , ret);return ret; }
@@ -658,8 +640,7 @@ static int ena_com_config_llq_info(struct ena_com_dev *ena_dev, llq_default_cfg->llq_header_location; }else {netdev_err (ena_dev->net_device, -"Invalid header location control, supported: 0x%x\n" , - supported_feat); +"Invalid header location control, supported: 0x%x\n" , supported_feat);return -EINVAL ; }
@@ -681,8 +662,8 @@ static int ena_com_config_llq_info(struct ena_com_dev *ena_dev,netdev_err (ena_dev->net_device,"Default llq stride ctrl is not supported, performing fallback, default: 0x%x, supported: 0x%x, used: 0x%x\n" , - llq_default_cfg->llq_stride_ctrl, - supported_feat, llq_info->desc_stride_ctrl); + llq_default_cfg->llq_stride_ctrl, supported_feat, + llq_info->desc_stride_ctrl); } }else { llq_info->desc_stride_ctrl =0 ;
@@ -704,8 +685,7 @@ static int ena_com_config_llq_info(struct ena_com_dev *ena_dev, llq_info->desc_list_entry_size =256 ; }else {netdev_err (ena_dev->net_device, -"Invalid entry_size_ctrl, supported: 0x%x\n" , - supported_feat); +"Invalid entry_size_ctrl, supported: 0x%x\n" , supported_feat);return -EINVAL ; }
@@ -750,8 +730,8 @@ static int ena_com_config_llq_info(struct ena_com_dev *ena_dev,netdev_err (ena_dev->net_device,"Default llq num descs before header is not supported, performing fallback, default: 0x%x, supported: 0x%x, used: 0x%x\n" , - llq_default_cfg->llq_num_decs_before_header, - supported_feat, llq_info->descs_num_before_header); + llq_default_cfg->llq_num_decs_before_header, supported_feat, + llq_info->descs_num_before_header); }/* Check for accelerated queue supported */ llq_accel_mode_get = llq_features->accel_mode.u.get;
@@ -767,8 +747,7 @@ static int ena_com_config_llq_info(struct ena_com_dev *ena_dev, rc =ena_com_set_llq (ena_dev);if (rc) -netdev_err (ena_dev->net_device, -"Cannot set LLQ configuration: %d\n" , rc); +netdev_err (ena_dev->net_device,"Cannot set LLQ configuration: %d\n" , rc);return rc; }
@@ -780,8 +759,7 @@ static int ena_com_wait_and_process_admin_cq_interrupts(struct ena_comp_ctx *comint ret;wait_for_completion_timeout (&comp_ctx->wait_event, -usecs_to_jiffies ( - admin_queue->completion_timeout)); +usecs_to_jiffies (admin_queue->completion_timeout));/* In case the command wasn't completed find out the root cause. * There might be 2 kinds of errors
@@ -797,8 +775,7 @@ static int ena_com_wait_and_process_admin_cq_interrupts(struct ena_comp_ctx *comif (comp_ctx->status ==ENA_CMD_COMPLETED ) {netdev_err (admin_queue->ena_dev->net_device,"The ena device sent a completion but the driver didn't receive a MSI-X interrupt (cmd %d), autopolling mode is %s\n" , - comp_ctx->cmd_opcode, - admin_queue->auto_polling ?"ON" :"OFF" ); + comp_ctx->cmd_opcode, admin_queue->auto_polling ?"ON" :"OFF" );/* Check if fallback to polling is enabled */ if (admin_queue->auto_polling) admin_queue->polling = true;
@@ -867,15 +844,13 @@ static u32 ena_com_reg_bar_read32(struct ena_com_dev *ena_dev, u16 offset)if (unlikely (i == timeout)) {netdev_err (ena_dev->net_device,"Reading reg failed for timeout. expected: req id[%u] offset[%u] actual: req id[%u] offset[%u]\n" , - mmio_read->seq_num, offset, read_resp->req_id, - read_resp->reg_off); + mmio_read->seq_num, offset, read_resp->req_id, read_resp->reg_off); ret =ENA_MMIO_READ_TIMEOUT ; goto err; }if (read_resp->reg_off != offset) { -netdev_err (ena_dev->net_device, -"Read failure: wrong offset provided\n" ); +netdev_err (ena_dev->net_device,"Read failure: wrong offset provided\n" ); ret =ENA_MMIO_READ_TIMEOUT ; }else { ret = read_resp->reg_val;
@@ -934,8 +909,7 @@ static int ena_com_destroy_io_sq(struct ena_com_dev *ena_dev, sizeof(destroy_resp));if (unlikely (ret && (ret != -ENODEV ))) -netdev_err (ena_dev->net_device, -"Failed to destroy io sq error: %d\n" , ret); +netdev_err (ena_dev->net_device,"Failed to destroy io sq error: %d\n" , ret);return ret; }
@@ -949,8 +923,7 @@ static void ena_com_io_queue_free(struct ena_com_dev *ena_dev,if (io_cq->cdesc_addr.virt_addr) { size = io_cq->cdesc_entry_size_in_bytes * io_cq->q_depth; -dma_free_coherent (ena_dev->dmadev, size, - io_cq->cdesc_addr.virt_addr, +dma_free_coherent (ena_dev->dmadev, size, io_cq->cdesc_addr.virt_addr, io_cq->cdesc_addr.phys_addr); io_cq->cdesc_addr.virt_addr =NULL ;
@@ -959,8 +932,7 @@ static void ena_com_io_queue_free(struct ena_com_dev *ena_dev,if (io_sq->desc_addr.virt_addr) { size = io_sq->desc_entry_size * io_sq->q_depth; -dma_free_coherent (ena_dev->dmadev, size, - io_sq->desc_addr.virt_addr, +dma_free_coherent (ena_dev->dmadev, size, io_sq->desc_addr.virt_addr, io_sq->desc_addr.phys_addr); io_sq->desc_addr.virt_addr =NULL ;
@@ -985,8 +957,7 @@ static int wait_for_reset_state(struct ena_com_dev *ena_dev, u32 timeout, val =ena_com_reg_bar_read32 (ena_dev,ENA_REGS_DEV_STS_OFF );if (unlikely (val ==ENA_MMIO_READ_TIMEOUT )) { -netdev_err (ena_dev->net_device, -"Reg read timeout occurred\n" ); +netdev_err (ena_dev->net_device,"Reg read timeout occurred\n" );return -ETIME ; }
@@ -1026,8 +997,7 @@ static int ena_com_get_feature_ex(struct ena_com_dev *ena_dev,int ret;if (!ena_com_check_supported_feature_id (ena_dev, feature_id)) { -netdev_dbg (ena_dev->net_device,"Feature %d isn't supported\n" , - feature_id); +netdev_dbg (ena_dev->net_device,"Feature %d isn't supported\n" , feature_id);return -EOPNOTSUPP ; }
@@ -1064,8 +1034,7 @@ static int ena_com_get_feature_ex(struct ena_com_dev *ena_dev,if (unlikely (ret))netdev_err (ena_dev->net_device, -"Failed to submit get_feature command %d error: %d\n" , - feature_id, ret); +"Failed to submit get_feature command %d error: %d\n" , feature_id, ret);return ret; }
@@ -1104,13 +1073,11 @@ static int ena_com_hash_key_allocate(struct ena_com_dev *ena_dev) {struct ena_rss *rss = &ena_dev->rss; -if (!ena_com_check_supported_feature_id (ena_dev, -ENA_ADMIN_RSS_HASH_FUNCTION )) +if (!ena_com_check_supported_feature_id (ena_dev,ENA_ADMIN_RSS_HASH_FUNCTION ))return -EOPNOTSUPP ; - rss->hash_key = -dma_alloc_coherent (ena_dev->dmadev,sizeof (*rss->hash_key), - &rss->hash_key_dma_addr,GFP_KERNEL ); + rss->hash_key =dma_alloc_coherent (ena_dev->dmadev,sizeof (*rss->hash_key), + &rss->hash_key_dma_addr,GFP_KERNEL );if (unlikely (!rss->hash_key))return -ENOMEM ;
@@ -1123,8 +1090,8 @@ static void ena_com_hash_key_destroy(struct ena_com_dev *ena_dev)struct ena_rss *rss = &ena_dev->rss;if (rss->hash_key) -dma_free_coherent (ena_dev->dmadev,sizeof (*rss->hash_key), - rss->hash_key, rss->hash_key_dma_addr); +dma_free_coherent (ena_dev->dmadev,sizeof (*rss->hash_key), rss->hash_key, + rss->hash_key_dma_addr); rss->hash_key =NULL ; }
@@ -1132,9 +1099,8 @@ static int ena_com_hash_ctrl_init(struct ena_com_dev *ena_dev) {struct ena_rss *rss = &ena_dev->rss; - rss->hash_ctrl = -dma_alloc_coherent (ena_dev->dmadev,sizeof (*rss->hash_ctrl), - &rss->hash_ctrl_dma_addr,GFP_KERNEL ); + rss->hash_ctrl =dma_alloc_coherent (ena_dev->dmadev,sizeof (*rss->hash_ctrl), + &rss->hash_ctrl_dma_addr,GFP_KERNEL );if (unlikely (!rss->hash_ctrl))return -ENOMEM ;
@@ -1147,8 +1113,8 @@ static void ena_com_hash_ctrl_destroy(struct ena_com_dev *ena_dev)struct ena_rss *rss = &ena_dev->rss;if (rss->hash_ctrl) -dma_free_coherent (ena_dev->dmadev,sizeof (*rss->hash_ctrl), - rss->hash_ctrl, rss->hash_ctrl_dma_addr); +dma_free_coherent (ena_dev->dmadev,sizeof (*rss->hash_ctrl), rss->hash_ctrl, + rss->hash_ctrl_dma_addr); rss->hash_ctrl =NULL ; }
@@ -1177,15 +1143,13 @@ static int ena_com_indirect_table_allocate(struct ena_com_dev *ena_dev, tbl_size = (1ULL << log_size) *sizeof (struct ena_admin_rss_ind_table_entry ); - rss->rss_ind_tbl = -dma_alloc_coherent (ena_dev->dmadev, tbl_size, - &rss->rss_ind_tbl_dma_addr,GFP_KERNEL ); + rss->rss_ind_tbl =dma_alloc_coherent (ena_dev->dmadev, tbl_size, &rss->rss_ind_tbl_dma_addr, +GFP_KERNEL );if (unlikely (!rss->rss_ind_tbl)) goto mem_err1; tbl_size = (1ULL << log_size) *sizeof (u16); - rss->host_rss_ind_tbl = -devm_kzalloc (ena_dev->dmadev, tbl_size,GFP_KERNEL ); + rss->host_rss_ind_tbl =devm_kzalloc (ena_dev->dmadev, tbl_size,GFP_KERNEL );if (unlikely (!rss->host_rss_ind_tbl)) goto mem_err2;
@@ -1197,8 +1161,7 @@ static int ena_com_indirect_table_allocate(struct ena_com_dev *ena_dev, tbl_size = (1ULL << log_size) *sizeof (struct ena_admin_rss_ind_table_entry ); -dma_free_coherent (ena_dev->dmadev, tbl_size, rss->rss_ind_tbl, - rss->rss_ind_tbl_dma_addr); +dma_free_coherent (ena_dev->dmadev, tbl_size, rss->rss_ind_tbl, rss->rss_ind_tbl_dma_addr); rss->rss_ind_tbl =NULL ; mem_err1: rss->tbl_log_size =0 ;
@@ -1261,8 +1224,7 @@ static int ena_com_create_io_sq(struct ena_com_dev *ena_dev, &create_cmd.sq_ba, io_sq->desc_addr.phys_addr);if (unlikely (ret)) { -netdev_err (ena_dev->net_device, -"Memory address set failed\n" ); +netdev_err (ena_dev->net_device,"Memory address set failed\n" );return ret; } }
@@ -1273,8 +1235,7 @@ static int ena_com_create_io_sq(struct ena_com_dev *ena_dev, (struct ena_admin_acq_entry *)&cmd_completion, sizeof(cmd_completion));if (unlikely (ret)) { -netdev_err (ena_dev->net_device, -"Failed to create IO SQ. error: %d\n" , ret); +netdev_err (ena_dev->net_device,"Failed to create IO SQ. error: %d\n" , ret);return ret; }
@@ -1292,8 +1253,7 @@ static int ena_com_create_io_sq(struct ena_com_dev *ena_dev, cmd_completion.llq_descriptors_offset); } -netdev_dbg (ena_dev->net_device,"Created sq[%u], depth[%u]\n" , - io_sq->idx, io_sq->q_depth); +netdev_dbg (ena_dev->net_device,"Created sq[%u], depth[%u]\n" , io_sq->idx, io_sq->q_depth);return ret; }
@@ -1420,8 +1380,7 @@ int ena_com_create_io_cq(struct ena_com_dev *ena_dev, (struct ena_admin_acq_entry *)&cmd_completion, sizeof(cmd_completion));if (unlikely (ret)) { -netdev_err (ena_dev->net_device, -"Failed to create IO CQ. error: %d\n" , ret); +netdev_err (ena_dev->net_device,"Failed to create IO CQ. error: %d\n" , ret);return ret; }
@@ -1440,8 +1399,7 @@ int ena_com_create_io_cq(struct ena_com_dev *ena_dev, (u32 __iomem *)((uintptr_t )ena_dev->reg_bar + cmd_completion.numa_node_register_offset); -netdev_dbg (ena_dev->net_device,"Created cq[%u], depth[%u]\n" , - io_cq->idx, io_cq->q_depth); +netdev_dbg (ena_dev->net_device,"Created cq[%u], depth[%u]\n" , io_cq->idx, io_cq->q_depth);return ret; }
@@ -1451,8 +1409,7 @@ int ena_com_get_io_handlers(struct ena_com_dev *ena_dev, u16 qid, struct ena_com_io_cq **io_cq) {if (qid >=ENA_TOTAL_NUM_QUEUES ) { -netdev_err (ena_dev->net_device, -"Invalid queue number %d but the max is %d\n" , qid, +netdev_err (ena_dev->net_device,"Invalid queue number %d but the max is %d\n" , qid,ENA_TOTAL_NUM_QUEUES );return -EINVAL ; }
@@ -1492,8 +1449,7 @@ void ena_com_wait_for_abort_completion(struct ena_com_dev *ena_dev)spin_lock_irqsave (&admin_queue->q_lock, flags);while (atomic_read (&admin_queue->outstanding_cmds) !=0 ) {spin_unlock_irqrestore (&admin_queue->q_lock, flags); -ena_delay_exponential_backoff_us (exp++, - ena_dev->ena_min_poll_delay_us); +ena_delay_exponential_backoff_us (exp++, ena_dev->ena_min_poll_delay_us);spin_lock_irqsave (&admin_queue->q_lock, flags); }spin_unlock_irqrestore (&admin_queue->q_lock, flags);
@@ -1519,8 +1475,7 @@ int ena_com_destroy_io_cq(struct ena_com_dev *ena_dev, sizeof(destroy_resp));if (unlikely (ret && (ret != -ENODEV ))) -netdev_err (ena_dev->net_device, -"Failed to destroy IO CQ. error: %d\n" , ret); +netdev_err (ena_dev->net_device,"Failed to destroy IO CQ. error: %d\n" , ret);return ret; }
@@ -1588,8 +1543,7 @@ int ena_com_set_aenq_config(struct ena_com_dev *ena_dev, u32 groups_flag) sizeof(resp));if (unlikely (ret)) -netdev_err (ena_dev->net_device, -"Failed to config AENQ ret: %d\n" , ret); +netdev_err (ena_dev->net_device,"Failed to config AENQ ret: %d\n" , ret);return ret; }
@@ -1610,8 +1564,7 @@ int ena_com_get_dma_width(struct ena_com_dev *ena_dev)netdev_dbg (ena_dev->net_device,"ENA dma width: %d\n" , width);if ((width <32 ) || width >ENA_MAX_PHYS_ADDR_SIZE_BITS ) { -netdev_err (ena_dev->net_device,"DMA width illegal value: %d\n" , - width); +netdev_err (ena_dev->net_device,"DMA width illegal value: %d\n" , width);return -EINVAL ; }
@@ -1633,19 +1586,16 @@ int ena_com_validate_version(struct ena_com_dev *ena_dev) ctrl_ver =ena_com_reg_bar_read32 (ena_dev,ENA_REGS_CONTROLLER_VERSION_OFF ); -if (unlikely ((ver ==ENA_MMIO_READ_TIMEOUT ) || - (ctrl_ver ==ENA_MMIO_READ_TIMEOUT ))) { +if (unlikely ((ver ==ENA_MMIO_READ_TIMEOUT ) || (ctrl_ver ==ENA_MMIO_READ_TIMEOUT ))) {netdev_err (ena_dev->net_device,"Reg read timeout occurred\n" );return -ETIME ; }dev_info (ena_dev->dmadev,"ENA device version: %d.%d\n" , - (ver &ENA_REGS_VERSION_MAJOR_VERSION_MASK ) >> -ENA_REGS_VERSION_MAJOR_VERSION_SHIFT , + (ver &ENA_REGS_VERSION_MAJOR_VERSION_MASK ) >>ENA_REGS_VERSION_MAJOR_VERSION_SHIFT , ver &ENA_REGS_VERSION_MINOR_VERSION_MASK ); - dev_info(ena_dev->dmadev, - "ENA controller version: %d.%d.%d implementation version %d\n", + dev_info(ena_dev->dmadev, "ENA controller version: %d.%d.%d implementation version %d\n", (ctrl_ver & ENA_REGS_CONTROLLER_VERSION_MAJOR_VERSION_MASK) >> ENA_REGS_CONTROLLER_VERSION_MAJOR_VERSION_SHIFT, (ctrl_ver & ENA_REGS_CONTROLLER_VERSION_MINOR_VERSION_MASK) >>
@@ -1694,20 +1644,17 @@ void ena_com_admin_destroy(struct ena_com_dev *ena_dev) size =ADMIN_SQ_SIZE (admin_queue->q_depth);if (sq->entries) -dma_free_coherent (ena_dev->dmadev, size, sq->entries, - sq->dma_addr); +dma_free_coherent (ena_dev->dmadev, size, sq->entries, sq->dma_addr); sq->entries =NULL ; size =ADMIN_CQ_SIZE (admin_queue->q_depth);if (cq->entries) -dma_free_coherent (ena_dev->dmadev, size, cq->entries, - cq->dma_addr); +dma_free_coherent (ena_dev->dmadev, size, cq->entries, cq->dma_addr); cq->entries =NULL ; size =ADMIN_AENQ_SIZE (aenq->q_depth);if (ena_dev->aenq.entries) -dma_free_coherent (ena_dev->dmadev, size, aenq->entries, - aenq->dma_addr); +dma_free_coherent (ena_dev->dmadev, size, aenq->entries, aenq->dma_addr); aenq->entries =NULL ; }
@@ -1733,10 +1680,8 @@ int ena_com_mmio_reg_read_request_init(struct ena_com_dev *ena_dev)struct ena_com_mmio_read *mmio_read = &ena_dev->mmio_read;spin_lock_init (&mmio_read->lock); - mmio_read->read_resp = -dma_alloc_coherent (ena_dev->dmadev, -sizeof (*mmio_read->read_resp), - &mmio_read->read_resp_dma_addr,GFP_KERNEL ); + mmio_read->read_resp =dma_alloc_coherent (ena_dev->dmadev,sizeof (*mmio_read->read_resp), + &mmio_read->read_resp_dma_addr,GFP_KERNEL );if (unlikely (!mmio_read->read_resp)) goto err;
@@ -1767,8 +1712,8 @@ void ena_com_mmio_reg_read_request_destroy(struct ena_com_dev *ena_dev)writel (0x0 , ena_dev->reg_bar +ENA_REGS_MMIO_RESP_LO_OFF );writel (0x0 , ena_dev->reg_bar +ENA_REGS_MMIO_RESP_HI_OFF ); -dma_free_coherent (ena_dev->dmadev,sizeof (*mmio_read->read_resp), - mmio_read->read_resp, mmio_read->read_resp_dma_addr); +dma_free_coherent (ena_dev->dmadev,sizeof (*mmio_read->read_resp), mmio_read->read_resp, + mmio_read->read_resp_dma_addr); mmio_read->read_resp =NULL ; }
@@ -1800,8 +1745,7 @@ int ena_com_admin_init(struct ena_com_dev *ena_dev, }if (!(dev_sts &ENA_REGS_DEV_STS_READY_MASK )) { -netdev_err (ena_dev->net_device, -"Device isn't ready, abort com init\n" ); +netdev_err (ena_dev->net_device,"Device isn't ready, abort com init\n" );return -ENODEV ; }
@@ -1878,8 +1822,7 @@ int ena_com_create_io_queue(struct ena_com_dev *ena_dev,int ret;if (ctx->qid >=ENA_TOTAL_NUM_QUEUES ) { -netdev_err (ena_dev->net_device, -"Qid (%d) is bigger than max num of queues (%d)\n" , +netdev_err (ena_dev->net_device,"Qid (%d) is bigger than max num of queues (%d)\n" , ctx->qid,ENA_TOTAL_NUM_QUEUES );return -EINVAL ; }
@@ -1905,8 +1848,7 @@ int ena_com_create_io_queue(struct ena_com_dev *ena_dev,if (ctx->direction ==ENA_COM_IO_QUEUE_DIRECTION_TX )/* header length is limited to 8 bits */ - io_sq->tx_max_header_size = -min_t (u32, ena_dev->tx_max_header_size,SZ_256 ); + io_sq->tx_max_header_size =min_t (u32, ena_dev->tx_max_header_size,SZ_256 ); ret =ena_com_init_io_sq (ena_dev, ctx, io_sq);if (ret)
@@ -1938,8 +1880,7 @@ void ena_com_destroy_io_queue(struct ena_com_dev *ena_dev, u16 qid)struct ena_com_io_cq *io_cq;if (qid >=ENA_TOTAL_NUM_QUEUES ) { -netdev_err (ena_dev->net_device, -"Qid (%d) is bigger than max num of queues (%d)\n" , +netdev_err (ena_dev->net_device,"Qid (%d) is bigger than max num of queues (%d)\n" , qid,ENA_TOTAL_NUM_QUEUES );return ; }
@@ -1983,8 +1924,7 @@ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_dev,if (rc)return rc; -if (get_resp.u.max_queue_ext.version != -ENA_FEATURE_MAX_QUEUE_EXT_VER ) +if (get_resp.u.max_queue_ext.version !=ENA_FEATURE_MAX_QUEUE_EXT_VER )return -EINVAL ; memcpy(&get_feat_ctx->max_queue_ext, &get_resp.u.max_queue_ext,
@@ -2025,18 +1965,15 @@ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_dev, rc =ena_com_get_feature (ena_dev, &get_resp,ENA_ADMIN_HW_HINTS ,0 );if (!rc) -memcpy (&get_feat_ctx->hw_hints, &get_resp.u.hw_hints, -sizeof (get_resp.u.hw_hints)); +memcpy (&get_feat_ctx->hw_hints, &get_resp.u.hw_hints,sizeof (get_resp.u.hw_hints));else if (rc == -EOPNOTSUPP ) -memset (&get_feat_ctx->hw_hints,0x0 , -sizeof (get_feat_ctx->hw_hints)); +memset (&get_feat_ctx->hw_hints,0x0 ,sizeof (get_feat_ctx->hw_hints));else return rc; rc =ena_com_get_feature (ena_dev, &get_resp,ENA_ADMIN_LLQ ,0 );if (!rc) -memcpy (&get_feat_ctx->llq, &get_resp.u.llq, -sizeof (get_resp.u.llq)); +memcpy (&get_feat_ctx->llq, &get_resp.u.llq,sizeof (get_resp.u.llq));else if (rc == -EOPNOTSUPP )memset (&get_feat_ctx->llq,0x0 ,sizeof (get_feat_ctx->llq));else
@@ -2084,8 +2021,7 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *ena_dev, void *data) aenq_common = &aenq_e->aenq_common_desc;/* Go over all the events */ -while ((READ_ONCE (aenq_common->flags) & -ENA_ADMIN_AENQ_COMMON_DESC_PHASE_MASK ) == phase) { +while ((READ_ONCE (aenq_common->flags) &ENA_ADMIN_AENQ_COMMON_DESC_PHASE_MASK ) == phase) {/* Make sure the phase bit (ownership) is as expected before * reading the rest of the descriptor. */
@@ -2094,8 +2030,7 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *ena_dev, void *data) timestamp = (u64 )aenq_common->timestamp_low | ((u64 )aenq_common->timestamp_high <<32 ); -netdev_dbg (ena_dev->net_device, -"AENQ! Group[%x] Syndrome[%x] timestamp: [%llus]\n" , +netdev_dbg (ena_dev->net_device,"AENQ! Group[%x] Syndrome[%x] timestamp: [%llus]\n" , aenq_common->group, aenq_common->syndrome, timestamp);/* Handle specific event*/
@@ -2124,8 +2059,7 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *ena_dev, void *data)/* write the aenq doorbell after all AENQ descriptors were read */ mb (); -writel_relaxed ((u32 )aenq->head, - ena_dev->reg_bar +ENA_REGS_AENQ_HEAD_DB_OFF ); +writel_relaxed ((u32 )aenq->head, ena_dev->reg_bar +ENA_REGS_AENQ_HEAD_DB_OFF ); } int ena_com_dev_reset(struct ena_com_dev *ena_dev,
@@ -2137,15 +2071,13 @@ int ena_com_dev_reset(struct ena_com_dev *ena_dev, stat =ena_com_reg_bar_read32 (ena_dev,ENA_REGS_DEV_STS_OFF ); cap =ena_com_reg_bar_read32 (ena_dev,ENA_REGS_CAPS_OFF ); -if (unlikely ((stat ==ENA_MMIO_READ_TIMEOUT ) || - (cap ==ENA_MMIO_READ_TIMEOUT ))) { +if (unlikely ((stat ==ENA_MMIO_READ_TIMEOUT ) || (cap ==ENA_MMIO_READ_TIMEOUT ))) {netdev_err (ena_dev->net_device,"Reg read32 timeout occurred\n" );return -ETIME ; }if ((stat &ENA_REGS_DEV_STS_READY_MASK ) ==0 ) { -netdev_err (ena_dev->net_device, -"Device isn't ready, can't reset device\n" ); +netdev_err (ena_dev->net_device,"Device isn't ready, can't reset device\n" );return -EINVAL ; }
@@ -2168,8 +2100,7 @@ int ena_com_dev_reset(struct ena_com_dev *ena_dev, rc =wait_for_reset_state (ena_dev, timeout,ENA_REGS_DEV_STS_RESET_IN_PROGRESS_MASK );if (rc !=0 ) { -netdev_err (ena_dev->net_device, -"Reset indication didn't turn on\n" ); +netdev_err (ena_dev->net_device,"Reset indication didn't turn on\n" );return rc; }
@@ -2177,8 +2108,7 @@ int ena_com_dev_reset(struct ena_com_dev *ena_dev,writel (0 , ena_dev->reg_bar +ENA_REGS_DEV_CTL_OFF ); rc =wait_for_reset_state (ena_dev, timeout,0 );if (rc !=0 ) { -netdev_err (ena_dev->net_device, -"Reset indication didn't turn off\n" ); +netdev_err (ena_dev->net_device,"Reset indication didn't turn off\n" );return rc; }
@@ -2215,8 +2145,7 @@ static int ena_get_dev_stats(struct ena_com_dev *ena_dev, sizeof(*get_resp));if (unlikely (ret)) -netdev_err (ena_dev->net_device, -"Failed to get stats. error: %d\n" , ret); +netdev_err (ena_dev->net_device,"Failed to get stats. error: %d\n" , ret);return ret; }
@@ -2228,8 +2157,7 @@ int ena_com_get_eni_stats(struct ena_com_dev *ena_dev,int ret;if (!ena_com_get_cap (ena_dev,ENA_ADMIN_ENI_STATS )) { -netdev_err (ena_dev->net_device, -"Capability %d isn't supported\n" , +netdev_err (ena_dev->net_device,"Capability %d isn't supported\n" ,ENA_ADMIN_ENI_STATS );return -EOPNOTSUPP ; }
@@ -2266,8 +2194,7 @@ int ena_com_set_dev_mtu(struct ena_com_dev *ena_dev, u32 mtu)int ret;if (!ena_com_check_supported_feature_id (ena_dev,ENA_ADMIN_MTU )) { -netdev_dbg (ena_dev->net_device,"Feature %d isn't supported\n" , -ENA_ADMIN_MTU ); +netdev_dbg (ena_dev->net_device,"Feature %d isn't supported\n" ,ENA_ADMIN_MTU );return -EOPNOTSUPP ; }
@@ -2286,8 +2213,7 @@ int ena_com_set_dev_mtu(struct ena_com_dev *ena_dev, u32 mtu) sizeof(resp));if (unlikely (ret)) -netdev_err (ena_dev->net_device, -"Failed to set mtu %d. error: %d\n" , mtu, ret); +netdev_err (ena_dev->net_device,"Failed to set mtu %d. error: %d\n" , mtu, ret);return ret; }
@@ -2301,8 +2227,7 @@ int ena_com_get_offload_settings(struct ena_com_dev *ena_dev, ret =ena_com_get_feature (ena_dev, &resp,ENA_ADMIN_STATELESS_OFFLOAD_CONFIG ,0 );if (unlikely (ret)) { -netdev_err (ena_dev->net_device, -"Failed to get offload capabilities %d\n" , ret); +netdev_err (ena_dev->net_device,"Failed to get offload capabilities %d\n" , ret);return ret; }
@@ -2320,8 +2245,7 @@ int ena_com_set_hash_function(struct ena_com_dev *ena_dev)struct ena_admin_get_feat_resp get_resp;int ret; -if (!ena_com_check_supported_feature_id (ena_dev, -ENA_ADMIN_RSS_HASH_FUNCTION )) { +if (!ena_com_check_supported_feature_id (ena_dev,ENA_ADMIN_RSS_HASH_FUNCTION )) {netdev_dbg (ena_dev->net_device,"Feature %d isn't supported\n" ,ENA_ADMIN_RSS_HASH_FUNCTION );return -EOPNOTSUPP ;
@@ -2334,8 +2258,7 @@ int ena_com_set_hash_function(struct ena_com_dev *ena_dev)return ret;if (!(get_resp.u.flow_hash_func.supported_func &BIT (rss->hash_func))) { -netdev_err (ena_dev->net_device, -"Func hash %d isn't supported by device, abort\n" , +netdev_err (ena_dev->net_device,"Func hash %d isn't supported by device, abort\n" , rss->hash_func);return -EOPNOTSUPP ; }
@@ -2365,8 +2288,7 @@ int ena_com_set_hash_function(struct ena_com_dev *ena_dev) (struct ena_admin_acq_entry *)&resp, sizeof(resp));if (unlikely (ret)) { -netdev_err (ena_dev->net_device, -"Failed to set hash function %d. error: %d\n" , +netdev_err (ena_dev->net_device,"Failed to set hash function %d. error: %d\n" , rss->hash_func, ret);return -EINVAL ; }
@@ -2398,16 +2320,15 @@ int ena_com_fill_hash_function(struct ena_com_dev *ena_dev,return rc;if (!(BIT (func) & get_resp.u.flow_hash_func.supported_func)) { -netdev_err (ena_dev->net_device, -"Flow hash function %d isn't supported\n" , func); +netdev_err (ena_dev->net_device,"Flow hash function %d isn't supported\n" , func);return -EOPNOTSUPP ; }if ((func ==ENA_ADMIN_TOEPLITZ ) && key) {if (key_len !=sizeof (hash_key->key)) {netdev_err (ena_dev->net_device, -"key len (%u) doesn't equal the supported size (%zu)\n" , - key_len,sizeof (hash_key->key)); +"key len (%u) doesn't equal the supported size (%zu)\n" , key_len, +sizeof (hash_key->key));return -EINVAL ; }memcpy (hash_key->key, key, key_len);
@@ -2495,8 +2416,7 @@ int ena_com_set_hash_ctrl(struct ena_com_dev *ena_dev)struct ena_admin_set_feat_resp resp;int ret; -if (!ena_com_check_supported_feature_id (ena_dev, -ENA_ADMIN_RSS_HASH_INPUT )) { +if (!ena_com_check_supported_feature_id (ena_dev,ENA_ADMIN_RSS_HASH_INPUT )) {netdev_dbg (ena_dev->net_device,"Feature %d isn't supported\n" ,ENA_ADMIN_RSS_HASH_INPUT );return -EOPNOTSUPP ;
@@ -2527,8 +2447,7 @@ int ena_com_set_hash_ctrl(struct ena_com_dev *ena_dev) (struct ena_admin_acq_entry *)&resp, sizeof(resp));if (unlikely (ret)) -netdev_err (ena_dev->net_device, -"Failed to set hash input. error: %d\n" , ret); +netdev_err (ena_dev->net_device,"Failed to set hash input. error: %d\n" , ret);return ret; }
@@ -2605,8 +2524,7 @@ int ena_com_fill_hash_ctrl(struct ena_com_dev *ena_dev,int rc;if (proto >=ENA_ADMIN_RSS_PROTO_NUM ) { -netdev_err (ena_dev->net_device,"Invalid proto num (%u)\n" , - proto); +netdev_err (ena_dev->net_device,"Invalid proto num (%u)\n" , proto);return -EINVAL ; }
@@ -2658,8 +2576,7 @@ int ena_com_indirect_table_set(struct ena_com_dev *ena_dev)struct ena_admin_set_feat_resp resp;int ret; -if (!ena_com_check_supported_feature_id ( - ena_dev,ENA_ADMIN_RSS_INDIRECTION_TABLE_CONFIG )) { +if (!ena_com_check_supported_feature_id (ena_dev,ENA_ADMIN_RSS_INDIRECTION_TABLE_CONFIG )) {netdev_dbg (ena_dev->net_device,"Feature %d isn't supported\n" ,ENA_ADMIN_RSS_INDIRECTION_TABLE_CONFIG );return -EOPNOTSUPP ;
@@ -2699,8 +2616,7 @@ int ena_com_indirect_table_set(struct ena_com_dev *ena_dev) sizeof(resp));if (unlikely (ret)) -netdev_err (ena_dev->net_device, -"Failed to set indirect table. error: %d\n" , ret); +netdev_err (ena_dev->net_device,"Failed to set indirect table. error: %d\n" , ret);return ret; }
@@ -2779,9 +2695,8 @@ int ena_com_allocate_host_info(struct ena_com_dev *ena_dev) {struct ena_host_attribute *host_attr = &ena_dev->host_attr; - host_attr->host_info = -dma_alloc_coherent (ena_dev->dmadev,SZ_4K , - &host_attr->host_info_dma_addr,GFP_KERNEL ); + host_attr->host_info =dma_alloc_coherent (ena_dev->dmadev,SZ_4K , + &host_attr->host_info_dma_addr,GFP_KERNEL );if (unlikely (!host_attr->host_info))return -ENOMEM ;
@@ -2827,8 +2742,7 @@ void ena_com_delete_debug_area(struct ena_com_dev *ena_dev)if (host_attr->debug_area_virt_addr) {dma_free_coherent (ena_dev->dmadev, host_attr->debug_area_size, - host_attr->debug_area_virt_addr, - host_attr->debug_area_dma_addr); + host_attr->debug_area_virt_addr, host_attr->debug_area_dma_addr); host_attr->debug_area_virt_addr =NULL ; } }
@@ -2877,8 +2791,7 @@ int ena_com_set_host_attributes(struct ena_com_dev *ena_dev) sizeof(resp));if (unlikely (ret)) -netdev_err (ena_dev->net_device, -"Failed to set host attributes: %d\n" , ret); +netdev_err (ena_dev->net_device,"Failed to set host attributes: %d\n" , ret);return ret; }
@@ -2896,8 +2809,7 @@ static int ena_com_update_nonadaptive_moderation_interval(struct ena_com_dev *en u32 *intr_moder_interval) {if (!intr_delay_resolution) { -netdev_err (ena_dev->net_device, -"Illegal interrupt delay granularity value\n" ); +netdev_err (ena_dev->net_device,"Illegal interrupt delay granularity value\n" );return -EFAULT ; }
@@ -2935,14 +2847,12 @@ int ena_com_init_interrupt_moderation(struct ena_com_dev *ena_dev)if (rc) {if (rc == -EOPNOTSUPP ) { -netdev_dbg (ena_dev->net_device, -"Feature %d isn't supported\n" , +netdev_dbg (ena_dev->net_device,"Feature %d isn't supported\n" ,ENA_ADMIN_INTERRUPT_MODERATION ); rc =0 ; }else {netdev_err (ena_dev->net_device, -"Failed to get interrupt moderation admin cmd. rc: %d\n" , - rc); +"Failed to get interrupt moderation admin cmd. rc: %d\n" , rc); }/* no moderation supported, disable adaptive support */
@@ -2990,8 +2900,7 @@ int ena_com_config_dev_mode(struct ena_com_dev *ena_dev, (llq_info->descs_num_before_header *sizeof (struct ena_eth_io_tx_desc ));if (unlikely (ena_dev->tx_max_header_size ==0 )) { -netdev_err (ena_dev->net_device, -"The size of the LLQ entry is smaller than needed\n" ); +netdev_err (ena_dev->net_device,"The size of the LLQ entry is smaller than needed\n" );return -EINVAL ; }
drivers/net/ethernet/amazon/ena/ena_eth_com.c +20 -29
127 lines not on this page · raw message
drivers/net/ethernet/amazon/ena/ena_eth_com.h +7 -8
@@ -141,8 +141,8 @@ static inline bool ena_com_is_doorbell_needed(struct ena_com_io_sq *io_sq, }netdev_dbg (ena_com_io_sq_to_ena_dev (io_sq)->net_device, -"Queue: %d num_descs: %d num_entries_needed: %d\n" , - io_sq->qid, num_descs, num_entries_needed); +"Queue: %d num_descs: %d num_entries_needed: %d\n" , io_sq->qid, num_descs, + num_entries_needed);return num_entries_needed > io_sq->entries_in_tx_burst_left; }
@@ -153,15 +153,14 @@ static inline int ena_com_write_sq_doorbell(struct ena_com_io_sq *io_sq)u16 tail = io_sq->tail;netdev_dbg (ena_com_io_sq_to_ena_dev (io_sq)->net_device, -"Write submission queue doorbell for queue: %d tail: %d\n" , - io_sq->qid, tail); +"Write submission queue doorbell for queue: %d tail: %d\n" , io_sq->qid, tail);writel (tail, io_sq->db_addr);if (is_llq_max_tx_burst_exists (io_sq)) {netdev_dbg (ena_com_io_sq_to_ena_dev (io_sq)->net_device, -"Reset available entries in tx burst for queue %d to %d\n" , - io_sq->qid, max_entries_in_tx_burst); +"Reset available entries in tx burst for queue %d to %d\n" , io_sq->qid, + max_entries_in_tx_burst); io_sq->entries_in_tx_burst_left = max_entries_in_tx_burst; }
@@ -244,8 +243,8 @@ static inline int ena_com_tx_comp_req_id_get(struct ena_com_io_cq *io_cq, *req_id =READ_ONCE (cdesc->req_id);if (unlikely (*req_id >= io_cq->q_depth)) { -netdev_err (ena_com_io_cq_to_ena_dev (io_cq)->net_device, -"Invalid req id %d\n" , cdesc->req_id); +netdev_err (ena_com_io_cq_to_ena_dev (io_cq)->net_device,"Invalid req id %d\n" , + cdesc->req_id);return -EINVAL ; }
drivers/net/ethernet/amazon/ena/ena_netdev.c +12 -20
@@ -164,11 +164,9 @@ static int ena_xmit_common(struct net_device *dev,if (unlikely (rc)) {netif_err (adapter, tx_queued, dev,"Failed to prepare tx bufs\n" ); -ena_increase_stat (&ring->tx_stats.prepare_ctx_err,1 , - &ring->syncp); +ena_increase_stat (&ring->tx_stats.prepare_ctx_err,1 , &ring->syncp);if (rc != -ENOMEM ) -ena_reset_device (adapter, -ENA_REGS_RESET_DRIVER_INVALID_STATE ); +ena_reset_device (adapter,ENA_REGS_RESET_DRIVER_INVALID_STATE );return rc; }
@@ -992,8 +990,7 @@ static struct page *ena_alloc_map_page(struct ena_ring *rx_ring,*/ page =dev_alloc_page ();if (!page) { -ena_increase_stat (&rx_ring->rx_stats.page_alloc_fail,1 , - &rx_ring->syncp); +ena_increase_stat (&rx_ring->rx_stats.page_alloc_fail,1 , &rx_ring->syncp);return ERR_PTR (-ENOSPC ); }
@@ -1052,8 +1049,8 @@ static void ena_unmap_rx_buff_attrs(struct ena_ring *rx_ring,struct ena_rx_buffer *rx_info, unsigned long attrs) { - dma_unmap_page_attrs(rx_ring->dev, rx_info->dma_addr, ENA_PAGE_SIZE, -DMA_BIDIRECTIONAL ,attrs ); + dma_unmap_page_attrs(rx_ring->dev, rx_info->dma_addr, ENA_PAGE_SIZE, DMA_BIDIRECTIONAL, +attrs ); } static void ena_free_rx_page(struct ena_ring *rx_ring,
@@ -1344,8 +1341,7 @@ static int ena_clean_tx_irq(struct ena_ring *tx_ring, u32 budget) &req_id);if (rc) {if (unlikely (rc == -EINVAL )) -handle_invalid_req_id (tx_ring, req_id,NULL , - false); +handle_invalid_req_id (tx_ring, req_id,NULL , false);break ; }
@@ -1583,8 +1579,7 @@ static struct sk_buff *ena_rx_skb(struct ena_ring *rx_ring, DMA_FROM_DEVICE);if (!reuse_rx_buf_page) -ena_unmap_rx_buff_attrs (rx_ring, rx_info, -DMA_ATTR_SKIP_CPU_SYNC ); +ena_unmap_rx_buff_attrs (rx_ring, rx_info,DMA_ATTR_SKIP_CPU_SYNC );skb_add_rx_frag (skb,skb_shinfo (skb)->nr_frags, rx_info->page, page_offset + buf_offset, len, buf_len);
@@ -1849,8 +1844,7 @@ static int ena_clean_rx_irq(struct ena_ring *rx_ring, struct napi_struct *napi, adapter =netdev_priv (rx_ring->netdev);if (rc == -ENOSPC ) { -ena_increase_stat (&rx_ring->rx_stats.bad_desc_num,1 , - &rx_ring->syncp); +ena_increase_stat (&rx_ring->rx_stats.bad_desc_num,1 , &rx_ring->syncp);ena_reset_device (adapter,ENA_REGS_RESET_TOO_MANY_RX_DESCS ); }else { ena_increase_stat(&rx_ring->rx_stats.bad_req_id, 1,
@@ -2397,8 +2391,7 @@ static int ena_rss_configure(struct ena_adapter *adapter)if (!ena_dev->rss.tbl_log_size) { rc =ena_rss_init_default (adapter);if (rc && (rc != -EOPNOTSUPP )) { -netif_err (adapter, ifup, adapter->netdev, -"Failed to init RSS rc: %d\n" , rc); +netif_err (adapter, ifup, adapter->netdev,"Failed to init RSS rc: %d\n" , rc);return rc; } }
@@ -3315,8 +3308,7 @@ static void ena_config_debug_area(struct ena_adapter *adapter) rc =ena_com_set_host_attributes (adapter->ena_dev);if (rc) {if (rc == -EOPNOTSUPP ) -netif_warn (adapter, drv, adapter->netdev, -"Cannot set host attributes\n" ); +netif_warn (adapter, drv, adapter->netdev,"Cannot set host attributes\n" );else netif_err (adapter, drv, adapter->netdev,"Cannot set host attributes\n" );
@@ -4188,8 +4180,8 @@ static int ena_rss_init_default(struct ena_adapter *adapter) } } - rc =ena_com_fill_hash_function (ena_dev,ENA_ADMIN_TOEPLITZ ,NULL , -ENA_HASH_KEY_SIZE ,0xFFFFFFFF ); + rc =ena_com_fill_hash_function (ena_dev,ENA_ADMIN_TOEPLITZ ,NULL ,ENA_HASH_KEY_SIZE , +0xFFFFFFFF );if (unlikely (rc && (rc != -EOPNOTSUPP ))) {dev_err (dev,"Cannot fill hash function\n" ); goto err_fill_indir;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 331/402 net: ena: Fix redundant device NUMA node override
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shay Agroskin <[email protected]>
[ Upstream commit 2dc8b1e7177d4f49f492ce648440caf2de0c3616 ]
The driver overrides the NUMA node id of the device regardless of whether it knows its correct value (often setting it to -1 even though the node id is advertised in 'struct device'). This can lead to suboptimal configurations.
This patch fixes this behavior and makes the shared memory allocation functions use the NUMA node id advertised by the underlying device.
--- drivers/net/ethernet/amazon/ena/ena_com.c | 11 ----------- 1 file changed, 11 deletions(-)
drivers/net/ethernet/amazon/ena/ena_com.c +0 -11
@@ -312,7 +312,6 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_dev, struct ena_com_io_sq *io_sq) {size_t size; -int dev_node =0 ;memset (&io_sq->desc_addr,0x0 ,sizeof (io_sq->desc_addr));
@@ -325,12 +324,9 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_dev, size = io_sq->desc_entry_size * io_sq->q_depth;if (io_sq->mem_queue_type ==ENA_ADMIN_PLACEMENT_POLICY_HOST ) { - dev_node =dev_to_node (ena_dev->dmadev); -set_dev_node (ena_dev->dmadev, ctx->numa_node); io_sq->desc_addr.virt_addr =dma_alloc_coherent (ena_dev->dmadev, size, &io_sq->desc_addr.phys_addr,GFP_KERNEL ); -set_dev_node (ena_dev->dmadev, dev_node);if (!io_sq->desc_addr.virt_addr) { io_sq->desc_addr.virt_addr = dma_alloc_coherent(ena_dev->dmadev, size,
@@ -354,10 +350,7 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_dev, size = (size_t )io_sq->bounce_buf_ctrl.buffer_size * io_sq->bounce_buf_ctrl.buffers_num; - dev_node =dev_to_node (ena_dev->dmadev); -set_dev_node (ena_dev->dmadev, ctx->numa_node); io_sq->bounce_buf_ctrl.base_buffer =devm_kzalloc (ena_dev->dmadev, size,GFP_KERNEL ); -set_dev_node (ena_dev->dmadev, dev_node);if (!io_sq->bounce_buf_ctrl.base_buffer) io_sq->bounce_buf_ctrl.base_buffer =devm_kzalloc (ena_dev->dmadev, size,GFP_KERNEL );
@@ -397,7 +390,6 @@ static int ena_com_init_io_cq(struct ena_com_dev *ena_dev, struct ena_com_io_cq *io_cq) {size_t size; -int prev_node =0 ;memset (&io_cq->cdesc_addr,0x0 ,sizeof (io_cq->cdesc_addr));
@@ -409,11 +401,8 @@ static int ena_com_init_io_cq(struct ena_com_dev *ena_dev, size = io_cq->cdesc_entry_size_in_bytes * io_cq->q_depth; - prev_node =dev_to_node (ena_dev->dmadev); -set_dev_node (ena_dev->dmadev, ctx->numa_node); io_cq->cdesc_addr.virt_addr =dma_alloc_coherent (ena_dev->dmadev, size, &io_cq->cdesc_addr.phys_addr,GFP_KERNEL ); -set_dev_node (ena_dev->dmadev, prev_node);if (!io_cq->cdesc_addr.virt_addr) { io_cq->cdesc_addr.virt_addr = dma_alloc_coherent(ena_dev->dmadev, size, &io_cq->cdesc_addr.phys_addr,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 332/402 ipvlan: Dont Use skb->sk in ipvlan_process_v{4,6}_outbound
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yue Haibing <[email protected]>
[ Upstream commit b3dc6e8003b500861fa307e9a3400c52e78e4d3a ]
Raw packet from PF_PACKET socket ontop of an IPv6-backed ipvlan device will hit WARN_ON_ONCE() in sk_mc_loop() through sch_direct_xmit() path.
WARNING: CPU: 2 PID: 0 at net/core/sock.c:775 sk_mc_loop+0x2d/0x70 Modules linked in: sch_netem ipvlan rfkill cirrus drm_shmem_helper sg drm_kms_helper CPU: 2 PID: 0 Comm: swapper/2 Kdump: loaded Not tainted 6.9.0+ #279 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 RIP: 0010:sk_mc_loop+0x2d/0x70 Code: fa 0f 1f 44 00 00 65 0f b7 15 f7 96 a3 4f 31 c0 66 85 d2 75 26 48 85 ff 74 1c RSP: 0018:ffffa9584015cd78 EFLAGS: 00010212 RAX: 0000000000000011 RBX: ffff91e585793e00 RCX: 0000000002c6a001 RDX: 0000000000000000 RSI: 0000000000000040 RDI: ffff91e589c0f000 RBP: ffff91e5855bd100 R08: 0000000000000000 R09: 3d00545216f43d00 R10: ffff91e584fdcc50 R11: 00000060dd8616f4 R12: ffff91e58132d000 R13: ffff91e584fdcc68 R14: ffff91e5869ce800 R15: ffff91e589c0f000 FS: 0000000000000000(0000) GS:ffff91e898100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f788f7c44c0 CR3: 0000000008e1a000 CR4: 00000000000006f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <IRQ> ? __warn (kernel/panic.c:693) ? sk_mc_loop (net/core/sock.c:760) ? report_bug (lib/bug.c:201 lib/bug.c:219) ? handle_bug (arch/x86/kernel/traps.c:239) ? exc_invalid_op (arch/x86/kernel/traps.c:260 (discriminator 1)) ? asm_exc_invalid_op (./arch/x86/include/asm/idtentry.h:621) ? sk_mc_loop (net/core/sock.c:760) ip6_finish_output2 (net/ipv6/ip6_output.c:83 (discriminator 1)) ? nf_hook_slow (net/netfilter/core.c:626) ip6_finish_output (net/ipv6/ip6_output.c:222) ? __pfx_ip6_finish_output (net/ipv6/ip6_output.c:215) ipvlan_xmit_mode_l3 (drivers/net/ipvlan/ipvlan_core.c:602) ipvlan ipvlan_start_xmit (drivers/net/ipvlan/ipvlan_main.c:226) ipvlan dev_hard_start_xmit (net/core/dev.c:3594) sch_direct_xmit (net/sched/sch_generic.c:343) __qdisc_run (net/sched/sch_generic.c:416) net_tx_action (net/core/dev.c:5286) handle_softirqs (kernel/softirq.c:555) __irq_exit_rcu (kernel/softirq.c:589) sysvec_apic_timer_interrupt (arch/x86/kernel/apic/apic.c:1043)
The warning triggers as this:packet_sendmsg
packet_snd //skb->sk is packet sk
__dev_queue_xmit
__dev_xmit_skb //q->enqueue is not NULL
__qdisc_run
sch_direct_xmit
dev_hard_start_xmit
ipvlan_start_xmit
ipvlan_xmit_mode_l3 //l3 mode
ipvlan_process_outbound //vepa flag
ipvlan_process_v6_outbound
ip6_local_out
__ip6_finish_output
ip6_finish_output2 //multicast packet
sk_mc_loop //sk->sk_family is AF_PACKETCall ip{6}_local_out() with NULL sk in ipvlan as other tunnels to fix this.
--- drivers/net/ipvlan/ipvlan_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ipvlan/ipvlan_core.c +2 -2
@@ -440,7 +440,7 @@ static noinline_for_stack int ipvlan_process_v4_outbound(struct sk_buff *skb)memset (IPCB (skb),0 ,sizeof (*IPCB (skb))); - err =ip_local_out (net, skb->sk, skb); + err =ip_local_out (net,NULL , skb);if (unlikely (net_xmit_eval (err)))DEV_STATS_INC (dev, tx_errors);else
@@ -495,7 +495,7 @@ static int ipvlan_process_v6_outbound(struct sk_buff *skb)memset (IP6CB (skb),0 ,sizeof (*IP6CB (skb))); - err =ip6_local_out (dev_net (dev), skb->sk, skb); + err =ip6_local_out (dev_net (dev),NULL , skb);if (unlikely (net_xmit_eval (err)))DEV_STATS_INC (dev, tx_errors);else
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 333/402 hwmon: (shtc1) Fix property misspelling
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guenter Roeck <[email protected]>
[ Upstream commit 52a2c70c3ec555e670a34dd1ab958986451d2dd2 ]
The property name is "sensirion,low-precision", not "sensicon,low-precision".
--- drivers/hwmon/shtc1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/shtc1.c +1 -1
@@ -238,7 +238,7 @@ static int shtc1_probe(struct i2c_client *client)if (np) { data->setup.blocking_io =of_property_read_bool (np,"sensirion,blocking-io" ); - data->setup.high_precision = !of_property_read_bool (np,"sensicon,low-precision" ); + data->setup.high_precision = !of_property_read_bool (np,"sensirion,low-precision" ); }else {if (client->dev.platform_data) data->setup = *(struct shtc1_platform_data *)dev->platform_data;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 334/402 ALSA: timer: Set lower bound of start tick time
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 4a63bd179fa8d3fcc44a0d9d71d941ddd62f0c4e upstream.
Currently ALSA timer doesn't have the lower limit of the start tick time, and it allows a very small size, e.g. 1 tick with 1ns resolution for hrtimer. Such a situation may lead to an unexpected RCU stall, where the callback repeatedly queuing the expire update, as reported by fuzzer.
This patch introduces a sanity check of the timer start tick time, so that the system returns an error when a too small start size is set. As of this patch, the lower limit is hard-coded to 100us, which is small enough but can still work somehow.
[ backport note: the error handling is changed, as the original commit
is based on the recent cleanup with guard() in commit beb45974dd49 -- tiwai ]
--- sound/core/timer.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
sound/core/timer.c +10 -0
@@ -553,6 +553,16 @@ static int snd_timer_start1(struct snd_t goto unlock; } +/* check the actual time for the start tick; +* bail out as error if it's way too low (< 100us) +*/ +if (start) { +if ((u64 )snd_timer_hw_resolution (timer) * ticks <100000 ) { + result = -EINVAL ; + goto unlock; + } + } +if (start) timeri->ticks = timeri->cticks = ticks;else if (!timeri->cticks)
Greg Kroah-Hartman
maintainerPATCH 335/402 KVM: x86: Dont advertise guest.MAXPHYADDR as host.MAXPHYADDR in CPUID
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gerd Hoffmann <[email protected]>
commit 6f5c9600621b4efb5c61b482d767432eb1ad3a9c upstream.
Drop KVM's propagation of GuestPhysBits (CPUID leaf 80000008, EAX[23:16]) to HostPhysBits (same leaf, EAX[7:0]) when advertising the address widths to userspace via KVM_GET_SUPPORTED_CPUID.
Per AMD, GuestPhysBits is intended for software use, and physical CPUs do not set that field. I.e. GuestPhysBits will be non-zero if and only if KVM is running as a nested hypervisor, and in that case, GuestPhysBits is NOT guaranteed to capture the CPU's effective MAXPHYADDR when running with TDP enabled.
E.g. KVM will soon use GuestPhysBits to communicate the CPU's maximum *addressable* guest physical address, which would result in KVM under- reporting PhysBits when running as an L1 on a CPU with MAXPHYADDR=52, but without 5-level paging.
--- arch/x86/kvm/cpuid.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-)
arch/x86/kvm/cpuid.c +10 -11
@@ -934,9 +934,8 @@ static inline int __do_cpuid_func(struct entry->eax = entry->ebx = entry->ecx =0 ;break ;case 0x80000008 : { -unsigned g_phys_as = (entry->eax >>16 ) &0xff ; -unsigned virt_as =max ((entry->eax >>8 ) &0xff ,48U ); -unsigned phys_as = entry->eax &0xff ; +unsigned int virt_as =max ((entry->eax >>8 ) &0xff ,48U ); +unsigned int phys_as;/* * If TDP (NPT) is disabled use the adjusted host MAXPHYADDR as
@@ -944,16 +943,16 @@ static inline int __do_cpuid_func(struct* reductions in MAXPHYADDR for memory encryption affect shadow * paging, too. * -* If TDP is enabled but an explicit guest MAXPHYADDR is not -* provided, use the raw bare metal MAXPHYADDR as reductions to -* the HPAs do not affect GPAs. +* If TDP is enabled, use the raw bare metal MAXPHYADDR as +* reductions to the HPAs do not affect GPAs. */ -if (!tdp_enabled) - g_phys_as = boot_cpu_data.x86_phys_bits; -else if (!g_phys_as) - g_phys_as = phys_as; +if (!tdp_enabled) { + phys_as = boot_cpu_data.x86_phys_bits; + }else { + phys_as = entry->eax &0xff ; + } - entry->eax = g_phys_as | (virt_as <<8 ); + entry->eax = phys_as | (virt_as <<8 ); entry->ecx &= ~(GENMASK (31 ,16 ) |GENMASK (11 ,8 )); entry->edx =0 ;cpuid_entry_override (entry,CPUID_8000_0008_EBX );
Greg Kroah-Hartman
maintainerPATCH 336/402 genirq/cpuhotplug, x86/vector: Prevent vector leak during CPU offline
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dongli Zhang <[email protected]>
commit a6c11c0a5235fb144a65e0cb2ffd360ddc1f6c32 upstream.
The absence of IRQD_MOVE_PCNTXT prevents immediate effectiveness of interrupt affinity reconfiguration via procfs. Instead, the change is deferred until the next instance of the interrupt being triggered on the original CPU.
When the interrupt next triggers on the original CPU, the new affinity is enforced within __irq_move_irq(). A vector is allocated from the new CPU, but the old vector on the original CPU remains and is not immediately reclaimed. Instead, apicd->move_in_progress is flagged, and the reclaiming process is delayed until the next trigger of the interrupt on the new CPU.
Upon the subsequent triggering of the interrupt on the new CPU, irq_complete_move() adds a task to the old CPU's vector_cleanup list if it remains online. Subsequently, the timer on the old CPU iterates over its vector_cleanup list, reclaiming old vectors.
However, a rare scenario arises if the old CPU is outgoing before the interrupt triggers again on the new CPU.
In that case irq_force_complete_move() is not invoked on the outgoing CPU to reclaim the old apicd->prev_vector because the interrupt isn't currently affine to the outgoing CPU, and irq_needs_fixup() returns false. Even though __vector_schedule_cleanup() is later called on the new CPU, it doesn't reclaim apicd->prev_vector; instead, it simply resets both apicd->move_in_progress and apicd->prev_vector to 0.
As a result, the vector remains unreclaimed in vector_matrix, leading to a CPU vector leak.
To address this issue, move the invocation of irq_force_complete_move() before the irq_needs_fixup() call to reclaim apicd->prev_vector, if the interrupt is currently or used to be affine to the outgoing CPU.
Additionally, reclaim the vector in __vector_schedule_cleanup() as well, following a warning message, although theoretically it should never see apicd->move_in_progress with apicd->prev_cpu pointing to an offline CPU.
--- arch/x86/kernel/apic/vector.c | 9 ++++++--- kernel/irq/cpuhotplug.c | 16 ++++++++-------- 2 files changed, 14 insertions(+), 11 deletions(-)
arch/x86/kernel/apic/vector.c +6 -3
@@ -982,7 +982,8 @@ static void __send_cleanup_vector(structhlist_add_head (&apicd->clist,per_cpu_ptr (&cleanup_list, cpu)); apic->send_IPI (cpu,IRQ_MOVE_CLEANUP_VECTOR ); }else { - apicd->prev_vector =0 ; +pr_warn ("IRQ %u schedule cleanup for offline CPU %u\n" , apicd->irq, cpu); +free_moved_vector (apicd); }raw_spin_unlock (&vector_lock); }
@@ -1019,6 +1020,7 @@ void irq_complete_move(struct irq_cfg *c*/ void irq_force_complete_move (struct irq_desc *desc) { +unsigned int cpu =smp_processor_id ();struct apic_chip_data *apicd;struct irq_data *irqd;unsigned int vector;
@@ -1043,10 +1045,11 @@ void irq_force_complete_move(struct irq_ goto unlock;/* -* If prev_vector is empty, no action required. +* If prev_vector is empty or the descriptor is neither currently +* nor previously on the outgoing CPU no action required. */ vector = apicd->prev_vector; -if (!vector) +if (!vector || (apicd->cpu != cpu && apicd->prev_cpu != cpu)) goto unlock;/*
kernel/irq/cpuhotplug.c +8 -8
@@ -70,6 +70,14 @@ static bool migrate_one_irq(struct irq_d }/* +* Complete an eventually pending irq move cleanup. If this +* interrupt was moved in hard irq context, then the vectors need +* to be cleaned up. It can't wait until this interrupt actually +* happens and this CPU was involved. +*/ +irq_force_complete_move (desc); + +/* * No move required, if: * - Interrupt is per cpu * - Interrupt is not started
@@ -88,14 +96,6 @@ static bool migrate_one_irq(struct irq_d }/* -* Complete an eventually pending irq move cleanup. If this -* interrupt was moved in hard irq context, then the vectors need -* to be cleaned up. It can't wait until this interrupt actually -* happens and this CPU was involved. -*/ -irq_force_complete_move (desc); - -/* * If there is a setaffinity pending, then try to reuse the pending * mask, so the last change of the affinity does not get lost. If * there is no move pending or the pending mask does not contain
Greg Kroah-Hartman
maintainerPATCH 337/402 net: ena: Fix DMA syncing in XDP path when SWIOTLB is on
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Arinzon <[email protected]>
commit d760117060cf2e90b5c59c5492cab179a4dbce01 upstream.
This patch fixes two issues:
Issue 1
-------
Description
``````````` Current code does not call dma_sync_single_for_cpu() to sync data from the device side memory to the CPU side memory before the XDP code path uses the CPU side data. This causes the XDP code path to read the unset garbage data in the CPU side memory, resulting in incorrect handling of the packet by XDP. Solution ````````
1. Add a call to dma_sync_single_for_cpu() before the XDP code starts to use the data in the CPU side memory.
2. The XDP code verdict can be XDP_PASS, in which case there is a fallback to the non-XDP code, which also calls dma_sync_single_for_cpu().
To avoid calling dma_sync_single_for_cpu() twice:
2.1. Put the dma_sync_single_for_cpu() in the code in such a place where
it happens before XDP and non-XDP code.
2.2. Remove the calls to dma_sync_single_for_cpu() in the non-XDP code
for the first buffer only (rx_copybreak and non-rx_copybreak cases), since the new call that was added covers these cases. The call to dma_sync_single_for_cpu() for the second buffer and on stays because only the first buffer is handled by the newly added dma_sync_single_for_cpu(). And there is no need for special handling of the second buffer and on for the XDP path since currently the driver supports only single buffer packets.
Issue 2
-------
Description
```````````
In case the XDP code forwarded the packet (ENA_XDP_FORWARDED),
ena_unmap_rx_buff_attrs() is called with attrs set to 0.
This means that before unmapping the buffer, the internal function
dma_unmap_page_attrs() will also call dma_sync_single_for_cpu() on
the whole buffer (not only on the data part of it).
This sync is both wasteful (since a sync was already explicitly
called before) and also causes a bug, which will be explained
using the below diagram.
The following diagram shows the flow of events causing the bug.
The order of events is (1)-(4) as shown in the diagram.
CPU side memory area
(3)convert_to_xdp_frame() initializes the
headroom with xdpf metadata
||
\/
___________________________________
| |
0 | V 4K
---------------------------------------------------------------------
| xdpf->data | other xdpf | < data > | tailroom ||...|
| | fields | | GARBAGE || |
---------------------------------------------------------------------
/\ /\
|| ||
(4)ena_unmap_rx_buff_attrs() calls (2)dma_sync_single_for_cpu()
dma_sync_single_for_cpu() on the copies data from device
whole buffer page, overwriting side to CPU side memory
the xdpf->data with GARBAGE. ||
0 4K
---------------------------------------------------------------------
| headroom | < data > | tailroom ||...|
| GARBAGE | | GARBAGE || |
---------------------------------------------------------------------
Device side memory area /\
||
(1) device writes RX packet data
After the call to ena_unmap_rx_buff_attrs() in (4), the xdpf->data
becomes corrupted, and so when it is later accessed in
ena_clean_xdp_irq()->xdp_return_frame(), it causes a page fault,
crashing the kernel.
Solution
````````Explicitly tell ena_unmap_rx_buff_attrs() not to call dma_sync_single_for_cpu() by passing it the ENA_DMA_ATTR_SKIP_CPU_SYNC flag.
--- drivers/net/ethernet/amazon/ena/ena_netdev.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-)
drivers/net/ethernet/amazon/ena/ena_netdev.c +9 -14
@@ -1495,11 +1495,6 @@ static struct sk_buff *ena_rx_skb(structif (unlikely (!skb))return NULL ; -/* sync this buffer for CPU use */ -dma_sync_single_for_cpu (rx_ring->dev, -dma_unmap_addr (&rx_info->ena_buf, paddr) + pkt_offset, - len, -DMA_FROM_DEVICE );skb_copy_to_linear_data (skb, buf_addr + buf_offset, len); dma_sync_single_for_device(rx_ring->dev, dma_unmap_addr(&rx_info->ena_buf, paddr) + pkt_offset,
@@ -1518,17 +1513,10 @@ static struct sk_buff *ena_rx_skb(struct buf_len =SKB_DATA_ALIGN (len + buf_offset + tailroom); - pre_reuse_paddr =dma_unmap_addr (&rx_info->ena_buf, paddr); -/* If XDP isn't loaded try to reuse part of the RX buffer */ reuse_rx_buf_page = !is_xdp_loaded &&ena_try_rx_buf_page_reuse (rx_info, buf_len, len, pkt_offset); -dma_sync_single_for_cpu (rx_ring->dev, - pre_reuse_paddr + pkt_offset, - len, -DMA_FROM_DEVICE ); -if (!reuse_rx_buf_page)ena_unmap_rx_buff_attrs (rx_ring, rx_info,DMA_ATTR_SKIP_CPU_SYNC );
@@ -1724,6 +1712,7 @@ static int ena_clean_rx_irq(struct ena_rint xdp_flags =0 ;int total_len =0 ;int xdp_verdict; +u8 pkt_offset;int rc =0 ;int i;
@@ -1750,13 +1739,19 @@ static int ena_clean_rx_irq(struct ena_r/* First descriptor might have an offset set by the device */ rx_info = &rx_ring->rx_buffer_info[rx_ring->ena_bufs[0 ].req_id]; - rx_info->buf_offset += ena_rx_ctx.pkt_offset; + pkt_offset = ena_rx_ctx.pkt_offset; + rx_info->buf_offset += pkt_offset;netif_dbg (rx_ring->adapter, rx_status, rx_ring->netdev,"rx_poll: q %d got packet from ena. descs #: %d l3 proto %d l4 proto %d hash: %x\n" , rx_ring->qid, ena_rx_ctx.descs, ena_rx_ctx.l3_proto, ena_rx_ctx.l4_proto, ena_rx_ctx.hash); +dma_sync_single_for_cpu (rx_ring->dev, +dma_unmap_addr (&rx_info->ena_buf, paddr) + pkt_offset, + rx_ring->ena_bufs[0 ].len, +DMA_FROM_DEVICE ); +if (ena_xdp_present_ring (rx_ring)) xdp_verdict =ena_xdp_handle_buff (rx_ring, &xdp, ena_rx_ctx.descs);
@@ -1782,7 +1777,7 @@ static int ena_clean_rx_irq(struct ena_rif (xdp_verdict &ENA_XDP_FORWARDED ) {ena_unmap_rx_buff_attrs (rx_ring, &rx_ring->rx_buffer_info[req_id], -0 ); +DMA_ATTR_SKIP_CPU_SYNC ); rx_ring->rx_buffer_info[req_id].page =NULL ; } }
Greg Kroah-Hartman
maintainerPATCH 338/402 media: cec: core: add adap_nb_transmit_canceled() callback
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans Verkuil <[email protected]>
commit da53c36ddd3f118a525a04faa8c47ca471e6c467 upstream.
A potential deadlock was found by Zheng Zhang with a local syzkaller instance.
The problem is that when a non-blocking CEC transmit is canceled by calling cec_data_cancel, that in turn can call the high-level received() driver callback, which can call cec_transmit_msg() to transmit a new message.
The cec_data_cancel() function is called with the adap->lock mutex held, and cec_transmit_msg() tries to take that same lock.
The root cause is that the received() callback can either be used to pass on a received message (and then adap->lock is not held), or to report a canceled transmit (and then adap->lock is held).
This is confusing, so create a new low-level adap_nb_transmit_canceled callback that reports back that a non-blocking transmit was canceled.
And the received() callback is only called when a message is received, as was the case before commit f9d0ecbf56f4 ("media: cec: correctly pass on reply results") complicated matters.
--- drivers/media/cec/core/cec-adap.c | 4 ++-- include/media/cec.h | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-)
drivers/media/cec/core/cec-adap.c +2 -2
@@ -397,8 +397,8 @@ static void cec_data_cancel(struct cec_dcec_queue_msg_monitor (adap, &data->msg,1 );if (!data->blocking && data->msg.sequence) -/* Allow drivers to process the message first */ -call_op (adap, received, &data->msg); +/* Allow drivers to react to a canceled transmit */ +call_void_op (adap, adap_nb_transmit_canceled, &data->msg);cec_data_completed (data); }
include/media/cec.h +4 -2
@@ -120,14 +120,16 @@ struct cec_adap_ops {int (*adap_log_addr)(struct cec_adapter *adap,u8 logical_addr);int (*adap_transmit)(struct cec_adapter *adap,u8 attempts,u32 signal_free_time,struct cec_msg *msg); +void (*adap_nb_transmit_canceled)(struct cec_adapter *adap, +const struct cec_msg *msg);void (*adap_status)(struct cec_adapter *adap,struct seq_file *file);void (*adap_free)(struct cec_adapter *adap); -/* Error injection callbacks */ +/* Error injection callbacks, called without adap->lock held */ int (*error_inj_show)(struct cec_adapter *adap,struct seq_file *sf);bool (*error_inj_parse_line)(struct cec_adapter *adap,char *line); -/* High-level CEC message callback */ +/* High-level CEC message callback, called without adap->lock held */ int (*received)(struct cec_adapter *adap,struct cec_msg *msg); };
Greg Kroah-Hartman
maintainerPATCH 339/402 SUNRPC: Fix loop termination condition in gss_free_in_token_pages()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chuck Lever <[email protected]>
commit 4a77c3dead97339478c7422eb07bf4bf63577008 upstream.
The in_token->pages[] array is not NULL terminated. This results in the following KASAN splat:
KASAN: maybe wild-memory-access in range [0x04a2013400000008-0x04a201340000000f]
--- net/sunrpc/auth_gss/svcauth_gss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sunrpc/auth_gss/svcauth_gss.c +1 -1
@@ -1162,7 +1162,7 @@ static int gss_read_proxy_verf(struct sv } pages =DIV_ROUND_UP (inlen,PAGE_SIZE ); - in_token->pages =kcalloc (pages,sizeof (struct page *),GFP_KERNEL ); + in_token->pages =kcalloc (pages +1 ,sizeof (struct page *),GFP_KERNEL );if (!in_token->pages) {kfree (in_handle->data);return SVC_DENIED ;
Greg Kroah-Hartman
maintainerPATCH 340/402 drm: Check output polling initialized before disabling
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shradha Gupta <[email protected]>
commit 5abffb66d12bcac84bf7b66389c571b8bb6e82bd upstream.
In drm_kms_helper_poll_disable() check if output polling support is initialized before disabling polling. If not flag this as a warning.
Additionally in drm_mode_config_helper_suspend() and drm_mode_config_helper_resume() calls, that re the callers of these functions, avoid invoking them if polling is not initialized. For drivers like hyperv-drm, that do not initialize connector polling, if suspend is called without this check, it leads to suspend failure with following stack
[ 770.719392] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done. [ 770.720592] printk: Suspending console(s) (use no_console_suspend to debug) [ 770.948823] ------------[ cut here ]------------ [ 770.948824] WARNING: CPU: 1 PID: 17197 at kernel/workqueue.c:3162 __flush_work.isra.0+0x212/0x230 [ 770.948831] Modules linked in: rfkill nft_counter xt_conntrack xt_owner udf nft_compat crc_itu_t nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip_set nf_tables nfnetlink vfat fat mlx5_ib ib_uverbs ib_core mlx5_core intel_rapl_msr intel_rapl_common kvm_amd ccp mlxfw kvm psample hyperv_drm tls drm_shmem_helper drm_kms_helper irqbypass pcspkr syscopyarea sysfillrect sysimgblt hv_balloon hv_utils joydev drm fuse xfs libcrc32c pci_hyperv pci_hyperv_intf sr_mod sd_mod cdrom t10_pi sg hv_storvsc scsi_transport_fc hv_netvsc serio_raw hyperv_keyboard hid_hyperv crct10dif_pclmul crc32_pclmul crc32c_intel hv_vmbus ghash_clmulni_intel dm_mirror dm_region_hash dm_log dm_mod [ 770.948863] CPU: 1 PID: 17197 Comm: systemd-sleep Not tainted 5.14.0-362.2.1.el9_3.x86_64 #1 [ 770.948865] Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS Hyper-V UEFI Release v4.1 05/09/2022 [ 770.948866] RIP: 0010:__flush_work.isra.0+0x212/0x230 [ 770.948869] Code: 8b 4d 00 4c 8b 45 08 89 ca 48 c1 e9 04 83 e2 08 83 e1 0f 83 ca 02 89 c8 48 0f ba 6d 00 03 e9 25 ff ff ff 0f 0b e9 4e ff ff ff <0f> 0b 45 31 ed e9 44 ff ff ff e8 8f 89 b2 00 66 66 2e 0f 1f 84 00 [ 770.948870] RSP: 0018:ffffaf4ac213fb10 EFLAGS: 00010246 [ 770.948871] RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff8c992857 [ 770.948872] RDX: 0000000000000001 RSI: 0000000000000001 RDI: ffff9aad82b00330 [ 770.948873] RBP: ffff9aad82b00330 R08: 0000000000000000 R09: ffff9aad87ee3d10 [ 770.948874] R10: 0000000000000200 R11: 0000000000000000 R12: ffff9aad82b00330 [ 770.948874] R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000001 [ 770.948875] FS: 00007ff1b2f6bb40(0000) GS:ffff9aaf37d00000(0000) knlGS:0000000000000000 [ 770.948878] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 770.948878] CR2: 0000555f345cb666 CR3: 00000001462dc005 CR4: 0000000000370ee0 [ 770.948879] Call Trace: [ 770.948880] <TASK> [ 770.948881] ? show_trace_log_lvl+0x1c4/0x2df [ 770.948884] ? show_trace_log_lvl+0x1c4/0x2df [ 770.948886] ? __cancel_work_timer+0x103/0x190 [ 770.948887] ? __flush_work.isra.0+0x212/0x230 [ 770.948889] ? __warn+0x81/0x110 [ 770.948891] ? __flush_work.isra.0+0x212/0x230 [ 770.948892] ? report_bug+0x10a/0x140 [ 770.948895] ? handle_bug+0x3c/0x70 [ 770.948898] ? exc_invalid_op+0x14/0x70 [ 770.948899] ? asm_exc_invalid_op+0x16/0x20 [ 770.948903] ? __flush_work.isra.0+0x212/0x230 [ 770.948905] __cancel_work_timer+0x103/0x190 [ 770.948907] ? _raw_spin_unlock_irqrestore+0xa/0x30 [ 770.948910] drm_kms_helper_poll_disable+0x1e/0x40 [drm_kms_helper] [ 770.948923] drm_mode_config_helper_suspend+0x1c/0x80 [drm_kms_helper] [ 770.948933] ? __pfx_vmbus_suspend+0x10/0x10 [hv_vmbus] [ 770.948942] hyperv_vmbus_suspend+0x17/0x40 [hyperv_drm] [ 770.948944] ? __pfx_vmbus_suspend+0x10/0x10 [hv_vmbus] [ 770.948951] dpm_run_callback+0x4c/0x140 [ 770.948954] __device_suspend_noirq+0x74/0x220 [ 770.948956] dpm_noirq_suspend_devices+0x148/0x2a0 [ 770.948958] dpm_suspend_end+0x54/0xe0 [ 770.948960] create_image+0x14/0x290 [ 770.948963] hibernation_snapshot+0xd6/0x200 [ 770.948964] hibernate.cold+0x8b/0x1fb [ 770.948967] state_store+0xcd/0xd0 [ 770.948969] kernfs_fop_write_iter+0x124/0x1b0 [ 770.948973] new_sync_write+0xff/0x190 [ 770.948976] vfs_write+0x1ef/0x280 [ 770.948978] ksys_write+0x5f/0xe0 [ 770.948979] do_syscall_64+0x5c/0x90 [ 770.948981] ? syscall_exit_work+0x103/0x130 [ 770.948983] ? syscall_exit_to_user_mode+0x12/0x30 [ 770.948985] ? do_syscall_64+0x69/0x90 [ 770.948986] ? do_syscall_64+0x69/0x90 [ 770.948987] ? do_user_addr_fault+0x1d6/0x6a0 [ 770.948989] ? do_syscall_64+0x69/0x90 [ 770.948990] ? exc_page_fault+0x62/0x150 [ 770.948992] entry_SYSCALL_64_after_hwframe+0x72/0xdc [ 770.948995] RIP: 0033:0x7ff1b293eba7 [ 770.949010] Code: 0b 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 48 89 54 24 18 48 89 74 24 [ 770.949011] RSP: 002b:00007ffde3912128 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 770.949012] RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 00007ff1b293eba7 [ 770.949013] RDX: 0000000000000005 RSI: 00007ffde3912210 RDI: 0000000000000004 [ 770.949014] RBP: 00007ffde3912210 R08: 000055d7dd4c9510 R09: 00007ff1b29b14e0 [ 770.949014] R10: 00007ff1b29b13e0 R11: 0000000000000246 R12: 0000000000000005 [ 770.949015] R13: 000055d7dd4c53e0 R14: 0000000000000005 R15: 00007ff1b29f69e0 [ 770.949016] </TASK> [ 770.949017] ---[ end trace e6fa0618bfa2f31d ]---
Built-on: Rhel9, Ubuntu22
--- drivers/gpu/drm/drm_modeset_helper.c | 19 ++++++++++++++++--- drivers/gpu/drm/drm_probe_helper.c | 12 ++++++++++-- 2 files changed, 26 insertions(+), 5 deletions(-)
drivers/gpu/drm/drm_modeset_helper.c +16 -3
@@ -198,13 +198,22 @@ int drm_mode_config_helper_suspend(strucif (!dev)return 0 ; +/* +* Don't disable polling if it was never initialized +*/ +if (dev->mode_config.poll_enabled) +drm_kms_helper_poll_disable (dev); -drm_kms_helper_poll_disable (dev);drm_fb_helper_set_suspend_unlocked (dev->fb_helper,1 ); state =drm_atomic_helper_suspend (dev);if (IS_ERR (state)) {drm_fb_helper_set_suspend_unlocked (dev->fb_helper,0 ); -drm_kms_helper_poll_enable (dev); +/* +* Don't enable polling if it was never initialized +*/ +if (dev->mode_config.poll_enabled) +drm_kms_helper_poll_enable (dev); +return PTR_ERR (state); }
@@ -244,7 +253,11 @@ int drm_mode_config_helper_resume(struct dev->mode_config.suspend_state =NULL ;drm_fb_helper_set_suspend_unlocked (dev->fb_helper,0 ); -drm_kms_helper_poll_enable (dev); +/* +* Don't enable polling if it is not initialized +*/ +if (dev->mode_config.poll_enabled) +drm_kms_helper_poll_enable (dev);return ret; }
drivers/gpu/drm/drm_probe_helper.c +10 -2
@@ -235,6 +235,9 @@ drm_connector_mode_valid(struct drm_conn* Drivers can call this helper from their device resume implementation. It is * not an error to call this even when output polling isn't enabled. * +* If device polling was never initialized before, this call will trigger a +* warning and return. +* * Note that calls to enable and disable polling must be strictly ordered, which * is automatically the case when they're only call from suspend/resume * callbacks.
@@ -246,7 +249,8 @@ void drm_kms_helper_poll_enable(struct dstruct drm_connector_list_iter conn_iter;unsigned long delay =DRM_OUTPUT_POLL_PERIOD ; -if (!dev->mode_config.poll_enabled || !drm_kms_helper_poll) +if (drm_WARN_ON_ONCE (dev, !dev->mode_config.poll_enabled) || + !drm_kms_helper_poll || dev->mode_config.poll_running)return ;drm_connector_list_iter_begin (dev, &conn_iter);
@@ -742,14 +746,18 @@ EXPORT_SYMBOL(drm_kms_helper_is_poll_wor* not an error to call this even when output polling isn't enabled or already * disabled. Polling is re-enabled by calling drm_kms_helper_poll_enable(). * +* If however, the polling was never initialized, this call will trigger a +* warning and return +* * Note that calls to enable and disable polling must be strictly ordered, which * is automatically the case when they're only call from suspend/resume * callbacks. */ void drm_kms_helper_poll_disable (struct drm_device *dev) { -if (!dev->mode_config.poll_enabled) +if (drm_WARN_ON (dev, !dev->mode_config.poll_enabled))return ; +cancel_delayed_work_sync (&dev->mode_config.output_poll_work); }EXPORT_SYMBOL (drm_kms_helper_poll_disable);
Greg Kroah-Hartman
maintainerPATCH 341/402 drm: Check polling initialized before enabling in drm_helper_probe_single_connector_modes
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shradha Gupta <[email protected]>
commit 048a36d8a6085bbd8ab9e5794b713b92ac986450 upstream.
In function drm_helper_probe_single_connector_modes() when we enable polling again, if it is already uninitialized, a warning is reported. This patch fixes the warning message by checking if poll is initialized before enabling it.
--- drivers/gpu/drm/drm_probe_helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_probe_helper.c +2 -1
@@ -498,7 +498,8 @@ retry: }/* Re-enable polling in case the global poll config changed. */ -if (drm_kms_helper_poll != dev->mode_config.poll_running) +if (dev->mode_config.poll_enabled && + (drm_kms_helper_poll != dev->mode_config.poll_running))drm_kms_helper_poll_enable (dev); dev->mode_config.poll_running = drm_kms_helper_poll;
Greg Kroah-Hartman
maintainerPATCH 342/402 mmc: core: Do not force a retune before RPMB switch
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jorge Ramirez-Ortiz <[email protected]>
commit 67380251e8bbd3302c64fea07f95c31971b91c22 upstream.
Requesting a retune before switching to the RPMB partition has been observed to cause CRC errors on the RPMB reads (-EILSEQ).
Since RPMB reads can not be retried, the clients would be directly affected by the errors.
This commit disables the retune request prior to switching to the RPMB
partition: mmc_retune_pause() no longer triggers a retune before the pause period begins.
This was verified with the sdhci-of-arasan driver (ZynqMP) configured for HS200 using two separate eMMC cards (DG4064 and 064GB2). In both cases, the error was easy to reproduce triggering every few tenths of reads.
With this commit, systems that were utilizing OP-TEE to access RPMB variables will experience an enhanced performance. Specifically, when OP-TEE is configured to employ RPMB as a secure storage solution, it not only writes the data but also the secure filesystem within the partition. As a result, retrieving any variable involves multiple RPMB reads, typically around five.
For context, on ZynqMP, each retune request consumed approximately 8ms. Consequently, reading any RPMB variable used to take at the very minimum 40ms.
After droping the need to retune before switching to the RPMB partition, this is no longer the case.
--- drivers/mmc/core/host.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/core/host.c +1 -2
@@ -119,13 +119,12 @@ void mmc_retune_enable(struct mmc_host */* * Pause re-tuning for a small set of operations. The pause begins after the -* next command and after first doing re-tuning. +* next command. */ void mmc_retune_pause (struct mmc_host *host) {if (!host->retune_paused) { host->retune_paused =1 ; -mmc_retune_needed (host);mmc_retune_hold (host); } }
Greg Kroah-Hartman
maintainerPATCH 343/402 io_uring: fail NOP if non-zero op flags is passed in
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ming Lei <[email protected]>
commit 3d8f874bd620ce03f75a5512847586828ab86544 upstream.
The NOP op flags should have been checked from beginning like any other opcode, otherwise NOP may not be extended with the op flags.
Given both liburing and Rust io-uring crate always zeros SQE op flags, just ignore users which play raw NOP uring interface without zeroing SQE, because NOP is just for test purpose. Then we can save one NOP2 opcode.
--- io_uring/io_uring.c | 2 ++ 1 file changed, 2 insertions(+)
io_uring/io_uring.c +2 -0
@@ -6621,6 +6621,8 @@ static int io_req_prep(struct io_kiocb * {switch (req->opcode) {case IORING_OP_NOP : +if (READ_ONCE (sqe->rw_flags)) +return -EINVAL ;return 0 ;case IORING_OP_READV :case IORING_OP_READ_FIXED :
Greg Kroah-Hartman
maintainerPATCH 344/402 afs: Dont cross .backup mountpoint from backup volume
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Dionne <[email protected]>
commit 29be9100aca2915fab54b5693309bc42956542e5 upstream.
Don't cross a mountpoint that explicitly specifies a backup volume (target is <vol>.backup) when starting from a backup volume.
It it not uncommon to mount a volume's backup directly in the volume itself. This can cause tools that are not paying attention to get into a loop mounting the volume onto itself as they attempt to traverse the tree, leading to a variety of problems.
This doesn't prevent the general case of loops in a sequence of mountpoints, but addresses a common special case in the same way as other afs clients.
--- fs/afs/mntpt.c | 5 +++++ 1 file changed, 5 insertions(+)
fs/afs/mntpt.c +5 -0
@@ -146,6 +146,11 @@ static int afs_mntpt_set_params(struct fput_page (page);if (ret <0 )return ret; + +/* Don't cross a backup volume mountpoint from a backup volume */ +if (src_as->volume && src_as->volume->type ==AFSVL_BACKVOL && + ctx->type ==AFSVL_BACKVOL ) +return -ENODEV ; }return 0 ;
Greg Kroah-Hartman
maintainerPATCH 345/402 nilfs2: fix use-after-free of timer for log writer thread
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ryusuke Konishi <[email protected]>
commit f5d4e04634c9cf68bdf23de08ada0bb92e8befe7 upstream.
Patch series "nilfs2: fix log writer related issues".
This bug fix series covers three nilfs2 log writer-related issues, including a timer use-after-free issue and potential deadlock issue on unmount, and a potential freeze issue in event synchronization found during their analysis. Details are described in each commit log.
This patch (of 3):
A use-after-free issue has been reported regarding the timer sc_timer on the nilfs_sc_info structure.
The problem is that even though it is used to wake up a sleeping log writer thread, sc_timer is not shut down until the nilfs_sc_info structure is about to be freed, and is used regardless of the thread's lifetime.
Fix this issue by limiting the use of sc_timer only while the log writer thread is alive.
--- fs/nilfs2/segment.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-)
fs/nilfs2/segment.c +19 -6
@@ -2159,8 +2159,10 @@ static void nilfs_segctor_start_timer(st {spin_lock (&sci->sc_state_lock);if (!(sci->sc_state &NILFS_SEGCTOR_COMMIT )) { - sci->sc_timer.expires = jiffies + sci->sc_interval; -add_timer (&sci->sc_timer); +if (sci->sc_task) { + sci->sc_timer.expires = jiffies + sci->sc_interval; +add_timer (&sci->sc_timer); + } sci->sc_state |=NILFS_SEGCTOR_COMMIT ; }spin_unlock (&sci->sc_state_lock);
@@ -2380,10 +2382,21 @@ int nilfs_construct_dsync_segment(struct*/ static void nilfs_segctor_accept (struct nilfs_sc_info *sci) { +bool thread_is_alive; +spin_lock (&sci->sc_state_lock); sci->sc_seq_accepted = sci->sc_seq_request; + thread_is_alive = (bool )sci->sc_task;spin_unlock (&sci->sc_state_lock); -del_timer_sync (&sci->sc_timer); + +/* +* This function does not race with the log writer thread's +* termination. Therefore, deleting sc_timer, which should not be +* done after the log writer thread exits, can be done safely outside +* the area protected by sc_state_lock. +*/ +if (thread_is_alive) +del_timer_sync (&sci->sc_timer); }/**
@@ -2409,7 +2422,7 @@ static void nilfs_segctor_notify(struct sci->sc_flush_request &= ~FLUSH_DAT_BIT ;/* re-enable timer if checkpoint creation was not done */ -if ((sci->sc_state &NILFS_SEGCTOR_COMMIT ) && +if ((sci->sc_state &NILFS_SEGCTOR_COMMIT ) && sci->sc_task &&time_before (jiffies, sci->sc_timer.expires))add_timer (&sci->sc_timer); }
@@ -2599,6 +2612,7 @@ static int nilfs_segctor_thread(void *arint timeout =0 ; sci->sc_timer_task = current; +timer_setup (&sci->sc_timer, nilfs_construction_timeout,0 );/* start sync. */ sci->sc_task = current;
@@ -2665,6 +2679,7 @@ static int nilfs_segctor_thread(void *ar end_thread:/* end sync. */ sci->sc_task =NULL ; +del_timer_sync (&sci->sc_timer);wake_up (&sci->sc_wait_task);/* for nilfs_segctor_kill_thread() */ spin_unlock (&sci->sc_state_lock);return 0 ;
@@ -2728,7 +2743,6 @@ static struct nilfs_sc_info *nilfs_segctINIT_LIST_HEAD (&sci->sc_gc_inodes);INIT_LIST_HEAD (&sci->sc_iput_queue);INIT_WORK (&sci->sc_iput_work, nilfs_iput_work_func); -timer_setup (&sci->sc_timer, nilfs_construction_timeout,0 ); sci->sc_interval =HZ *NILFS_SC_DEFAULT_TIMEOUT ; sci->sc_mjcp_freq =HZ *NILFS_SC_DEFAULT_SR_FREQ ;
@@ -2814,7 +2828,6 @@ static void nilfs_segctor_destroy(structdown_write (&nilfs->ns_segctor_sem); -del_timer_sync (&sci->sc_timer);kfree (sci); }
Greg Kroah-Hartman
maintainerPATCH 346/402 Revert "drm/amdgpu: init iommu after amdkfd device init"
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Armin Wolf <[email protected]>
This reverts commit 56b522f4668167096a50c39446d6263c96219f5f.
A user reported that this commit breaks the integrated gpu of his notebook, causing a black screen. He was able to bisect the problematic commit and verified that by reverting it the notebook works again. He also confirmed that kernel 6.8.1 also works on his device, so the upstream commit itself seems to be ok.
An amdgpu developer (Alex Deucher) confirmed that this patch should have never been ported to 5.15 in the first place, so revert this commit from the 5.15 stable series.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +4 -4
@@ -2487,6 +2487,10 @@ static int amdgpu_device_ip_init(structif (r) goto init_failed; + r =amdgpu_amdkfd_resume_iommu (adev); +if (r) + goto init_failed; + r =amdgpu_device_ip_hw_init_phase1 (adev);if (r) goto init_failed;
@@ -2525,10 +2529,6 @@ static int amdgpu_device_ip_init(structif (!adev->gmc.xgmi.pending_reset)amdgpu_amdkfd_device_init (adev); - r =amdgpu_amdkfd_resume_iommu (adev); -if (r) - goto init_failed; -amdgpu_fru_get_product_info (adev); init_failed:
Greg Kroah-Hartman
maintainerPATCH 347/402 mptcp: fix full TCP keep-alive support
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthieu Baerts (NGI0) <[email protected]>
commit bd11dc4fb969ec148e50cd87f88a78246dbc4d0b upstream.
SO_KEEPALIVE support has been added a while ago, as part of a series "adding SOL_SOCKET" support. To have a full control of this keep-alive feature, it is important to also support TCP_KEEP* socket options at the SOL_TCP level.
Supporting them on the setsockopt() part is easy, it is just a matter of remembering each value in the MPTCP sock structure, and calling tcp_sock_set_keep*() helpers on each subflow. If the value is not modified (0), calling these helpers will not do anything. For the getsockopt() part, the corresponding value from the MPTCP sock structure or the default one is simply returned. All of this is very similar to other TCP_* socket options supported by MPTCP.
It looks important for kernels supporting SO_KEEPALIVE, to also support TCP_KEEP* options as well: some apps seem to (wrongly) consider that if the former is supported, the latter ones will be supported as well. But also, not having this simple and isolated change is preventing MPTCP support in some apps, and libraries like GoLang [1]. This is why this patch is seen as a fix.
[ Conflicts in the same context, because commit 29b5e5ef8739 ("mptcp:
implement TCP_NOTSENT_LOWAT support") (new feature), commit 013e3179dbd2 ("mptcp: fix rcv space initialization") (not backported because of the various conflicts, and because the race fixed by this commit "does not produce ill effects in practice"), and commit 4f6e14bd19d6 ("mptcp: support TCP_CORK and TCP_NODELAY") are not in this version. The adaptations done by 7f71a337b515 ("mptcp: cleanup SOL_TCP handling") have been adapted to this case here. Also, TCP_KEEPINTVL and TCP_KEEPCNT value had to be set without lock, the same way it was done on TCP side prior commit 6fd70a6b4e6f ("tcp: set TCP_KEEPINTVL locklessly") and commit 84485080cbc1 ("tcp: set TCP_KEEPCNT locklessly"). ]
--- net/mptcp/protocol.h | 3 + net/mptcp/sockopt.c | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+)
net/mptcp/protocol.h +3 -0
@@ -250,6 +250,9 @@ struct mptcp_sock {bool use_64bit_ack;/* Set when we received a 64-bit DSN */ bool csum_enabled;spinlock_t join_list_lock; +int keepalive_cnt; +int keepalive_idle; +int keepalive_intvl;struct work_struct work;struct sk_buff *ooo_last_skb;struct rb_root out_of_order_queue;
net/mptcp/sockopt.c +115 -0
148 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 348/402 vxlan: Fix regression when dropping packets due to invalid src addresses
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <[email protected]>
commit 1cd4bc987abb2823836cbb8f887026011ccddc8a upstream.
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.
[ Backport note: vxlan snooping/learning not supported in 6.8 or older,
so commit is simply a revert. ]
--- drivers/net/vxlan/vxlan_core.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/net/vxlan/vxlan_core.c +0 -4
@@ -1779,10 +1779,6 @@ static bool vxlan_set_mac(struct vxlan_dif (ether_addr_equal (eth_hdr (skb)->h_source, vxlan->dev->dev_addr))return false; -/* Ignore packets from invalid src-address */ -if (!is_valid_ether_addr (eth_hdr (skb)->h_source)) -return false; -/* Get address from the outer IP header */ if (vxlan_get_sk_family (vs) ==AF_INET ) { saddr.sin.sin_addr.s_addr =ip_hdr (skb)->saddr;
Greg Kroah-Hartman
maintainerPATCH 349/402 net: dsa: sja1105: always enable the INCL_SRCPT option
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vladimir Oltean <[email protected]>
commit b4638af8885af93cd70351081da1909c59342440 upstream.
Link-local traffic on bridged SJA1105 ports is sometimes tagged by the hardware with source port information (when the port is under a VLAN aware bridge).
The tag_8021q source port identification has become more loose ("imprecise") and will report a plausible rather than exact bridge port, when under a bridge (be it VLAN-aware or VLAN-unaware). But link-local traffic always needs to know the precise source port.
Modify the driver logic (and therefore: the tagging protocol itself) to always include the source port information with link-local packets, regardless of whether the port is standalone, under a VLAN-aware or VLAN-unaware bridge. This makes it possible for the tagging driver to give priority to that information over the tag_8021q VLAN header.
The big drawback with INCL_SRCPT is that it makes it impossible to distinguish between an original MAC DA of 01:80:C2:XX:YY:ZZ and 01:80:C2:AA:BB:ZZ, because the tagger just patches MAC DA bytes 3 and 4 with zeroes. Only if PTP RX timestamping is enabled, the switch will generate a META follow-up frame containing the RX timestamp and the original bytes 3 and 4 of the MAC DA. Those will be used to patch up the original packet. Nonetheless, in the absence of PTP RX timestamping, we have to live with this limitation, since it is more important to have the more precise source port information for link-local traffic.
Stable-dep-of: c1ae02d87689 ("net: dsa: tag_sja1105: always prefer source port information from INCL_SRCPT")
--- drivers/net/dsa/sja1105/sja1105_main.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/net/dsa/sja1105/sja1105_main.c +2 -7
@@ -853,11 +853,11 @@ static int sja1105_init_general_params(s .hostprio = 7, .mac_fltres1 = SJA1105_LINKLOCAL_FILTER_A, .mac_flt1 = SJA1105_LINKLOCAL_FILTER_A_MASK, - .incl_srcpt1 = false, + .incl_srcpt1 = true, .send_meta1 = false, .mac_fltres0 = SJA1105_LINKLOCAL_FILTER_B, .mac_flt0 = SJA1105_LINKLOCAL_FILTER_B_MASK, - .incl_srcpt0 = false, + .incl_srcpt0 = true, .send_meta0 = false,/* Default to an invalid value */ .mirr_port = priv->ds->num_ports,
@@ -2346,11 +2346,6 @@ int sja1105_vlan_filtering(struct dsa_sw general_params->tpid = tpid;/* EtherType used to identify outer tagged (S-tag) VLAN traffic */ general_params->tpid2 = tpid2; -/* When VLAN filtering is on, we need to at least be able to -* decode management traffic through the "backup plan". -*/ - general_params->incl_srcpt1 = enabled; - general_params->incl_srcpt0 = enabled;/* VLAN filtering => independent VLAN learning. * No VLAN filtering (or best effort) => shared VLAN learning.
Greg Kroah-Hartman
maintainerPATCH 350/402 net: dsa: tag_sja1105: always prefer source port information from INCL_SRCPT
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vladimir Oltean <[email protected]>
commit c1ae02d876898b1b8ca1e12c6f84d7b406263800 upstream.
Currently the sja1105 tagging protocol prefers using the source port information from the VLAN header if that is available, falling back to the INCL_SRCPT option if it isn't. The VLAN header is available for all frames except for META frames initiated by the switch (containing RX timestamps), and thus, the "if (is_link_local)" branch is practically dead.
The tag_8021q source port identification has become more loose ("imprecise") and will report a plausible rather than exact bridge port, when under a bridge (be it VLAN-aware or VLAN-unaware). But link-local traffic always needs to know the precise source port. With incorrect source port reporting, for example PTP traffic over 2 bridged ports will all be seen on sockets opened on the first such port, which is incorrect.
Now that the tagging protocol has been changed to make link-local frames always contain source port information, we can reverse the order of the checks so that we always give precedence to that information (which is always precise) in lieu of the tag_8021q VID which is only precise for a standalone port.
[ Replaced the 2 original Fixes: tags with the correct one.
Respun the change around the lack of a "vbid", corresponding to DSA FDB isolation, which appeared only in v5.18. ]
--- net/dsa/tag_sja1105.c | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-)
net/dsa/tag_sja1105.c +26 -8
@@ -489,10 +489,7 @@ static struct sk_buff *sja1105_rcv(struc is_link_local =sja1105_is_link_local (skb); is_meta =sja1105_is_meta_frame (skb); -if (sja1105_skb_has_tag_8021q (skb)) { -/* Normal traffic path. */ -sja1105_vlan_rcv (skb, &source_port, &switch_id, &vid); - }else if (is_link_local) { +if (is_link_local) {/* Management traffic path. Switch embeds the switch ID and * port ID into bytes of the destination MAC, courtesy of * the incl_srcpt options.
@@ -506,14 +503,35 @@ static struct sk_buff *sja1105_rcv(strucsja1105_meta_unpack (skb, &meta); source_port = meta.source_port; switch_id = meta.switch_id; - }else { + } + +/* Normal data plane traffic and link-local frames are tagged with +* a tag_8021q VLAN which we have to strip +*/ +if (sja1105_skb_has_tag_8021q (skb)) { +int tmp_source_port =-1 , tmp_switch_id =-1 ; + +sja1105_vlan_rcv (skb, &tmp_source_port, &tmp_switch_id, &vid); +/* Preserve the source information from the INCL_SRCPT option, +* if available. This allows us to not overwrite a valid source +* port and switch ID with zeroes when receiving link-local +* frames from a VLAN-aware bridged port (non-zero vid). +*/ +if (source_port ==-1 ) + source_port = tmp_source_port; +if (switch_id ==-1 ) + switch_id = tmp_switch_id; + }else if (source_port ==-1 && switch_id ==-1 ) { +/* Packets with no source information have no chance of +* getting accepted, drop them straight away. +*/ return NULL ; } -if (source_port ==-1 || switch_id ==-1 ) - skb->dev =dsa_find_designated_bridge_port_by_vid (netdev, vid); -else +if (source_port !=-1 && switch_id !=-1 ) skb->dev =dsa_master_find_slave (netdev, switch_id, source_port); +else + skb->dev =dsa_find_designated_bridge_port_by_vid (netdev, vid);if (!skb->dev) {netdev_warn (netdev,"Couldn't decode source port\n" );return NULL ;
Greg Kroah-Hartman
maintainerPATCH 351/402 scripts/gdb: fix SB_* constants parsing
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Fainelli <[email protected]>
commit 6a59cb5158bff13b80f116305155fbe4967a5010 upstream.
--0000000000009a0c9905fd9173ad
Content-Transfer-Encoding: 8bit
After f15afbd34d8f ("fs: fix undefined behavior in bit shift for SB_NOUSER") the constants were changed from plain integers which LX_VALUE() can parse to constants using the BIT() macro which causes the following:
Reading symbols from build/linux-custom/vmlinux...done.
Traceback (most recent call last):
File "/home/fainelli/work/buildroot/output/arm64/build/linux-custom/vmlinux-gdb.py", line 25, in <module>
import linux.constants
File "/home/fainelli/work/buildroot/output/arm64/build/linux-custom/scripts/gdb/linux/constants.py", line 5
LX_SB_RDONLY = ((((1UL))) << (0))
Use LX_GDBPARSED() which does not suffer from that issue.
f15afbd34d8f ("fs: fix undefined behavior in bit shift for SB_NOUSER")
--- scripts/gdb/linux/constants.py.in | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
scripts/gdb/linux/constants.py.in +6 -6
@@ -46,12 +46,12 @@ if IS_BUILTIN(CONFIG_COMMON_CLK): LX_GDBPARSED(CLK_GET_RATE_NOCACHE) /* linux/fs.h */ -LX_VALUE(SB_RDONLY) -LX_VALUE(SB_SYNCHRONOUS) -LX_VALUE(SB_MANDLOCK) -LX_VALUE(SB_DIRSYNC) -LX_VALUE(SB_NOATIME) -LX_VALUE(SB_NODIRATIME) +LX_GDBPARSED(SB_RDONLY) +LX_GDBPARSED(SB_SYNCHRONOUS) +LX_GDBPARSED(SB_MANDLOCK) +LX_GDBPARSED(SB_DIRSYNC) +LX_GDBPARSED(SB_NOATIME) +LX_GDBPARSED(SB_NODIRATIME) /* linux/htimer.h */ LX_GDBPARSED(hrtimer_resolution)
Greg Kroah-Hartman
maintainerPATCH 352/402 sunrpc: exclude from freezer when waiting for requests:
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: NeilBrown <[email protected]>
Prior to v6.1, the freezer will only wake a kernel thread from an uninterruptible sleep. Since we changed svc_get_next_xprt() to use and IDLE sleep the freezer cannot wake it. We need to tell the freezer to ignore it instead.
To make this work with only upstream commits, 5.15.y would need commit f5d39b020809 ("freezer,sched: Rewrite core freezer logic") which allows non-interruptible sleeps to be woken by the freezer.
--- fs/nfs/callback.c | 2 +- fs/nfsd/nfs4proc.c | 3 ++- net/sunrpc/svc_xprt.c | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-)
fs/nfs/callback.c +1 -1
@@ -124,7 +124,7 @@ nfs41_callback_svc(void *vrqstp) }else {spin_unlock_bh (&serv->sv_cb_lock);if (!kthread_should_stop ()) -schedule (); +freezable_schedule ();finish_wait (&serv->sv_cb_waitq, &wq); } }
fs/nfsd/nfs4proc.c +2 -1
@@ -38,6 +38,7 @@#include <linux/slab.h> #include <linux/kthread.h> #include <linux/namei.h> +#include <linux/freezer.h> #include <linux/sunrpc/addr.h> #include <linux/nfs_ssc.h>
@@ -1322,7 +1323,7 @@ try_again:/* allow 20secs for mount/unmount for now - revisit */ if (kthread_should_stop () || - (schedule_timeout (20 *HZ ) ==0 )) { + (freezable_schedule_timeout (20 *HZ ) ==0 )) {finish_wait (&nn->nfsd_ssc_waitq, &wait);kfree (work);return nfserr_eagain;
net/sunrpc/svc_xprt.c +2 -2
@@ -705,7 +705,7 @@ static int svc_alloc_arg(struct svc_rqstset_current_state (TASK_RUNNING );return -EINTR ; } -schedule_timeout (msecs_to_jiffies (500 )); +freezable_schedule_timeout (msecs_to_jiffies (500 )); } rqstp->rq_page_end = &rqstp->rq_pages[pages]; rqstp->rq_pages[pages] =NULL ;/* this might be seen in nfsd_splice_actor() */
@@ -765,7 +765,7 @@ static struct svc_xprt *svc_get_next_xprsmp_mb__after_atomic ();if (likely (rqst_should_sleep (rqstp))) - time_left =schedule_timeout (timeout); + time_left =freezable_schedule_timeout (timeout);else __set_current_state (TASK_RUNNING );
Greg Kroah-Hartman
maintainerPATCH 353/402 f2fs: fix to do sanity check on i_xattr_nid in sanity_check_inode()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chao Yu <[email protected]>
commit 20faaf30e55522bba2b56d9c46689233205d7717 upstream.
syzbot reports a kernel bug as below:
F2FS-fs (loop0): Mounted with checkpoint version = 48b305e4
==================================================================
BUG: KASAN: slab-out-of-bounds in f2fs_test_bit fs/f2fs/f2fs.h:2933 [inline] BUG: KASAN: slab-out-of-bounds in current_nat_addr fs/f2fs/node.h:213 [inline] BUG: KASAN: slab-out-of-bounds in f2fs_get_node_info+0xece/0x1200 fs/f2fs/node.c:600 Read of size 1 at addr ffff88807a58c76c by task syz-executor280/5076 CPU: 1 PID: 5076 Comm: syz-executor280 Not tainted 6.9.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: <TASK> __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 f2fs_test_bit fs/f2fs/f2fs.h:2933 [inline] current_nat_addr fs/f2fs/node.h:213 [inline] f2fs_get_node_info+0xece/0x1200 fs/f2fs/node.c:600 f2fs_xattr_fiemap fs/f2fs/data.c:1848 [inline] f2fs_fiemap+0x55d/0x1ee0 fs/f2fs/data.c:1925 ioctl_fiemap fs/ioctl.c:220 [inline] do_vfs_ioctl+0x1c07/0x2e50 fs/ioctl.c:838 __do_sys_ioctl fs/ioctl.c:902 [inline] __se_sys_ioctl+0x81/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
The root cause is we missed to do sanity check on i_xattr_nid during f2fs_iget(), so that in fiemap() path, current_nat_addr() will access nat_bitmap w/ offset from invalid i_xattr_nid, result in triggering kasan bug report, fix it.
--- fs/f2fs/inode.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/f2fs/inode.c +6 -0
@@ -330,6 +330,12 @@ static bool sanity_check_inode(struct in } } +if (fi->i_xattr_nid &&f2fs_check_nid_range (sbi, fi->i_xattr_nid)) { +f2fs_warn (sbi,"%s: inode (ino=%lx) has corrupted i_xattr_nid: %u, run fsck to fix." , + __func__, inode->i_ino, fi->i_xattr_nid); +return false; + } +return true; }
Greg Kroah-Hartman
maintainerPATCH 354/402 media: lgdt3306a: Add a check against null-pointer-def
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zheyu Ma <[email protected]>
commit c1115ddbda9c930fba0fdd062e7a8873ebaf898d upstream.
The driver should check whether the client provides the platform_data.
The following log reveals it:
[ 29.610324] BUG: KASAN: null-ptr-deref in kmemdup+0x30/0x40 [ 29.610730] Read of size 40 at addr 0000000000000000 by task bash/414 [ 29.612820] Call Trace: [ 29.613030] <TASK> [ 29.613201] dump_stack_lvl+0x56/0x6f [ 29.613496] ? kmemdup+0x30/0x40 [ 29.613754] print_report.cold+0x494/0x6b7 [ 29.614082] ? kmemdup+0x30/0x40 [ 29.614340] kasan_report+0x8a/0x190 [ 29.614628] ? kmemdup+0x30/0x40 [ 29.614888] kasan_check_range+0x14d/0x1d0 [ 29.615213] memcpy+0x20/0x60 [ 29.615454] kmemdup+0x30/0x40 [ 29.615700] lgdt3306a_probe+0x52/0x310 [ 29.616339] i2c_device_probe+0x951/0xa90
--- drivers/media/dvb-frontends/lgdt3306a.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/media/dvb-frontends/lgdt3306a.c +5 -0
@@ -2177,6 +2177,11 @@ static int lgdt3306a_probe(struct i2c_clstruct dvb_frontend *fe;int ret; +if (!client->dev.platform_data) { +dev_err (&client->dev,"platform data is mandatory\n" ); +return -EINVAL ; + } + config =kmemdup (client->dev.platform_data,sizeof (struct lgdt3306a_config ),GFP_KERNEL );if (config ==NULL ) {
Greg Kroah-Hartman
maintainerPATCH 355/402 drm/amdgpu: add error handle to avoid out-of-bounds
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bob Zhou <[email protected]>
commit 8b2faf1a4f3b6c748c0da36cda865a226534d520 upstream.
if the sdma_v4_0_irq_id_to_seq return -EINVAL, the process should be stop to avoid out-of-bounds read, so directly return -EINVAL.
--- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +3 -0
@@ -2152,6 +2152,9 @@ static int sdma_v4_0_process_trap_irq(stDRM_DEBUG ("IH: SDMA trap\n" ); instance =sdma_v4_0_irq_id_to_seq (entry->client_id); +if (instance <0 ) +return instance; +switch (entry->ring_id) {case 0 :amdgpu_fence_process (&adev->sdma.instance[instance].ring);
Greg Kroah-Hartman
maintainerPATCH 356/402 ata: pata_legacy: make legacy_exit() work again
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sergey Shtylyov <[email protected]>
commit d4a89339f17c87c4990070e9116462d16e75894f upstream.
Commit defc9cd826e4 ("pata_legacy: resychronize with upstream changes and resubmit") missed to update legacy_exit(), so that it now fails to do any cleanup -- the loop body there can never be entered. Fix that and finally remove now useless nr_legacy_host variable...
Found by Linux Verification Center (linuxtesting.org) with the Svace static analysis tool.
--- drivers/ata/pata_legacy.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/ata/pata_legacy.c +4 -4
@@ -173,8 +173,6 @@ static int legacy_port[NR_HOST] = { 0x1fstatic struct legacy_probe probe_list[NR_HOST ];static struct legacy_data legacy_data[NR_HOST ];static struct ata_host *legacy_host[NR_HOST ]; -static int nr_legacy_host; -/** * legacy_probe_add - Add interface to probe list
@@ -1276,9 +1274,11 @@ static __exit void legacy_exit(void) {int i; -for (i =0 ; i < nr_legacy_host; i++) { +for (i =0 ; i <NR_HOST ; i++) {struct legacy_data *ld = &legacy_data[i]; -ata_host_detach (legacy_host[i]); + +if (legacy_host[i]) +ata_host_detach (legacy_host[i]);platform_device_unregister (ld->platform_dev); } }
Greg Kroah-Hartman
maintainerPATCH 357/402 thermal/drivers/qcom/lmh: Check for SCM availability at probe
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Dybcio <[email protected]>
commit d9d3490c48df572edefc0b64655259eefdcbb9be upstream.
Up until now, the necessary scm availability check has not been performed, leading to possible null pointer dereferences (which did happen for me on RB1).
Fix that.
--- drivers/thermal/qcom/lmh.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/thermal/qcom/lmh.c +3 -0
@@ -92,6 +92,9 @@ static int lmh_probe(struct platform_devint temp_low, temp_high, temp_arm, cpu_id, ret;u32 node_id; +if (!qcom_scm_is_available ()) +return -EPROBE_DEFER ; + lmh_data =devm_kzalloc (dev,sizeof (*lmh_data),GFP_KERNEL );if (!lmh_data)return -ENOMEM ;
Greg Kroah-Hartman
maintainerPATCH 358/402 soc: qcom: rpmh-rsc: Enhance check for VRM in-flight request
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maulik Shah <[email protected]>
commit f592cc5794747b81e53b53dd6e80219ee25f0611 upstream.
Each RPMh VRM accelerator resource has 3 or 4 contiguous 4-byte aligned addresses associated with it. These control voltage, enable state, mode, and in legacy targets, voltage headroom. The current in-flight request checking logic looks for exact address matches. Requests for different addresses of the same RPMh resource as thus not detected as in-flight.
Add new cmd-db API cmd_db_match_resource_addr() to enhance the in-flight request check for VRM requests by ignoring the address offset.
This ensures that only one request is allowed to be in-flight for a given VRM resource. This is needed to avoid scenarios where request commands are carried out by RPMh hardware out-of-order leading to LDO regulator over-current protection triggering.
--- drivers/soc/qcom/cmd-db.c | 32 +++++++++++++++++++++++++++++++- drivers/soc/qcom/rpmh-rsc.c | 3 ++- include/soc/qcom/cmd-db.h | 10 +++++++++- 3 files changed, 42 insertions(+), 3 deletions(-)
drivers/soc/qcom/cmd-db.c +31 -1
@@ -1,6 +1,10 @@/* SPDX-License-Identifier: GPL-2.0 */ -/* Copyright (c) 2016-2018, 2020, The Linux Foundation. All rights reserved. */ +/* +* Copyright (c) 2016-2018, 2020, The Linux Foundation. All rights reserved. +* Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved. +*/ +#include <linux/bitfield.h> #include <linux/debugfs.h> #include <linux/kernel.h> #include <linux/module.h>
@@ -17,6 +21,8 @@#define MAX_SLV_ID 8#define SLAVE_ID_MASK 0x7#define SLAVE_ID_SHIFT 16 +#define SLAVE_ID (addr) FIELD_GET(GENMASK(19, 16), addr) +#define VRM_ADDR (addr) FIELD_GET(GENMASK(19, 4), addr)/** * struct entry_header: header for each entry in cmddb
@@ -217,6 +223,30 @@ const void *cmd_db_read_aux_data(const cEXPORT_SYMBOL (cmd_db_read_aux_data);/** +* cmd_db_match_resource_addr() - Compare if both Resource addresses are same +* +* @addr1: Resource address to compare +* @addr2: Resource address to compare +* +* Return: true if two addresses refer to the same resource, false otherwise +*/ +bool cmd_db_match_resource_addr (u32 addr1,u32 addr2) +{ +/* +* Each RPMh VRM accelerator resource has 3 or 4 contiguous 4-byte +* aligned addresses associated with it. Ignore the offset to check +* for VRM requests. +*/ +if (addr1 == addr2) +return true; +else if (SLAVE_ID (addr1) ==CMD_DB_HW_VRM &&VRM_ADDR (addr1) ==VRM_ADDR (addr2)) +return true; + +return false; +} +EXPORT_SYMBOL_GPL (cmd_db_match_resource_addr); + +/** * cmd_db_read_slave_id - Get the slave ID for a given resource address * * @id: Resource id to query the DB for version
drivers/soc/qcom/rpmh-rsc.c +2 -1
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. +* Copyright (c) 2023-2024, Qualcomm Innovation Center, Inc. All rights reserved. */ #define pr_fmt (fmt) "%s " fmt, KBUILD_MODNAME
@@ -519,7 +520,7 @@ static int check_for_req_inflight(structfor_each_set_bit (j, &curr_enabled,MAX_CMDS_PER_TCS ) { addr =read_tcs_cmd (drv,RSC_DRV_CMD_ADDR , i, j);for (k =0 ; k < msg->num_cmds; k++) { -if (addr == msg->cmds[k].addr) +if (cmd_db_match_resource_addr (msg->cmds[k].addr, addr))return -EBUSY ; } }
include/soc/qcom/cmd-db.h +9 -1
@@ -1,5 +1,8 @@/* SPDX-License-Identifier: GPL-2.0 */ -/* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. */ +/* +* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. +* Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved. +*/ #ifndef __QCOM_COMMAND_DB_H__#define __QCOM_COMMAND_DB_H__
@@ -21,6 +24,8 @@ u32 cmd_db_read_addr(const char *resourcconst void *cmd_db_read_aux_data (const char *resource_id,size_t *len); +bool cmd_db_match_resource_addr (u32 addr1,u32 addr2); +enum cmd_db_hw_type cmd_db_read_slave_id (const char *resource_id);int cmd_db_ready (void );
@@ -31,6 +36,9 @@ static inline u32 cmd_db_read_addr(conststatic inline const void *cmd_db_read_aux_data (const char *resource_id,size_t *len) {return ERR_PTR (-ENODEV ); } +static inline bool cmd_db_match_resource_addr (u32 addr1,u32 addr2) +{return false; } +static inline enum cmd_db_hw_type cmd_db_read_slave_id (const char *resource_id) {return -ENODEV ; }
Greg Kroah-Hartman
maintainerPATCH 359/402 ACPI: resource: Do IRQ override on TongFang GXxHRXx and GMxHGxx
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christoffer Sandberg <[email protected]>
commit c81bf14f9db68311c2e75428eea070d97d603975 upstream.
Listed devices need the override for the keyboard to work.
--- drivers/acpi/resource.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/acpi/resource.c +12 -0
@@ -579,6 +579,18 @@ static const struct dmi_system_id lg_lap DMI_MATCH(DMI_BOARD_NAME, "X577"), }, }, + { +/* TongFang GXxHRXx/TUXEDO InfinityBook Pro Gen9 AMD */ + .matches = { + DMI_MATCH(DMI_BOARD_NAME, "GXxHRXx"), + }, + }, + { +/* TongFang GMxHGxx/TUXEDO Stellaris Slim Gen1 AMD */ + .matches = { + DMI_MATCH(DMI_BOARD_NAME, "GMxHGxx"), + }, + }, { } };
Greg Kroah-Hartman
maintainerPATCH 360/402 arm64: tegra: Correct Tegra132 I2C alias
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
commit 2633c58e1354d7de2c8e7be8bdb6f68a0a01bad7 upstream.
There is no such device as "as3722@40", because its name is "pmic". Use phandles for aliases to fix relying on full node path. This corrects aliases for RTC devices and also fixes dtc W=1 warning:
tegra132-norrin.dts:12.3-36: Warning (alias_paths): /aliases:rtc0: aliases property is not a valid node (/i2c@7000d000/as3722@40)
--- arch/arm64/boot/dts/nvidia/tegra132-norrin.dts | 4 ++-- arch/arm64/boot/dts/nvidia/tegra132.dtsi | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/nvidia/tegra132-norrin.dts +2 -2
@@ -9,8 +9,8 @@ compatible = "nvidia,norrin", "nvidia,tegra132", "nvidia,tegra124"; aliases { - rtc0 = "/i2c@7000d000/as3722@40"; - rtc1 = "/rtc@7000e000"; + rtc0 = &as3722; + rtc1 = &tegra_rtc; serial0 = &uarta; };
arch/arm64/boot/dts/nvidia/tegra132.dtsi +1 -1
@@ -573,7 +573,7 @@ status = "disabled"; }; - rtc@7000e000 { + tegra_rtc: rtc@7000e000 { compatible = "nvidia,tegra124-rtc", "nvidia,tegra20-rtc"; reg = <0x0 0x7000e000 0x0 0x100>; interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
Greg Kroah-Hartman
maintainerPATCH 361/402 arm64: dts: qcom: qcs404: fix bluetooth device address
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit f5f390a77f18eaeb2c93211a1b7c5e66b5acd423 upstream.
The 'local-bd-address' property is used to pass a unique Bluetooth device address from the boot firmware to the kernel and should otherwise be left unset so that the OS can prevent the controller from being used until a valid address has been provided through some other means (e.g. using btmgmt).
--- arch/arm64/boot/dts/qcom/qcs404-evb.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/qcs404-evb.dtsi +1 -1
@@ -60,7 +60,7 @@ vddrf-supply = <&vreg_l1_1p3>; vddch0-supply = <&vdd_ch0_3p3>; - local-bd-address = [ 02 00 00 00 5a ad ]; + local-bd-address = [ 00 00 00 00 00 00 ]; max-speed = <3200000>; };
Greg Kroah-Hartman
maintainerPATCH 362/402 md/raid5: fix deadlock that raid5d() wait for itself to clear MD_SB_CHANGE_PENDING
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yu Kuai <[email protected]>
commit 151f66bb618d1fd0eeb84acb61b4a9fa5d8bb0fa upstream.
Xiao reported that lvm2 test lvconvert-raid-takeover.sh can hang with small possibility, the root cause is exactly the same as commit bed9e27baf52 ("Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d"")
However, Dan reported another hang after that, and junxiao investigated the problem and found out that this is caused by plugged bio can't issue from raid5d().
Current implementation in raid5d() has a weird dependence:
1) md_check_recovery() from raid5d() must hold 'reconfig_mutex' to clear MD_SB_CHANGE_PENDING;
2) raid5d() handles IO in a deadloop, until all IO are issued;
3) IO from raid5d() must wait for MD_SB_CHANGE_PENDING to be cleared;
This behaviour is introduce before v2.6, and for consequence, if other context hold 'reconfig_mutex', and md_check_recovery() can't update super_block, then raid5d() will waste one cpu 100% by the deadloop, until 'reconfig_mutex' is released.
Refer to the implementation from raid1 and raid10, fix this problem by skipping issue IO if MD_SB_CHANGE_PENDING is still set after md_check_recovery(), daemon thread will be woken up when 'reconfig_mutex' is released. Meanwhile, the hang problem will be fixed as well.
--- drivers/md/raid5.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-)
drivers/md/raid5.c +3 -12
@@ -36,7 +36,6 @@*/ #include <linux/blkdev.h> -#include <linux/delay.h> #include <linux/kthread.h> #include <linux/raid/pq.h> #include <linux/async_tx.h>
@@ -6486,6 +6485,9 @@ static void raid5d(struct md_thread *thrint batch_size, released;unsigned int offset; +if (test_bit (MD_SB_CHANGE_PENDING , &mddev->sb_flags)) +break ; + released =release_stripe_list (conf, conf->temp_inactive_list);if (released)clear_bit (R5_DID_ALLOC , &conf->cache_state);
@@ -6522,18 +6524,7 @@ static void raid5d(struct md_thread *thrspin_unlock_irq (&conf->device_lock);md_check_recovery (mddev);spin_lock_irq (&conf->device_lock); - -/* -* Waiting on MD_SB_CHANGE_PENDING below may deadlock -* seeing md_check_recovery() is needed to clear -* the flag when using mdmon. -*/ -continue ; } - -wait_event_lock_irq (mddev->sb_wait, - !test_bit (MD_SB_CHANGE_PENDING , &mddev->sb_flags), - conf->device_lock); }pr_debug ("%d stripes handled\n" , handled);
Greg Kroah-Hartman
maintainerPATCH 363/402 wifi: rtl8xxxu: Fix the TX power of RTL8192CU, RTL8723AU
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bitterblue Smith <[email protected]>
commit 08b5d052d17a89bb8706b2888277d0b682dc1610 upstream.
Don't subtract 1 from the power index. This was added in commit 2fc0b8e5a17d ("rtl8xxxu: Add TX power base values for gen1 parts") for unknown reasons. The vendor drivers don't do this.
Also correct the calculations of values written to REG_OFDM0_X{C,D}_TX_IQ_IMBALANCE. According to the vendor driver, these are used for TX power training.
With these changes rtl8xxxu sets the TX power of RTL8192CU the same as the vendor driver.
None of this appears to have any effect on my RTL8192CU device.
--- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 26 +++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-)
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +11 -15
@@ -28,6 +28,7 @@#include <linux/wireless.h> #include <linux/firmware.h> #include <linux/moduleparam.h> +#include <linux/bitfield.h> #include <net/mac80211.h> #include "rtl8xxxu.h" #include "rtl8xxxu_regs.h"
@@ -1389,13 +1390,13 @@ rtl8xxxu_gen1_set_tx_power(struct rtl8xxu8 cck[RTL8723A_MAX_RF_PATHS ], ofdm[RTL8723A_MAX_RF_PATHS ];u8 ofdmbase[RTL8723A_MAX_RF_PATHS ], mcsbase[RTL8723A_MAX_RF_PATHS ];u32 val32, ofdm_a, ofdm_b, mcs_a, mcs_b; -u8 val8; +u8 val8, base;int group, i; group =rtl8xxxu_gen1_channel_to_group (channel); - cck[0 ] = priv->cck_tx_power_index_A[group] -1 ; - cck[1 ] = priv->cck_tx_power_index_B[group] -1 ; + cck[0 ] = priv->cck_tx_power_index_A[group]; + cck[1 ] = priv->cck_tx_power_index_B[group];if (priv->hi_pa) {if (cck[0 ] >0x20 )
@@ -1406,10 +1407,6 @@ rtl8xxxu_gen1_set_tx_power(struct rtl8xx ofdm[0 ] = priv->ht40_1s_tx_power_index_A[group]; ofdm[1 ] = priv->ht40_1s_tx_power_index_B[group]; -if (ofdm[0 ]) - ofdm[0 ] -=1 ; -if (ofdm[1 ]) - ofdm[1 ] -=1 ; ofdmbase[0 ] = ofdm[0 ] + priv->ofdm_tx_power_index_diff[group].a; ofdmbase[1 ] = ofdm[1 ] + priv->ofdm_tx_power_index_diff[group].b;
@@ -1498,20 +1495,19 @@ rtl8xxxu_gen1_set_tx_power(struct rtl8xxrtl8xxxu_write32 (priv,REG_TX_AGC_A_MCS15_MCS12 , mcs_a + power_base->reg_0e1c); + val8 =u32_get_bits (mcs_a + power_base->reg_0e1c,0xff000000 );for (i =0 ; i <3 ; i++) { -if (i !=2 ) - val8 = (mcsbase[0 ] >8 ) ? (mcsbase[0 ] -8 ) :0 ; -else - val8 = (mcsbase[0 ] >6 ) ? (mcsbase[0 ] -6 ) :0 ; + base = i !=2 ?8 :6 ; + val8 =max_t (int, val8 - base,0 );rtl8xxxu_write8 (priv,REG_OFDM0_XC_TX_IQ_IMBALANCE + i, val8); } +rtl8xxxu_write32 (priv,REG_TX_AGC_B_MCS15_MCS12 , mcs_b + power_base->reg_0868); + val8 =u32_get_bits (mcs_b + power_base->reg_0868,0xff000000 );for (i =0 ; i <3 ; i++) { -if (i !=2 ) - val8 = (mcsbase[1 ] >8 ) ? (mcsbase[1 ] -8 ) :0 ; -else - val8 = (mcsbase[1 ] >6 ) ? (mcsbase[1 ] -6 ) :0 ; + base = i !=2 ?8 :6 ; + val8 =max_t (int, val8 - base,0 );rtl8xxxu_write8 (priv,REG_OFDM0_XD_TX_IQ_IMBALANCE + i, val8); } }
Greg Kroah-Hartman
maintainerPATCH 364/402 wifi: rtlwifi: rtl8192de: Fix low speed with WPA3-SAE
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bitterblue Smith <[email protected]>
commit a7c0f48410f546772ac94a0f7b7291a15c4fc173 upstream.
Some (all?) management frames are incorrectly reported to mac80211 as decrypted when actually the hardware did not decrypt them. This results in speeds 3-5 times lower than expected, 20-30 Mbps instead of 100 Mbps.
Fix this by checking the encryption type field of the RX descriptor. rtw88 does the same thing.
This fix was tested only with rtl8192du, which will use the same code.
--- drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c | 5 ++--- drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.h | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-)
drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c +2 -3
@@ -414,7 +414,8 @@ bool rtl92de_rx_query_desc(struct ieee80 stats->icv = (u16 )get_rx_desc_icv (pdesc); stats->crc = (u16 )get_rx_desc_crc32 (pdesc); stats->hwerror = (stats->crc | stats->icv); - stats->decrypted = !get_rx_desc_swdec (pdesc); + stats->decrypted = !get_rx_desc_swdec (pdesc) && +get_rx_desc_enc_type (pdesc) !=RX_DESC_ENC_NONE ; stats->rate = (u8 )get_rx_desc_rxmcs (pdesc); stats->shortpreamble = (u16 )get_rx_desc_splcp (pdesc); stats->isampdu = (bool )(get_rx_desc_paggr (pdesc) ==1 );
@@ -427,8 +428,6 @@ bool rtl92de_rx_query_desc(struct ieee80 rx_status->band = hw->conf.chandef.chan->band;if (get_rx_desc_crc32 (pdesc)) rx_status->flag |=RX_FLAG_FAILED_FCS_CRC ; -if (!get_rx_desc_swdec (pdesc)) - rx_status->flag |=RX_FLAG_DECRYPTED ;if (get_rx_desc_bw (pdesc)) rx_status->bw =RATE_INFO_BW_40 ;if (get_rx_desc_rxht (pdesc))
drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.h +14 -0
@@ -14,6 +14,15 @@#define USB_HWDESC_HEADER_LEN 32#define CRCLENGTH 4 +enum rtl92d_rx_desc_enc { +RX_DESC_ENC_NONE =0 , +RX_DESC_ENC_WEP40 =1 , +RX_DESC_ENC_TKIP_WO_MIC =2 , +RX_DESC_ENC_TKIP_MIC =3 , +RX_DESC_ENC_AES =4 , +RX_DESC_ENC_WEP104 =5 , +}; +/* macros to read/write various fields in RX or TX descriptors */ static inline void set_tx_desc_pkt_size (__le32 *__pdesc,u32 __val)
@@ -246,6 +255,11 @@ static inline u32 get_rx_desc_drv_info_sreturn le32_get_bits (*__pdesc,GENMASK (19 ,16 )); } +static inline u32 get_rx_desc_enc_type (__le32 *__pdesc) +{ +return le32_get_bits (*__pdesc,GENMASK (22 ,20 )); +} +static inline u32 get_rx_desc_shift (__le32 *__pdesc) {return le32_get_bits (*__pdesc,GENMASK (25 ,24 ));
Greg Kroah-Hartman
maintainerPATCH 365/402 wifi: rtlwifi: rtl8192de: Fix endianness issue in RX path
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bitterblue Smith <[email protected]>
commit 2f228d364da95ab58f63a3fedc00d5b2b7db16ab upstream.
Structs rx_desc_92d and rx_fwinfo_92d will not work for big endian systems.
Delete rx_desc_92d because it's big and barely used, and instead use the get_rx_desc_rxmcs and get_rx_desc_rxht functions, which work on big endian systems too.
Fix rx_fwinfo_92d by duplicating four of its members in the correct order.
Tested only with RTL8192DU, which will use the same code. Tested only on a little endian system.
--- drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c | 16 ++-- drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.h | 65 ++----------------- 2 files changed, 15 insertions(+), 66 deletions(-)
drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c +8 -8
@@ -35,7 +35,7 @@ static long _rtl92de_translate_todbm(str static void _rtl92de_query_rxphystatus(struct ieee80211_hw *hw, struct rtl_stats *pstats, - struct rx_desc_92d *pdesc, + __le32 *pdesc, struct rx_fwinfo_92d *p_drvinfo, bool packet_match_bssid, bool packet_toself,
@@ -49,8 +49,10 @@ static void _rtl92de_query_rxphystatus(su8 i, max_spatial_stream;u32 rssi, total_rssi =0 ;bool is_cck_rate; +u8 rxmcs; - is_cck_rate =RX_HAL_IS_CCK_RATE (pdesc->rxmcs); + rxmcs =get_rx_desc_rxmcs (pdesc); + is_cck_rate = rxmcs <=DESC_RATE11M ; pstats->packet_matchbssid = packet_match_bssid; pstats->packet_toself = packet_toself; pstats->packet_beacon = packet_beacon;
@@ -158,8 +160,8 @@ static void _rtl92de_query_rxphystatus(s pstats->rx_pwdb_all = pwdb_all; pstats->rxpower = rx_pwr_all; pstats->recvsignalpower = rx_pwr_all; -if (pdesc->rxht && pdesc->rxmcs >=DESC_RATEMCS8 && - pdesc->rxmcs <=DESC_RATEMCS15 ) +if (get_rx_desc_rxht (pdesc) && rxmcs >=DESC_RATEMCS8 && + rxmcs <=DESC_RATEMCS15 ) max_spatial_stream =2 ;else max_spatial_stream =1 ;
@@ -365,7 +367,7 @@ static void _rtl92de_process_phyinfo(strstatic void _rtl92de_translate_rx_signal_stuff (struct ieee80211_hw *hw,struct sk_buff *skb,struct rtl_stats *pstats, -struct rx_desc_92d *pdesc, +__le32 *pdesc,struct rx_fwinfo_92d *p_drvinfo) {struct rtl_mac *mac =rtl_mac (rtl_priv (hw));
@@ -441,9 +443,7 @@ bool rtl92de_rx_query_desc(struct ieee80if (phystatus) { p_drvinfo = (struct rx_fwinfo_92d *)(skb->data + stats->rx_bufshift); -_rtl92de_translate_rx_signal_stuff (hw, - skb, stats, - (struct rx_desc_92d *)pdesc, +_rtl92de_translate_rx_signal_stuff (hw, skb, stats, pdesc, p_drvinfo); }/*rx_status->qual = stats->signal; */
drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.h +7 -58
81 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 366/402 arm64: dts: hi3798cv200: fix the size of GICR
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yang Xiwen <[email protected]>
commit 428a575dc9038846ad259466d5ba109858c0a023 upstream.
During boot, Linux kernel complains:
[ 0.000000] GIC: GICv2 detected, but range too small and irqchip.gicv2_force_probe not set
This SoC is using a regular GIC-400 and the GICR space size should be 8KB rather than 256B.
With this patch:
[ 0.000000] GIC: Using split EOI/Deactivate mode
So this should be the correct fix.
--- arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi +1 -1
@@ -58,7 +58,7 @@ gic: interrupt-controller@f1001000 { compatible = "arm,gic-400"; reg = <0x0 0xf1001000 0x0 0x1000>, /* GICD */ - <0x0 0xf1002000 0x0 0x100>; /* GICC */ + <0x0 0xf1002000 0x0 0x2000>; /* GICC */ #address-cells = <0>; #interrupt-cells = <3>; interrupt-controller;
Greg Kroah-Hartman
maintainerPATCH 367/402 media: mc: mark the media devnode as registered from the, start
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans Verkuil <[email protected]>
commit 4bc60736154bc9e0e39d3b88918f5d3762ebe5e0 upstream.
First the media device node was created, and if successful it was marked as 'registered'. This leaves a small race condition where an application can open the device node and get an error back because the 'registered' flag was not yet set.
Change the order: first set the 'registered' flag, then actually register the media device node. If that fails, then clear the flag.
--- drivers/media/mc/mc-devnode.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/media/mc/mc-devnode.c +2 -3
@@ -246,15 +246,14 @@ int __must_check media_devnode_register(kobject_set_name (&devnode->cdev.kobj,"media%d" , devnode->minor);/* Part 3: Add the media and char device */ +set_bit (MEDIA_FLAG_REGISTERED , &devnode->flags); ret =cdev_device_add (&devnode->cdev, &devnode->dev);if (ret <0 ) { +clear_bit (MEDIA_FLAG_REGISTERED , &devnode->flags);pr_err ("%s: cdev_device_add failed\n" , __func__); goto cdev_add_error; } -/* Part 4: Activate this minor. The char device can now be used. */ -set_bit (MEDIA_FLAG_REGISTERED , &devnode->flags); -return 0 ; cdev_add_error:
Greg Kroah-Hartman
maintainerPATCH 368/402 media: mxl5xx: Move xpt structures off stack
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nathan Chancellor <[email protected]>
commit 526f4527545b2d4ce0733733929fac7b6da09ac6 upstream.
When building for LoongArch with clang 18.0.0, the stack usage of probe() is larger than the allowed 2048 bytes:
drivers/media/dvb-frontends/mxl5xx.c:1698:12: warning: stack frame size (2368) exceeds limit (2048) in 'probe' [-Wframe-larger-than]
1698 | static int probe(struct mxl *state, struct mxl5xx_cfg *cfg)
| ^
1 warning generated.
This is the result of the linked LLVM commit, which changes how the arrays of structures in config_ts() get handled with CONFIG_INIT_STACK_ZERO and CONFIG_INIT_STACK_PATTERN, which causes the above warning in combination with inlining, as config_ts() gets inlined into probe().
This warning can be easily fixed by moving the array of structures off of the stackvia 'static const', which is a better location for these variables anyways because they are static data that is only ever read from, never modified, so allocating the stack space is wasteful.
This drops the stack usage from 2368 bytes to 256 bytes with the same compiler and configuration.
--- drivers/media/dvb-frontends/mxl5xx.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/media/dvb-frontends/mxl5xx.c +11 -11
@@ -1390,57 +1390,57 @@ static int config_ts(struct mxl *state,u32 nco_count_min =0 ;u32 clk_type =0 ; -struct MXL_REG_FIELD_T xpt_sync_polarity[MXL_HYDRA_DEMOD_MAX ] = { +static const struct MXL_REG_FIELD_T xpt_sync_polarity[MXL_HYDRA_DEMOD_MAX ] = { {0x90700010 ,8 ,1 }, {0x90700010 ,9 ,1 }, {0x90700010 ,10 ,1 }, {0x90700010 ,11 ,1 }, {0x90700010 ,12 ,1 }, {0x90700010 ,13 ,1 }, {0x90700010 ,14 ,1 }, {0x90700010 ,15 ,1 } }; -struct MXL_REG_FIELD_T xpt_clock_polarity[MXL_HYDRA_DEMOD_MAX ] = { +static const struct MXL_REG_FIELD_T xpt_clock_polarity[MXL_HYDRA_DEMOD_MAX ] = { {0x90700010 ,16 ,1 }, {0x90700010 ,17 ,1 }, {0x90700010 ,18 ,1 }, {0x90700010 ,19 ,1 }, {0x90700010 ,20 ,1 }, {0x90700010 ,21 ,1 }, {0x90700010 ,22 ,1 }, {0x90700010 ,23 ,1 } }; -struct MXL_REG_FIELD_T xpt_valid_polarity[MXL_HYDRA_DEMOD_MAX ] = { +static const struct MXL_REG_FIELD_T xpt_valid_polarity[MXL_HYDRA_DEMOD_MAX ] = { {0x90700014 ,0 ,1 }, {0x90700014 ,1 ,1 }, {0x90700014 ,2 ,1 }, {0x90700014 ,3 ,1 }, {0x90700014 ,4 ,1 }, {0x90700014 ,5 ,1 }, {0x90700014 ,6 ,1 }, {0x90700014 ,7 ,1 } }; -struct MXL_REG_FIELD_T xpt_ts_clock_phase[MXL_HYDRA_DEMOD_MAX ] = { +static const struct MXL_REG_FIELD_T xpt_ts_clock_phase[MXL_HYDRA_DEMOD_MAX ] = { {0x90700018 ,0 ,3 }, {0x90700018 ,4 ,3 }, {0x90700018 ,8 ,3 }, {0x90700018 ,12 ,3 }, {0x90700018 ,16 ,3 }, {0x90700018 ,20 ,3 }, {0x90700018 ,24 ,3 }, {0x90700018 ,28 ,3 } }; -struct MXL_REG_FIELD_T xpt_lsb_first[MXL_HYDRA_DEMOD_MAX ] = { +static const struct MXL_REG_FIELD_T xpt_lsb_first[MXL_HYDRA_DEMOD_MAX ] = { {0x9070000C ,16 ,1 }, {0x9070000C ,17 ,1 }, {0x9070000C ,18 ,1 }, {0x9070000C ,19 ,1 }, {0x9070000C ,20 ,1 }, {0x9070000C ,21 ,1 }, {0x9070000C ,22 ,1 }, {0x9070000C ,23 ,1 } }; -struct MXL_REG_FIELD_T xpt_sync_byte[MXL_HYDRA_DEMOD_MAX ] = { +static const struct MXL_REG_FIELD_T xpt_sync_byte[MXL_HYDRA_DEMOD_MAX ] = { {0x90700010 ,0 ,1 }, {0x90700010 ,1 ,1 }, {0x90700010 ,2 ,1 }, {0x90700010 ,3 ,1 }, {0x90700010 ,4 ,1 }, {0x90700010 ,5 ,1 }, {0x90700010 ,6 ,1 }, {0x90700010 ,7 ,1 } }; -struct MXL_REG_FIELD_T xpt_enable_output[MXL_HYDRA_DEMOD_MAX ] = { +static const struct MXL_REG_FIELD_T xpt_enable_output[MXL_HYDRA_DEMOD_MAX ] = { {0x9070000C ,0 ,1 }, {0x9070000C ,1 ,1 }, {0x9070000C ,2 ,1 }, {0x9070000C ,3 ,1 }, {0x9070000C ,4 ,1 }, {0x9070000C ,5 ,1 }, {0x9070000C ,6 ,1 }, {0x9070000C ,7 ,1 } }; -struct MXL_REG_FIELD_T xpt_err_replace_sync[MXL_HYDRA_DEMOD_MAX ] = { +static const struct MXL_REG_FIELD_T xpt_err_replace_sync[MXL_HYDRA_DEMOD_MAX ] = { {0x9070000C ,24 ,1 }, {0x9070000C ,25 ,1 }, {0x9070000C ,26 ,1 }, {0x9070000C ,27 ,1 }, {0x9070000C ,28 ,1 }, {0x9070000C ,29 ,1 }, {0x9070000C ,30 ,1 }, {0x9070000C ,31 ,1 } }; -struct MXL_REG_FIELD_T xpt_err_replace_valid[MXL_HYDRA_DEMOD_MAX ] = { +static const struct MXL_REG_FIELD_T xpt_err_replace_valid[MXL_HYDRA_DEMOD_MAX ] = { {0x90700014 ,8 ,1 }, {0x90700014 ,9 ,1 }, {0x90700014 ,10 ,1 }, {0x90700014 ,11 ,1 }, {0x90700014 ,12 ,1 }, {0x90700014 ,13 ,1 }, {0x90700014 ,14 ,1 }, {0x90700014 ,15 ,1 } }; -struct MXL_REG_FIELD_T xpt_continuous_clock[MXL_HYDRA_DEMOD_MAX ] = { +static const struct MXL_REG_FIELD_T xpt_continuous_clock[MXL_HYDRA_DEMOD_MAX ] = { {0x907001D4 ,0 ,1 }, {0x907001D4 ,1 ,1 }, {0x907001D4 ,2 ,1 }, {0x907001D4 ,3 ,1 }, {0x907001D4 ,4 ,1 }, {0x907001D4 ,5 ,1 }, {0x907001D4 ,6 ,1 }, {0x907001D4 ,7 ,1 } }; -struct MXL_REG_FIELD_T xpt_nco_clock_rate[MXL_HYDRA_DEMOD_MAX ] = { +static const struct MXL_REG_FIELD_T xpt_nco_clock_rate[MXL_HYDRA_DEMOD_MAX ] = { {0x90700044 ,16 ,80 }, {0x90700044 ,16 ,81 }, {0x90700044 ,16 ,82 }, {0x90700044 ,16 ,83 }, {0x90700044 ,16 ,84 }, {0x90700044 ,16 ,85 },
Greg Kroah-Hartman
maintainerPATCH 369/402 media: v4l2-core: hold videodev_lock until dev reg, finishes
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans Verkuil <[email protected]>
commit 1ed4477f2ea4743e7c5e1f9f3722152d14e6eeb1 upstream.
After the new V4L2 device node was registered, some additional initialization was done before the device node was marked as 'registered'. During the time between creating the device node and marking it as 'registered' it was possible to open the device node, which would return -ENODEV since the 'registered' flag was not yet set.
Hold the videodev_lock mutex from just before the device node is registered until the 'registered' flag is set. Since v4l2_open will take the same lock, it will wait until this registration process is finished. This resolves this race condition.
--- drivers/media/v4l2-core/v4l2-dev.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/media/v4l2-core/v4l2-dev.c +3 -0
@@ -1033,8 +1033,10 @@ int __video_register_device(struct video vdev->dev.devt =MKDEV (VIDEO_MAJOR , vdev->minor); vdev->dev.parent = vdev->dev_parent;dev_set_name (&vdev->dev,"%s%d" , name_base, vdev->num); +mutex_lock (&videodev_lock); ret =device_register (&vdev->dev);if (ret <0 ) { +mutex_unlock (&videodev_lock);pr_err ("%s: device_register failed\n" , __func__); goto cleanup; }
@@ -1054,6 +1056,7 @@ int __video_register_device(struct video/* Part 6: Activate this minor. The char device can now be used. */ set_bit (V4L2_FL_REGISTERED , &vdev->flags); +mutex_unlock (&videodev_lock);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 370/402 mmc: core: Add mmc_gpiod_set_cd_config() function
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit 63a7cd660246aa36af263b85c33ecc6601bf04be upstream.
Some mmc host drivers may need to fixup a card-detection GPIO's config to e.g. enable the GPIO controllers builtin pull-up resistor on devices where the firmware description of the GPIO is broken (e.g. GpioInt with PullNone instead of PullUp in ACPI DSDT).
Since this is the exception rather then the rule adding a config parameter to mmc_gpiod_request_cd() seems undesirable, so instead add a new mmc_gpiod_set_cd_config() function. This is simply a wrapper to call gpiod_set_config() on the card-detect GPIO acquired through mmc_gpiod_request_cd().
--- drivers/mmc/core/slot-gpio.c | 20 ++++++++++++++++++++ include/linux/mmc/slot-gpio.h | 1 + 2 files changed, 21 insertions(+)
drivers/mmc/core/slot-gpio.c +20 -0
@@ -202,6 +202,26 @@ int mmc_gpiod_request_cd(struct mmc_host }EXPORT_SYMBOL (mmc_gpiod_request_cd); +/** +* mmc_gpiod_set_cd_config - set config for card-detection GPIO +* @host: mmc host +* @config: Generic pinconf config (from pinconf_to_config_packed()) +* +* This can be used by mmc host drivers to fixup a card-detection GPIO's config +* (e.g. set PIN_CONFIG_BIAS_PULL_UP) after acquiring the GPIO descriptor +* through mmc_gpiod_request_cd(). +* +* Returns: +* 0 on success, or a negative errno value on error. +*/ +int mmc_gpiod_set_cd_config (struct mmc_host *host,unsigned long config) +{ +struct mmc_gpio *ctx = host->slot.handler_priv; + +return gpiod_set_config (ctx->cd_gpio, config); +} +EXPORT_SYMBOL (mmc_gpiod_set_cd_config); +bool mmc_can_gpio_cd (struct mmc_host *host) {struct mmc_gpio *ctx = host->slot.handler_priv;
include/linux/mmc/slot-gpio.h +1 -0
@@ -20,6 +20,7 @@ int mmc_gpiod_request_cd(struct mmc_host unsigned int debounce);int mmc_gpiod_request_ro (struct mmc_host *host,const char *con_id,unsigned int idx,unsigned int debounce); +int mmc_gpiod_set_cd_config (struct mmc_host *host,unsigned long config);void mmc_gpio_set_cd_isr (struct mmc_host *host,irqreturn_t (*isr)(int irq,void *dev_id));int mmc_gpio_set_cd_wake (struct mmc_host *host,bool on);
Greg Kroah-Hartman
maintainerPATCH 371/402 mmc: sdhci-acpi: Sort DMI quirks alphabetically
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit a92a73b1d9249d155412d8ac237142fa716803ea upstream.
Sort the DMI quirks alphabetically.
--- drivers/mmc/host/sdhci-acpi.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-)
drivers/mmc/host/sdhci-acpi.c +13 -12
@@ -795,9 +795,22 @@ static const struct acpi_device_id sdhci };MODULE_DEVICE_TABLE (acpi, sdhci_acpi_ids); +/* Please keep this list sorted alphabetically */ static const struct dmi_system_id sdhci_acpi_quirks[] = { {/* +* The Acer Aspire Switch 10 (SW5-012) microSD slot always +* reports the card being write-protected even though microSD +* cards do not have a write-protect switch at all. +*/ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Acer" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"Aspire SW5-012" ), + }, + .driver_data = (void *)DMI_QUIRK_SD_NO_WRITE_PROTECT , + }, + { +/* * The Lenovo Miix 320-10ICR has a bug in the _PS0 method of * the SHC1 ACPI device, this bug causes it to reprogram the * wrong LDO (DLDO3) to 1.8V if 1.8V modes are used and the
@@ -812,18 +825,6 @@ static const struct dmi_system_id sdhci_ }, {/* -* The Acer Aspire Switch 10 (SW5-012) microSD slot always -* reports the card being write-protected even though microSD -* cards do not have a write-protect switch at all. -*/ - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"Acer" ), - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire SW5-012"), - }, - .driver_data = (void *)DMI_QUIRK_SD_NO_WRITE_PROTECT, - }, - { -/* * The Toshiba WT8-B's microSD slot always reports the card being * write-protected. */
Greg Kroah-Hartman
maintainerPATCH 372/402 mmc: sdhci-acpi: Fix Lenovo Yoga Tablet 2 Pro 1380 sdcard slot not working
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit f3521d7cbaefff19cc656325787ed797e5f6a955 upstream.
The Lenovo Yoga Tablet 2 Pro 1380 sdcard slot has an active high cd pin and a broken wp pin which always reports the card being write-protected.
Add a DMI quirk to address both issues.
--- drivers/mmc/host/sdhci-acpi.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
drivers/mmc/host/sdhci-acpi.c +24 -0
@@ -82,6 +82,7 @@ struct sdhci_acpi_host {enum {DMI_QUIRK_RESET_SD_SIGNAL_VOLT_ON_SUSP =BIT (0 ),DMI_QUIRK_SD_NO_WRITE_PROTECT =BIT (1 ), +DMI_QUIRK_SD_CD_ACTIVE_HIGH =BIT (2 ), };static inline void *sdhci_acpi_priv (struct sdhci_acpi_host *c)
@@ -825,6 +826,26 @@ static const struct dmi_system_id sdhci_ }, {/* +* Lenovo Yoga Tablet 2 Pro 1380F/L (13" Android version) this +* has broken WP reporting and an inverted CD signal. +* Note this has more or less the same BIOS as the Lenovo Yoga +* Tablet 2 830F/L or 1050F/L (8" and 10" Android), but unlike +* the 830 / 1050 models which share the same mainboard this +* model has a different mainboard and the inverted CD and +* broken WP are unique to this board. +*/ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Intel Corp." ), +DMI_MATCH (DMI_PRODUCT_NAME ,"VALLEYVIEW C0 PLATFORM" ), +DMI_MATCH (DMI_BOARD_NAME ,"BYT-T FFD8" ), +/* Full match so as to NOT match the 830/1050 BIOS */ + DMI_MATCH(DMI_BIOS_VERSION, "BLADE_21.X64.0005.R00.1504101516"), + }, + .driver_data = (void *)(DMI_QUIRK_SD_NO_WRITE_PROTECT | + DMI_QUIRK_SD_CD_ACTIVE_HIGH), + }, + { +/* * The Toshiba WT8-B's microSD slot always reports the card being * write-protected. */
@@ -948,6 +969,9 @@ static int sdhci_acpi_probe(struct platfif (sdhci_acpi_flag (c,SDHCI_ACPI_SD_CD )) {bool v =sdhci_acpi_flag (c,SDHCI_ACPI_SD_CD_OVERRIDE_LEVEL ); +if (quirks &DMI_QUIRK_SD_CD_ACTIVE_HIGH ) + host->mmc->caps2 |=MMC_CAP2_CD_ACTIVE_HIGH ; + err =mmc_gpiod_request_cd (host->mmc,NULL ,0 , v,0 );if (err) {if (err == -EPROBE_DEFER )
Greg Kroah-Hartman
maintainerPATCH 373/402 mmc: sdhci-acpi: Disable write protect detection on Toshiba WT10-A
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit ef3eab75e17191e5665f52e64e85bc29d5705a7b upstream.
On the Toshiba WT10-A the microSD slot always reports the card being write-protected, just like on the Toshiba WT8-B.
Add a DMI quirk to work around this.
--- drivers/mmc/host/sdhci-acpi.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/mmc/host/sdhci-acpi.c +11 -0
@@ -855,6 +855,17 @@ static const struct dmi_system_id sdhci_ }, .driver_data = (void *)DMI_QUIRK_SD_NO_WRITE_PROTECT, }, + { + /* + * The Toshiba WT10-A's microSD slot always reports the card being + * write-protected. + */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), + DMI_MATCH(DMI_PRODUCT_NAME, "TOSHIBA WT10-A"), + }, + .driver_data = (void *)DMI_QUIRK_SD_NO_WRITE_PROTECT, + }, {} /* Terminating entry */ };
Greg Kroah-Hartman
maintainerPATCH 374/402 fbdev: savage: Handle err return when savagefb_check_var failed
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cai Xinchen <[email protected]>
commit 6ad959b6703e2c4c5d7af03b4cfd5ff608036339 upstream.
The commit 04e5eac8f3ab("fbdev: savage: Error out if pixclock equals zero") checks the value of pixclock to avoid divide-by-zero error. However the function savagefb_probe doesn't handle the error return of savagefb_check_var. When pixclock is 0, it will cause divide-by-zero error.
--- drivers/video/fbdev/savage/savagefb_driver.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/video/fbdev/savage/savagefb_driver.c +4 -1
@@ -2271,7 +2271,10 @@ static int savagefb_probe(struct pci_devif (info->var.xres_virtual >0x1000 ) info->var.xres_virtual =0x1000 ;#endif -savagefb_check_var (&info->var, info); + err =savagefb_check_var (&info->var, info); +if (err) + goto failed; +savagefb_set_fix (info);/*
Greg Kroah-Hartman
maintainerPATCH 375/402 drm/amdgpu/atomfirmware: add intergrated info v2.3 table
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Ma <[email protected]>
commit e64e8f7c178e5228e0b2dbb504b9dc75953a319f upstream.
[Why]
The vram width value is 0.
Because the integratedsysteminfo table in VBIOS has updated to 2.3.
[How]
Driver needs a new intergrated info v2.3 table too. Then the vram width value will be correct.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 15 ++++++++ drivers/gpu/drm/amd/include/atomfirmware.h | 43 +++++++++++++++++++++++ 2 files changed, 58 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c +15 -0
@@ -149,6 +149,7 @@ union igp_info {struct atom_integrated_system_info_v1_11 v11;struct atom_integrated_system_info_v1_12 v12;struct atom_integrated_system_info_v2_1 v21; +struct atom_integrated_system_info_v2_3 v23; };union umc_info {
@@ -283,6 +284,20 @@ amdgpu_atomfirmware_get_vram_info(structif (vram_type) *vram_type =convert_atom_mem_type_to_vram_type (adev, mem_type);break ; +case 3 : + mem_channel_number = igp_info->v23.umachannelnumber; +if (!mem_channel_number) + mem_channel_number =1 ; + mem_type = igp_info->v23.memorytype; +if (mem_type == LpDdr5MemType) + mem_channel_width =32 ; +else + mem_channel_width =64 ; +if (vram_width) + *vram_width = mem_channel_number * mem_channel_width; +if (vram_type) + *vram_type =convert_atom_mem_type_to_vram_type (adev, mem_type); +break ;default :return -EINVAL ; }
drivers/gpu/drm/amd/include/atomfirmware.h +43 -0
49 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 376/402 KVM: arm64: Fix AArch32 register narrowing on userspace write
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Zyngier <[email protected]>
commit 947051e361d551e0590777080ffc4926190f62f2 upstream.
When userspace writes to one of the core registers, we make sure to narrow the corresponding GPRs if PSTATE indicates an AArch32 context.
The code tries to check whether the context is EL0 or EL1 so that it narrows the correct registers. But it does so by checking the full PSTATE instead of PSTATE.M.
As a consequence, and if we are restoring an AArch32 EL0 context in a 64bit guest, and that PSTATE has *any* bit set outside of PSTATE.M, we narrow *all* registers instead of only the first 15, destroying the 64bit state.
Obviously, this is not something the guest is likely to enjoy.
Correctly masking PSTATE to only evaluate PSTATE.M fixes it.
--- arch/arm64/kvm/guest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kvm/guest.c +1 -1
@@ -270,7 +270,7 @@ static int set_core_reg(struct kvm_vcpuif (*vcpu_cpsr (vcpu) &PSR_MODE32_BIT ) {int i, nr_reg; -switch (*vcpu_cpsr (vcpu)) { +switch (*vcpu_cpsr (vcpu) &PSR_AA32_MODE_MASK ) {/* * Either we are dealing with user mode, and only the * first 15 registers (+ PC) must be narrowed to 32bit.
Greg Kroah-Hartman
maintainerPATCH 377/402 KVM: arm64: Allow AArch32 PSTATE.M to be restored as System mode
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Zyngier <[email protected]>
commit dfe6d190f38fc5df5ff2614b463a5195a399c885 upstream.
It appears that we don't allow a vcpu to be restored in AArch32 System mode, as we *never* included it in the list of valid modes.
Just add it to the list of allowed modes.
--- arch/arm64/kvm/guest.c | 1 + 1 file changed, 1 insertion(+)
arch/arm64/kvm/guest.c +1 -0
@@ -250,6 +250,7 @@ static int set_core_reg(struct kvm_vcpucase PSR_AA32_MODE_SVC :case PSR_AA32_MODE_ABT :case PSR_AA32_MODE_UND : +case PSR_AA32_MODE_SYS :if (!vcpu_el1_is_32bit (vcpu))return -EINVAL ;break ;
Greg Kroah-Hartman
maintainerPATCH 378/402 crypto: ecdsa - Fix module auto-load on add-key
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Berger <[email protected]>
commit 48e4fd6d54f54d0ceab5a952d73e47a9454a6ccb upstream.
Add module alias with the algorithm cra_name similar to what we have for RSA-related and other algorithms.
The kernel attempts to modprobe asymmetric algorithms using the names "crypto-$cra_name" and "crypto-$cra_name-all." However, since these aliases are currently missing, the modules are not loaded. For instance, when using the add_key function, the hash algorithm is typically loaded automatically, but the asymmetric algorithm is not.
Steps to test:
1. Create certificate
openssl req -x509 -sha256 -newkey ec \ -pkeyopt "ec_paramgen_curve:secp384r1" -keyout key.pem -days 365 \ -subj '/CN=test' -nodes -outform der -out nist-p384.der
2. Optionally, trace module requests with: trace-cmd stream -e module &
3. Trigger add_key call for the cert:
# keyctl padd asymmetric "" @u < nist-p384.der 641069229 # lsmod | head -2 Module Size Used by ecdsa_generic 16384 0
--- crypto/ecdsa.c | 3 +++ 1 file changed, 3 insertions(+)
crypto/ecdsa.c +3 -0
@@ -373,4 +373,7 @@ module_exit(ecdsa_exit);MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Stefan Berger <[email protected]>" );MODULE_DESCRIPTION ("ECDSA generic algorithm" ); +MODULE_ALIAS_CRYPTO ("ecdsa-nist-p192" ); +MODULE_ALIAS_CRYPTO ("ecdsa-nist-p256" ); +MODULE_ALIAS_CRYPTO ("ecdsa-nist-p384" );MODULE_ALIAS_CRYPTO ("ecdsa-generic" );
Greg Kroah-Hartman
maintainerPATCH 379/402 crypto: ecrdsa - Fix module auto-load on add_key
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vitaly Chikunov <[email protected]>
commit eb5739a1efbc9ff216271aeea0ebe1c92e5383e5 upstream.
Add module alias with the algorithm cra_name similar to what we have for RSA-related and other algorithms.
The kernel attempts to modprobe asymmetric algorithms using the names "crypto-$cra_name" and "crypto-$cra_name-all." However, since these aliases are currently missing, the modules are not loaded. For instance, when using the add_key function, the hash algorithm is typically loaded automatically, but the asymmetric algorithm is not.
Steps to test:
1. Cert is generated usings ima-evm-utils test suite with gen-keys.sh, example cert is provided below:
$ base64 -d >test-gost2012_512-A.cer <<EOF MIIB/DCCAWagAwIBAgIUK8+whWevr3FFkSdU9GLDAM7ure8wDAYIKoUDBwEBAwMFADARMQ8wDQYD VQQDDAZDQSBLZXkwIBcNMjIwMjAxMjIwOTQxWhgPMjA4MjEyMDUyMjA5NDFaMBExDzANBgNVBAMM BkNBIEtleTCBoDAXBggqhQMHAQEBAjALBgkqhQMHAQIBAgEDgYQABIGALXNrTJGgeErBUOov3Cfo IrHF9fcj8UjzwGeKCkbCcINzVUbdPmCopeJRHDJEvQBX1CQUPtlwDv6ANjTTRoq5nCk9L5PPFP1H z73JIXHT0eRBDVoWy0cWDRz1mmQlCnN2HThMtEloaQI81nTlKZOcEYDtDpi5WODmjEeRNQJMdqCj UDBOMAwGA1UdEwQFMAMBAf8wHQYDVR0OBBYEFCwfOITMbE9VisW1i2TYeu1tAo5QMB8GA1UdIwQY MBaAFCwfOITMbE9VisW1i2TYeu1tAo5QMAwGCCqFAwcBAQMDBQADgYEAmBfJCMTdC0/NSjz4BBiQ qDIEjomO7FEHYlkX5NGulcF8FaJW2jeyyXXtbpnub1IQ8af1KFIpwoS2e93LaaofxpWlpQLlju6m KYLOcO4xK3Whwa2hBAz9YbpUSFjvxnkS2/jpH2MsOSXuUEeCruG/RkHHB3ACef9umG6HCNQuAPY= EOF
2. Optionally, trace module requests with: trace-cmd stream -e module &
3. Trigger add_key call for the cert:
# keyctl padd asymmetric "" @u <test-gost2012_512-A.cer 939910969 # lsmod | head -3 Module Size Used by ecrdsa_generic 16384 0 streebog_generic 28672 0
--- crypto/ecrdsa.c | 1 + 1 file changed, 1 insertion(+)
crypto/ecrdsa.c +1 -0
@@ -294,4 +294,5 @@ module_exit(ecrdsa_mod_fini);MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Vitaly Chikunov <[email protected]>" );MODULE_DESCRIPTION ("EC-RDSA generic algorithm" ); +MODULE_ALIAS_CRYPTO ("ecrdsa" );MODULE_ALIAS_CRYPTO ("ecrdsa-generic" );
Greg Kroah-Hartman
maintainerPATCH 380/402 crypto: qat - Fix ADF_DEV_RESET_SYNC memory leak
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Herbert Xu <[email protected]>
commit d3b17c6d9dddc2db3670bc9be628b122416a3d26 upstream.
Using completion_done to determine whether the caller has gone away only works after a complete call. Furthermore it's still possible that the caller has not yet called wait_for_completion, resulting in another potential UAF.
Fix this by making the caller use cancel_work_sync and then freeing the memory safely.
--- drivers/crypto/qat/qat_common/adf_aer.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-)
drivers/crypto/qat/qat_common/adf_aer.c +5 -14
@@ -95,8 +95,7 @@ static void adf_device_reset_worker(struif (adf_dev_init (accel_dev) ||adf_dev_start (accel_dev)) {/* The device hanged and we can't restart it so stop here */ dev_err (&GET_DEV (accel_dev),"Restart device failed\n" ); -if (reset_data->mode ==ADF_DEV_RESET_ASYNC || -completion_done (&reset_data->compl)) +if (reset_data->mode ==ADF_DEV_RESET_ASYNC )kfree (reset_data);WARN (1 ,"QAT: device restart failed. Device is unusable\n" );return ;
@@ -104,16 +103,8 @@ static void adf_device_reset_worker(struadf_dev_restarted_notify (accel_dev);clear_bit (ADF_STATUS_RESTARTING , &accel_dev->status); -/* -* The dev is back alive. Notify the caller if in sync mode -* -* If device restart will take a more time than expected, -* the schedule_reset() function can timeout and exit. This can be -* detected by calling the completion_done() function. In this case -* the reset_data structure needs to be freed here. -*/ -if (reset_data->mode ==ADF_DEV_RESET_ASYNC || -completion_done (&reset_data->compl)) +/* The dev is back alive. Notify the caller if in sync mode */ +if (reset_data->mode ==ADF_DEV_RESET_ASYNC )kfree (reset_data);else complete (&reset_data->compl);
@@ -148,10 +139,10 @@ static int adf_dev_aer_schedule_reset(stif (!timeout) {dev_err (&GET_DEV (accel_dev),"Reset device timeout expired\n" ); +cancel_work_sync (&reset_data->reset_work); ret = -EFAULT ; - }else { -kfree (reset_data); } +kfree (reset_data);return ret; }return 0 ;
Greg Kroah-Hartman
maintainerPATCH 381/402 net/ipv6: Fix route deleting failure when metric equals 0
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: xu xin <[email protected]>
commit bb487272380d120295e955ad8acfcbb281b57642 upstream.
Problem
=========
After commit 67f695134703 ("ipv6: Move setting default metric for routes"), we noticed that the logic of assigning the default value of fc_metirc changed in the ioctl process. That is, when users use ioctl(fd, SIOCADDRT, rt) with a non-zero metric to add a route, then they may fail to delete a route with passing in a metric value of 0 to the kernel by ioctl(fd, SIOCDELRT, rt). But iproute can succeed in deleting it.
As a reference, when using iproute tools by netlink to delete routes with a metric parameter equals 0, like the command as follows:
ip -6 route del fe80::/64 via fe81::5054:ff:fe11:3451 dev eth0 metric 0
the user can still succeed in deleting the route entry with the smallest metric.
Root Reason
===========
After commit 67f695134703 ("ipv6: Move setting default metric for routes"), When ioctl() pass in SIOCDELRT with a zero metric, rtmsg_to_fib6_config() will set a defalut value (1024) to cfg->fc_metric in kernel, and in ip6_route_del() and the line 4074 at net/ipv3/route.c, it will check by
if (cfg->fc_metric && cfg->fc_metric != rt->fib6_metric) continue;
and the condition is true and skip the later procedure (deleting route) because cfg->fc_metric != rt->fib6_metric. But before that commit, cfg->fc_metric is still zero there, so the condition is false and it will do the following procedure (deleting).
Solution
========
In order to keep a consistent behaviour across netlink() and ioctl(), we should allow to delete a route with a metric value of 0. So we only do the default setting of fc_metric in route adding.
--- net/ipv6/route.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
net/ipv6/route.c +4 -1
@@ -4456,7 +4456,7 @@ static void rtmsg_to_fib6_config(struct .fc_table = l3mdev_fib_table_by_index(net, rtmsg->rtmsg_ifindex) ? : RT6_TABLE_MAIN, .fc_ifindex = rtmsg->rtmsg_ifindex, - .fc_metric = rtmsg->rtmsg_metric ? : IP6_RT_PRIO_USER, + .fc_metric = rtmsg->rtmsg_metric, .fc_expires = rtmsg->rtmsg_info, .fc_dst_len = rtmsg->rtmsg_dst_len, .fc_src_len = rtmsg->rtmsg_src_len,
@@ -4486,6 +4486,9 @@ int ipv6_route_ioctl(struct net *net, unrtnl_lock ();switch (cmd) {case SIOCADDRT : +/* Only do the default setting of fc_metric in route adding */ +if (cfg.fc_metric ==0 ) + cfg.fc_metric =IP6_RT_PRIO_USER ; err =ip6_route_add (&cfg,GFP_KERNEL ,NULL );break ;case SIOCDELRT :
Greg Kroah-Hartman
maintainerPATCH 382/402 net/9p: fix uninit-value in p9_client_rpc()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nikita Zhandarovich <[email protected]>
commit 25460d6f39024cc3b8241b14c7ccf0d6f11a736a upstream.
Syzbot with the help of KMSAN reported the following error:
BUG: KMSAN: uninit-value in trace_9p_client_res include/trace/events/9p.h:146 [inline] BUG: KMSAN: uninit-value in p9_client_rpc+0x1314/0x1340 net/9p/client.c:754 trace_9p_client_res include/trace/events/9p.h:146 [inline] p9_client_rpc+0x1314/0x1340 net/9p/client.c:754 p9_client_create+0x1551/0x1ff0 net/9p/client.c:1031 v9fs_session_init+0x1b9/0x28e0 fs/9p/v9fs.c:410 v9fs_mount+0xe2/0x12b0 fs/9p/vfs_super.c:122 legacy_get_tree+0x114/0x290 fs/fs_context.c:662 vfs_get_tree+0xa7/0x570 fs/super.c:1797 do_new_mount+0x71f/0x15e0 fs/namespace.c:3352 path_mount+0x742/0x1f20 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount+0x725/0x810 fs/namespace.c:3875 __x64_sys_mount+0xe4/0x150 fs/namespace.c:3875 do_syscall_64+0xd5/0x1f0 entry_SYSCALL_64_after_hwframe+0x6d/0x75
Uninit was created at:
__alloc_pages+0x9d6/0xe70 mm/page_alloc.c:4598 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page mm/slub.c:2175 [inline] allocate_slab mm/slub.c:2338 [inline] new_slab+0x2de/0x1400 mm/slub.c:2391 ___slab_alloc+0x1184/0x33d0 mm/slub.c:3525 __slab_alloc mm/slub.c:3610 [inline] __slab_alloc_node mm/slub.c:3663 [inline] slab_alloc_node mm/slub.c:3835 [inline] kmem_cache_alloc+0x6d3/0xbe0 mm/slub.c:3852 p9_tag_alloc net/9p/client.c:278 [inline] p9_client_prepare_req+0x20a/0x1770 net/9p/client.c:641 p9_client_rpc+0x27e/0x1340 net/9p/client.c:688 p9_client_create+0x1551/0x1ff0 net/9p/client.c:1031 v9fs_session_init+0x1b9/0x28e0 fs/9p/v9fs.c:410 v9fs_mount+0xe2/0x12b0 fs/9p/vfs_super.c:122 legacy_get_tree+0x114/0x290 fs/fs_context.c:662 vfs_get_tree+0xa7/0x570 fs/super.c:1797 do_new_mount+0x71f/0x15e0 fs/namespace.c:3352 path_mount+0x742/0x1f20 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount+0x725/0x810 fs/namespace.c:3875 __x64_sys_mount+0xe4/0x150 fs/namespace.c:3875 do_syscall_64+0xd5/0x1f0 entry_SYSCALL_64_after_hwframe+0x6d/0x75
If p9_check_errors() fails early in p9_client_rpc(), req->rc.tag will not be properly initialized. However, trace_9p_client_res() ends up trying to print it out anyway before p9_client_rpc() finishes.
Fix this issue by assigning default values to p9_fcall fields such as 'tag' and (just in case KMSAN unearths something new) 'id' during the tag allocation stage.
Message-ID: <[email protected]>
--- net/9p/client.c | 2 ++ 1 file changed, 2 insertions(+)
net/9p/client.c +2 -0
@@ -233,6 +233,8 @@ static int p9_fcall_init(struct p9_clienif (!fc->sdata)return -ENOMEM ; fc->capacity = alloc_msize; + fc->id =0 ; + fc->tag =P9_NOTAG ;return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 383/402 intel_th: pci: Add Meteor Lake-S CPU support
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Shishkin <[email protected]>
commit a4f813c3ec9d1c32bc402becd1f011b3904dd699 upstream.
Add support for the Trace Hub in Meteor Lake-S CPU.
--- drivers/hwtracing/intel_th/pci.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/hwtracing/intel_th/pci.c +5 -0
@@ -290,6 +290,11 @@ static const struct pci_device_id intel_ .driver_data = (kernel_ulong_t)&intel_th_2x, }, { +/* Meteor Lake-S CPU */ + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xae24), + .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 384/402 sparc64: Fix number of online CPUs
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sam Ravnborg <[email protected]>
commit 98937707fea8375e8acea0aaa0b68a956dd52719 upstream.
Nick Bowler reported:
When using newer kernels on my Ultra 60 with dual 450MHz UltraSPARC-II CPUs, I noticed that only CPU 0 comes up, while older kernels (including 4.7) are working fine with both CPUs.
I bisected the failure to this commit:
9b2f753ec23710aa32c0d837d2499db92fe9115b is the first bad commit commit 9b2f753ec23710aa32c0d837d2499db92fe9115b
Author: Atish Patra <[email protected]>
Date: Thu Sep 15 14:54:40 2016 -0600
sparc64: Fix cpu_possible_mask if nr_cpus is set
This is a small change that reverts very easily on top of 5.18: there is just one trivial conflict. Once reverted, both CPUs work again.
Maybe this is related to the fact that the CPUs on this system are numbered CPU0 and CPU2 (there is no CPU1)?
The current code that adjust cpu_possible based on nr_cpu_ids do not take into account that CPU's may not come one after each other. Move the chech to the function that setup the cpu_possible mask so there is no need to adjust it later.
--- arch/sparc/include/asm/smp_64.h | 2 -- arch/sparc/kernel/prom_64.c | 4 +++- arch/sparc/kernel/setup_64.c | 1 - arch/sparc/kernel/smp_64.c | 14 -------------- 4 files changed, 3 insertions(+), 18 deletions(-)
arch/sparc/include/asm/smp_64.h +0 -2
@@ -47,7 +47,6 @@ void arch_send_call_function_ipi_mask(coint hard_smp_processor_id (void );#define raw_smp_processor_id () (current_thread_info()->cpu) -void smp_fill_in_cpu_possible_map (void );void smp_fill_in_sib_core_maps (void );void cpu_play_dead (void );
@@ -77,7 +76,6 @@ void __cpu_die(unsigned int cpu);#define smp_fill_in_sib_core_maps () do { } while (0)#define smp_fetch_global_regs () do { } while (0)#define smp_fetch_global_pmu () do { } while (0) -#define smp_fill_in_cpu_possible_map () do { } while (0)#define smp_init_cpu_poke () do { } while (0)#define scheduler_poke () do { } while (0)
arch/sparc/kernel/prom_64.c +3 -1
@@ -483,7 +483,9 @@ static void *record_one_cpu(struct devic ncpus_probed++;#ifdef CONFIG_SMP set_cpu_present (cpuid, true); -set_cpu_possible (cpuid, true); + +if (num_possible_cpus () < nr_cpu_ids) +set_cpu_possible (cpuid, true);#endif return NULL ; }
arch/sparc/kernel/setup_64.c +0 -1
@@ -684,7 +684,6 @@ void __init setup_arch(char **cmdline_p)paging_init ();init_sparc64_elf_hwcap (); -smp_fill_in_cpu_possible_map ();/* * Once the OF device tree and MDESC have been setup and nr_cpus has * been parsed, we know the list of possible cpus. Therefore we can
arch/sparc/kernel/smp_64.c +0 -14
@@ -1210,20 +1210,6 @@ void __init smp_setup_processor_id(void) xcall_deliver_impl = hypervisor_xcall_deliver; } -void __init smp_fill_in_cpu_possible_map (void ) -{ -int possible_cpus =num_possible_cpus (); -int i; - -if (possible_cpus > nr_cpu_ids) - possible_cpus = nr_cpu_ids; - -for (i =0 ; i < possible_cpus; i++) -set_cpu_possible (i, true); -for (; i <NR_CPUS ; i++) -set_cpu_possible (i, false); -} -void smp_fill_in_sib_core_maps (void ) {unsigned int i;
Greg Kroah-Hartman
maintainerPATCH 385/402 watchdog: rti_wdt: Set min_hw_heartbeat_ms to accommodate a safety margin
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Judith Mendez <[email protected]>
commit cae58516534e110f4a8558d48aa4435e15519121 upstream.
On AM62x, the watchdog is pet before the valid window is open. Fix min_hw_heartbeat and accommodate a 2% + static offset safety margin. The static offset accounts for max hardware error.
Remove the hack in the driver which shifts the open window boundary, since it is no longer necessary due to the fix mentioned above.
--- drivers/watchdog/rti_wdt.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-)
drivers/watchdog/rti_wdt.c +15 -19
@@ -52,6 +52,8 @@#define DWDST BIT(1) +#define MAX_HW_ERROR 250 +static int heartbeat =DEFAULT_HEARTBEAT ;/*
@@ -90,7 +92,7 @@ static int rti_wdt_start(struct watchdog* to be 50% or less than that; we obviouly want to configure the open * window as large as possible so we select the 50% option. */ - wdd->min_hw_heartbeat_ms =500 * wdd->timeout; + wdd->min_hw_heartbeat_ms =520 * wdd->timeout +MAX_HW_ERROR ;/* Generate NMI when wdt expires */ writel_relaxed (RTIWWDRX_NMI , wdt->base +RTIWWDRXCTRL );
@@ -124,31 +126,33 @@ static int rti_wdt_setup_hw_hb(struct wa* be petted during the open window; not too early or not too late. * The HW configuration options only allow for the open window size * to be 50% or less than that. +* To avoid any glitches, we accommodate 2% + max hardware error +* safety margin. */ switch (wsize) {case RTIWWDSIZE_50P : -/* 50% open window => 50% min heartbeat */ - wdd->min_hw_heartbeat_ms =500 * heartbeat; +/* 50% open window => 52% min heartbeat */ + wdd->min_hw_heartbeat_ms =520 * heartbeat +MAX_HW_ERROR ;break ;case RTIWWDSIZE_25P : -/* 25% open window => 75% min heartbeat */ - wdd->min_hw_heartbeat_ms =750 * heartbeat; +/* 25% open window => 77% min heartbeat */ + wdd->min_hw_heartbeat_ms =770 * heartbeat +MAX_HW_ERROR ;break ;case RTIWWDSIZE_12P5 : -/* 12.5% open window => 87.5% min heartbeat */ - wdd->min_hw_heartbeat_ms =875 * heartbeat; +/* 12.5% open window => 89.5% min heartbeat */ + wdd->min_hw_heartbeat_ms =895 * heartbeat +MAX_HW_ERROR ;break ;case RTIWWDSIZE_6P25 : -/* 6.5% open window => 93.5% min heartbeat */ - wdd->min_hw_heartbeat_ms =935 * heartbeat; +/* 6.5% open window => 95.5% min heartbeat */ + wdd->min_hw_heartbeat_ms =955 * heartbeat +MAX_HW_ERROR ;break ;case RTIWWDSIZE_3P125 : -/* 3.125% open window => 96.9% min heartbeat */ - wdd->min_hw_heartbeat_ms =969 * heartbeat; +/* 3.125% open window => 98.9% min heartbeat */ + wdd->min_hw_heartbeat_ms =989 * heartbeat +MAX_HW_ERROR ;break ;default :
@@ -222,14 +226,6 @@ static int rti_wdt_probe(struct platformreturn -EINVAL ; } -/* -* If watchdog is running at 32k clock, it is not accurate. -* Adjust frequency down in this case so that we don't pet -* the watchdog too often. -*/ -if (wdt->freq <32768 ) - wdt->freq = wdt->freq *9 /10 ; -pm_runtime_enable (dev); ret =pm_runtime_get_sync (dev);if (ret <0 ) {
Greg Kroah-Hartman
maintainerPATCH 386/402 kdb: Fix buffer overflow during tab-complete
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Thompson <[email protected]>
commit e9730744bf3af04cda23799029342aa3cddbc454 upstream.
Currently, when the user attempts symbol completion with the Tab key, kdb will use strncpy() to insert the completed symbol into the command buffer. Unfortunately it passes the size of the source buffer rather than the destination to strncpy() with predictably horrible results. Most obviously if the command buffer is already full but cp, the cursor position, is in the middle of the buffer, then we will write past the end of the supplied buffer.
Fix this by replacing the dubious strncpy() calls with memmove()/memcpy() calls plus explicit boundary checks to make sure we have enough space before we start moving characters around.
--- kernel/debug/kdb/kdb_io.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-)
kernel/debug/kdb/kdb_io.c +13 -8
@@ -354,14 +354,19 @@ poll_again:kdb_printf (kdb_prompt_str);kdb_printf ("%s" , buffer); }else if (tab !=2 && count >0 ) { - len_tmp =strlen (p_tmp); -strncpy (p_tmp+len_tmp, cp, lastchar-cp+1 ); - len_tmp =strlen (p_tmp); -strncpy (cp, p_tmp+len, len_tmp-len +1 ); - len = len_tmp - len; -kdb_printf ("%s" , cp); - cp += len; - lastchar += len; +/* How many new characters do we want from tmpbuffer? */ + len_tmp =strlen (p_tmp) - len; +if (lastchar + len_tmp >= bufend) + len_tmp = bufend - lastchar; + +if (len_tmp) { +/* + 1 ensures the '\0' is memmove'd */ +memmove (cp+len_tmp, cp, (lastchar-cp) +1 ); +memcpy (cp, p_tmp+len, len_tmp); +kdb_printf ("%s" , cp); + cp += len_tmp; + lastchar += len_tmp; + } } kdb_nextline =1 ;/* reset output line number */ break ;
Greg Kroah-Hartman
maintainerPATCH 387/402 kdb: Use format-strings rather than \0 injection in kdb_read()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Thompson <[email protected]>
commit 09b35989421dfd5573f0b4683c7700a7483c71f9 upstream.
Currently when kdb_read() needs to reposition the cursor it uses copy and paste code that works by injecting an '\0' at the cursor position before delivering a carriage-return and reprinting the line (which stops at the '\0').
Tidy up the code by hoisting the copy and paste code into an appropriately named function. Additionally let's replace the '\0' injection with a proper field width parameter so that the string will be abridged during formatting instead.
--- kernel/debug/kdb/kdb_io.c | 55 ++++++++++++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 21 deletions(-)
kernel/debug/kdb/kdb_io.c +34 -21
@@ -172,6 +172,33 @@ char kdb_getchar(void)unreachable (); } +/** +* kdb_position_cursor() - Place cursor in the correct horizontal position +* @prompt: Nil-terminated string containing the prompt string +* @buffer: Nil-terminated string containing the entire command line +* @cp: Cursor position, pointer the character in buffer where the cursor +* should be positioned. +* +* The cursor is positioned by sending a carriage-return and then printing +* the content of the line until we reach the correct cursor position. +* +* There is some additional fine detail here. +* +* Firstly, even though kdb_printf() will correctly format zero-width fields +* we want the second call to kdb_printf() to be conditional. That keeps things +* a little cleaner when LOGGING=1. +* +* Secondly, we can't combine everything into one call to kdb_printf() since +* that renders into a fixed length buffer and the combined print could result +* in unwanted truncation. +*/ +static void kdb_position_cursor (char *prompt,char *buffer,char *cp) +{ +kdb_printf ("\r%s" , kdb_prompt_str); +if (cp > buffer) +kdb_printf ("%.*s" , (int )(cp - buffer), buffer); +} +/* * kdb_read *
@@ -200,7 +227,6 @@ static char *kdb_read(char *buffer, size* and null byte */ char *lastchar;char *p_tmp; -char tmp;static char tmpbuffer[CMD_BUFLEN ];int len =strlen (buffer);int len_tmp;
@@ -237,12 +263,8 @@ poll_again: } *(--lastchar) ='\0' ; --cp; -kdb_printf ("\b%s \r" , cp); - tmp = *cp; - *cp ='\0' ; -kdb_printf (kdb_prompt_str); -kdb_printf ("%s" , buffer); - *cp = tmp; +kdb_printf ("\b%s " , cp); +kdb_position_cursor (kdb_prompt_str, buffer, cp); }break ;case 13 :/* enter */
@@ -259,19 +281,14 @@ poll_again:memcpy (tmpbuffer, cp+1 , lastchar - cp -1 );memcpy (cp, tmpbuffer, lastchar - cp -1 ); *(--lastchar) ='\0' ; -kdb_printf ("%s \r" , cp); - tmp = *cp; - *cp ='\0' ; -kdb_printf (kdb_prompt_str); -kdb_printf ("%s" , buffer); - *cp = tmp; +kdb_printf ("%s " , cp); +kdb_position_cursor (kdb_prompt_str, buffer, cp); }break ;case 1 :/* Home */ if (cp > buffer) { -kdb_printf ("\r" ); -kdb_printf (kdb_prompt_str); cp = buffer; +kdb_position_cursor (kdb_prompt_str, buffer, cp); }break ;case 5 :/* End */
@@ -377,13 +394,9 @@ poll_again:memcpy (cp+1 , tmpbuffer, lastchar - cp); *++lastchar ='\0' ; *cp = key; -kdb_printf ("%s\r" , cp); +kdb_printf ("%s" , cp); ++cp; - tmp = *cp; - *cp ='\0' ; -kdb_printf (kdb_prompt_str); -kdb_printf ("%s" , buffer); - *cp = tmp; +kdb_position_cursor (kdb_prompt_str, buffer, cp); }else { *++lastchar ='\0' ; *cp++ = key;
Greg Kroah-Hartman
maintainerPATCH 388/402 kdb: Fix console handling when editing and tab-completing commands
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Thompson <[email protected]>
commit db2f9c7dc29114f531df4a425d0867d01e1f1e28 upstream.
Currently, if the cursor position is not at the end of the command buffer and the user uses the Tab-complete functions, then the console does not leave the cursor in the correct position.
For example consider the following buffer with the cursor positioned at the ^:
md kdb_pro 10
^
Pressing tab should result in:
md kdb_prompt_str 10
^
However this does not happen. Instead the cursor is placed at the end (after then 10) and further cursor movement redraws incorrectly. The same problem exists when we double-Tab but in a different part of the code.
Fix this by sending a carriage return and then redisplaying the text to the left of the cursor.
--- kernel/debug/kdb/kdb_io.c | 5 +++++ 1 file changed, 5 insertions(+)
kernel/debug/kdb/kdb_io.c +5 -0
@@ -370,6 +370,8 @@ poll_again:kdb_printf ("\n" );kdb_printf (kdb_prompt_str);kdb_printf ("%s" , buffer); +if (cp != lastchar) +kdb_position_cursor (kdb_prompt_str, buffer, cp); }else if (tab !=2 && count >0 ) {/* How many new characters do we want from tmpbuffer? */ len_tmp =strlen (p_tmp) - len;
@@ -383,6 +385,9 @@ poll_again:kdb_printf ("%s" , cp); cp += len_tmp; lastchar += len_tmp; +if (cp != lastchar) +kdb_position_cursor (kdb_prompt_str, + buffer, cp); } } kdb_nextline =1 ;/* reset output line number */
Greg Kroah-Hartman
maintainerPATCH 389/402 kdb: Merge identical case statements in kdb_read()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Thompson <[email protected]>
commit 6244917f377bf64719551b58592a02a0336a7439 upstream.
The code that handles case 14 (down) and case 16 (up) has been copy and pasted despite being byte-for-byte identical. Combine them.
--- kernel/debug/kdb/kdb_io.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)
kernel/debug/kdb/kdb_io.c +1 -9
@@ -304,6 +304,7 @@ poll_again: }break ;case 14 :/* Down */ +case 16 :/* Up */ memset (tmpbuffer,' ' ,strlen (kdb_prompt_str) + (lastchar-buffer)); *(tmpbuffer+strlen(kdb_prompt_str) +
@@ -318,15 +319,6 @@ poll_again: ++cp; }break ; -case 16 :/* Up */ -memset (tmpbuffer,' ' , -strlen (kdb_prompt_str) + (lastchar-buffer)); - *(tmpbuffer+strlen (kdb_prompt_str) + - (lastchar-buffer)) ='\0' ; -kdb_printf ("\r%s\r" , tmpbuffer); - *lastchar = (char )key; - *(lastchar+1 ) ='\0' ; -return lastchar;case 9 :/* Tab */ if (tab <2 ) ++tab;
Greg Kroah-Hartman
maintainerPATCH 390/402 kdb: Use format-specifiers rather than memset() for padding in kdb_read()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Thompson <[email protected]>
commit c9b51ddb66b1d96e4d364c088da0f1dfb004c574 upstream.
Currently when the current line should be removed from the display kdb_read() uses memset() to fill a temporary buffer with spaces. The problem is not that this could be trivially implemented using a format string rather than open coding it. The real problem is that it is possible, on systems with a long kdb_prompt_str, to write past the end of the tmpbuffer.
Happily, as mentioned above, this can be trivially implemented using a format string. Make it so!
--- kernel/debug/kdb/kdb_io.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
kernel/debug/kdb/kdb_io.c +3 -5
@@ -305,11 +305,9 @@ poll_again:break ;case 14 :/* Down */ case 16 :/* Up */ -memset (tmpbuffer,' ' , -strlen (kdb_prompt_str) + (lastchar-buffer)); - *(tmpbuffer+strlen (kdb_prompt_str) + - (lastchar-buffer)) ='\0' ; -kdb_printf ("\r%s\r" , tmpbuffer); +kdb_printf ("\r%*c\r" , + (int )(strlen (kdb_prompt_str) + (lastchar - buffer)), +' ' ); *lastchar = (char )key; *(lastchar+1 ) ='\0' ;return lastchar;
Greg Kroah-Hartman
maintainerPATCH 391/402 net: fix __dst_negative_advice() race
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
commit 92f1655aa2b2294d0b49925f3b875a634bd3b59e upstream.
__dst_negative_advice() does not enforce proper RCU rules when sk->dst_cache must be cleared, leading to possible UAF.
RCU rules are that we must first clear sk->sk_dst_cache, then call dst_release(old_dst).
Note that sk_dst_reset(sk) is implementing this protocol correctly, while __dst_negative_advice() uses the wrong order.
Given that ip6_negative_advice() has special logic against RTF_CACHE, this means each of the three ->negative_advice() existing methods must perform the sk_dst_reset() themselves.
Note the check against NULL dst is centralized in __dst_negative_advice(), there is no need to duplicate it in various callbacks.
Many thanks to Clement Lecigne for tracking this issue.
This old bug became visible after the blamed commit, using UDP sockets.
--- include/net/dst_ops.h | 2 +- include/net/sock.h | 13 +++---------- net/ipv4/route.c | 22 ++++++++-------------- net/ipv6/route.c | 29 +++++++++++++++-------------- net/xfrm/xfrm_policy.c | 11 +++-------- 5 files changed, 30 insertions(+), 47 deletions(-)
include/net/dst_ops.h +1 -1
@@ -24,7 +24,7 @@ struct dst_ops {void (*destroy)(struct dst_entry *);void (*ifdown)(struct dst_entry *,struct net_device *dev,int how); -struct dst_entry * (*negative_advice)(struct dst_entry *); +void (*negative_advice)(struct sock *sk,struct dst_entry *);void (*link_failure)(struct sk_buff *); void (*update_pmtu)(struct dst_entry *dst, struct sock *sk, struct sk_buff *skb, u32 mtu,
include/net/sock.h +3 -10
@@ -2082,17 +2082,10 @@ sk_dst_get(struct sock *sk)static inline void __dst_negative_advice (struct sock *sk) { -struct dst_entry *ndst, *dst =__sk_dst_get (sk); +struct dst_entry *dst =__sk_dst_get (sk); -if (dst && dst->ops->negative_advice) { - ndst = dst->ops->negative_advice (dst); - -if (ndst != dst) { -rcu_assign_pointer (sk->sk_dst_cache, ndst); -sk_tx_queue_clear (sk); -WRITE_ONCE (sk->sk_dst_pending_confirm,0 ); - } - } +if (dst && dst->ops->negative_advice) + dst->ops->negative_advice (sk, dst); }static inline void dst_negative_advice (struct sock *sk)
net/ipv4/route.c +8 -14
@@ -139,7 +139,8 @@ struct dst_entry *ipv4_dst_check(structstatic unsigned int ipv4_default_advmss (const struct dst_entry *dst);INDIRECT_CALLABLE_SCOPE unsigned int ipv4_mtu(const struct dst_entry *dst); -static struct dst_entry *ipv4_negative_advice (struct dst_entry *dst); +static void ipv4_negative_advice (struct sock *sk, +struct dst_entry *dst);static void ipv4_link_failure (struct sk_buff *skb); static void ip_rt_update_pmtu(struct dst_entry *dst, struct sock *sk, struct sk_buff *skb, u32 mtu,
@@ -844,22 +845,15 @@ static void ip_do_redirect(struct dst_en__ip_do_redirect (rt, skb, &fl4, true); } -static struct dst_entry *ipv4_negative_advice (struct dst_entry *dst) +static void ipv4_negative_advice (struct sock *sk, +struct dst_entry *dst) {struct rtable *rt = (struct rtable *)dst; -struct dst_entry *ret = dst; -if (rt) { -if (dst->obsolete >0 ) { -ip_rt_put (rt); - ret =NULL ; - }else if ((rt->rt_flags &RTCF_REDIRECTED ) || - rt->dst.expires) { -ip_rt_put (rt); - ret =NULL ; - } - } -return ret; +if ((dst->obsolete >0 ) || + (rt->rt_flags &RTCF_REDIRECTED ) || + rt->dst.expires) +sk_dst_reset (sk); }/*
net/ipv6/route.c +15 -14
@@ -87,7 +87,8 @@ struct dst_entry *ip6_dst_check(struct dstatic unsigned int ip6_default_advmss (const struct dst_entry *dst);INDIRECT_CALLABLE_SCOPE unsigned int ip6_mtu(const struct dst_entry *dst); -static struct dst_entry *ip6_negative_advice (struct dst_entry *); +static void ip6_negative_advice (struct sock *sk, +struct dst_entry *dst);static void ip6_dst_destroy (struct dst_entry *);static void ip6_dst_ifdown (struct dst_entry *,struct net_device *dev,int how);
@@ -2763,24 +2764,24 @@ INDIRECT_CALLABLE_SCOPE struct dst_entry }EXPORT_INDIRECT_CALLABLE (ip6_dst_check); -static struct dst_entry *ip6_negative_advice (struct dst_entry *dst) +static void ip6_negative_advice (struct sock *sk, +struct dst_entry *dst) {struct rt6_info *rt = (struct rt6_info *) dst; -if (rt) { -if (rt->rt6i_flags &RTF_CACHE ) { -rcu_read_lock (); -if (rt6_check_expired (rt)) { -rt6_remove_exception_rt (rt); - dst =NULL ; - } -rcu_read_unlock (); - }else { -dst_release (dst); - dst =NULL ; +if (rt->rt6i_flags &RTF_CACHE ) { +rcu_read_lock (); +if (rt6_check_expired (rt)) { +/* counteract the dst_release() in sk_dst_reset() */ +dst_hold (dst); +sk_dst_reset (sk); + +rt6_remove_exception_rt (rt); } +rcu_read_unlock (); +return ; } -return dst; +sk_dst_reset (sk); }static void ip6_link_failure (struct sk_buff *skb)
net/xfrm/xfrm_policy.c +3 -8
@@ -3766,15 +3766,10 @@ static void xfrm_link_failure(struct sk_/* Impossible. Such dst must be popped before reaches point of failure. */ } -static struct dst_entry *xfrm_negative_advice (struct dst_entry *dst) +static void xfrm_negative_advice (struct sock *sk,struct dst_entry *dst) { -if (dst) { -if (dst->obsolete) { -dst_release (dst); - dst =NULL ; - } - } -return dst; +if (dst->obsolete) +sk_dst_reset (sk); }static void xfrm_init_pmtu (struct xfrm_dst **bundle,int nr)
Greg Kroah-Hartman
maintainerPATCH 392/402 sparc: move struct termio to asm/termios.h
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Gilbert <[email protected]>
commit c32d18e7942d7589b62e301eb426b32623366565 upstream.
Every other arch declares struct termio in asm/termios.h, so make sparc match them.
Resolves a build failure in the PPP software package, which includes both bits/ioctl-types.h via sys/ioctl.h (glibc) and asm/termbits.h.
--- arch/sparc/include/uapi/asm/termbits.h | 10 ---------- arch/sparc/include/uapi/asm/termios.h | 9 +++++++++ 2 files changed, 9 insertions(+), 10 deletions(-)
arch/sparc/include/uapi/asm/termbits.h +0 -10
@@ -13,16 +13,6 @@ typedef unsigned int tcflag_t;typedef unsigned long tcflag_t ;#endif -#define NCC 8 -struct termio { -unsigned short c_iflag;/* input mode flags */ -unsigned short c_oflag;/* output mode flags */ -unsigned short c_cflag;/* control mode flags */ -unsigned short c_lflag;/* local mode flags */ -unsigned char c_line;/* line discipline */ -unsigned char c_cc[NCC ];/* control characters */ -}; -#define NCCS 17struct termios {tcflag_t c_iflag;/* input mode flags */
arch/sparc/include/uapi/asm/termios.h +9 -0
@@ -40,5 +40,14 @@ struct winsize { unsigned short ws_ypixel; }; +#define NCC 8 +struct termio { +unsigned short c_iflag;/* input mode flags */ +unsigned short c_oflag;/* output mode flags */ +unsigned short c_cflag;/* control mode flags */ +unsigned short c_lflag;/* local mode flags */ +unsigned char c_line;/* line discipline */ +unsigned char c_cc[NCC ];/* control characters */ +};#endif /* _UAPI_SPARC_TERMIOS_H */
Greg Kroah-Hartman
maintainerPATCH 393/402 ext4: set type of ac_groups_linear_remaining to __u32 to avoid overflow
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baokun Li <[email protected]>
commit 9a9f3a9842927e4af7ca10c19c94dad83bebd713 upstream.
Now ac_groups_linear_remaining is of type __u16 and s_mb_max_linear_groups is of type unsigned int, so an overflow occurs when setting a value above 65535 through the mb_max_linear_groups sysfs interface. Therefore, the type of ac_groups_linear_remaining is set to __u32 to avoid overflow.
--- fs/ext4/mballoc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/mballoc.h +1 -1
@@ -181,8 +181,8 @@ struct ext4_allocation_context {ext4_group_t ac_last_optimal_group;__u32 ac_groups_considered;__u32 ac_flags;/* allocation hints */ +__u32 ac_groups_linear_remaining;__u16 ac_groups_scanned; -__u16 ac_groups_linear_remaining;__u16 ac_found;__u16 ac_tail;__u16 ac_buddy;
Greg Kroah-Hartman
maintainerPATCH 394/402 ext4: fix mb_cache_entrys e_refcnt leak in ext4_xattr_block_cache_find()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baokun Li <[email protected]>
commit 0c0b4a49d3e7f49690a6827a41faeffad5df7e21 upstream.
Syzbot reports a warning as follows:
============================================
WARNING: CPU: 0 PID: 5075 at fs/mbcache.c:419 mb_cache_destroy+0x224/0x290 Modules linked in: CPU: 0 PID: 5075 Comm: syz-executor199 Not tainted 6.9.0-rc6-gb947cc5bf6d7 RIP: 0010:mb_cache_destroy+0x224/0x290 fs/mbcache.c:419 Call Trace: <TASK> ext4_put_super+0x6d4/0xcd0 fs/ext4/super.c:1375 generic_shutdown_super+0x136/0x2d0 fs/super.c:641 kill_block_super+0x44/0x90 fs/super.c:1675 ext4_kill_sb+0x68/0xa0 fs/ext4/super.c:7327
[...]
============================================
This is because when finding an entry in ext4_xattr_block_cache_find(), if ext4_sb_bread() returns -ENOMEM, the ce's e_refcnt, which has already grown in the __entry_find(), won't be put away, and eventually trigger the above issue in mb_cache_destroy() due to reference count leakage.
So call mb_cache_entry_put() on the -ENOMEM error branch as a quick fix.
--- fs/ext4/xattr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/ext4/xattr.c +3 -1
@@ -3075,8 +3075,10 @@ ext4_xattr_block_cache_find(struct inode bh =ext4_sb_bread (inode->i_sb, ce->e_value,REQ_PRIO );if (IS_ERR (bh)) { -if (PTR_ERR (bh) == -ENOMEM ) +if (PTR_ERR (bh) == -ENOMEM ) { +mb_cache_entry_put (ea_block_cache, ce);return NULL ; + } bh =NULL ;EXT4_ERROR_INODE (inode,"block %lu read error" , (unsigned long )ce->e_value);
Greg Kroah-Hartman
maintainerPATCH 395/402 s390/ap: Fix crash in AP internal function modify_bitmap()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Harald Freudenberger <[email protected]>
commit d4f9d5a99a3fd1b1c691b7a1a6f8f3f25f4116c9 upstream.
A system crash like this
Failing address: 200000cb7df6f000 TEID: 200000cb7df6f403
Fault in home space mode while using kernel ASCE. AS:00000002d71bc007 R3:00000003fe5b8007 S:000000011a446000 P:000000015660c13d
Oops: 0038 ilc:3 [#1] PREEMPT SMP Modules linked in: mlx5_ib ... CPU: 8 PID: 7556 Comm: bash Not tainted 6.9.0-rc7 #8 Hardware name: IBM 3931 A01 704 (LPAR) Krnl PSW : 0704e00180000000 0000014b75e7b606 (ap_parse_bitmap_str+0x10e/0x1f8) R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:2 PM:0 RI:0 EA:3 Krnl GPRS: 0000000000000001 ffffffffffffffc0 0000000000000001 00000048f96b75d3 000000cb00000100 ffffffffffffffff ffffffffffffffff 000000cb7df6fce0 000000cb7df6fce0 00000000ffffffff 000000000000002b 00000048ffffffff 000003ff9b2dbc80 200000cb7df6fcd8 0000014bffffffc0 000000cb7df6fbc8 Krnl Code: 0000014b75e7b5fc: a7840047 brc 8,0000014b75e7b68a 0000014b75e7b600: 18b2 lr %r11,%r2 #0000014b75e7b602: a7f4000a brc 15,0000014b75e7b616 >0000014b75e7b606: eb22d00000e6 laog %r2,%r2,0(%r13) 0000014b75e7b60c: a7680001 lhi %r6,1 0000014b75e7b610: 187b lr %r7,%r11 0000014b75e7b612: 84960021 brxh %r9,%r6,0000014b75e7b654 0000014b75e7b616: 18e9 lr %r14,%r9 Call Trace: [<0000014b75e7b606>] ap_parse_bitmap_str+0x10e/0x1f8 ([<0000014b75e7b5dc>] ap_parse_bitmap_str+0xe4/0x1f8) [<0000014b75e7b758>] apmask_store+0x68/0x140 [<0000014b75679196>] kernfs_fop_write_iter+0x14e/0x1e8 [<0000014b75598524>] vfs_write+0x1b4/0x448 [<0000014b7559894c>] ksys_write+0x74/0x100 [<0000014b7618a440>] __do_syscall+0x268/0x328 [<0000014b761a3558>] system_call+0x70/0x98 INFO: lockdep is turned off. Last Breaking-Event-Address: [<0000014b75e7b636>] ap_parse_bitmap_str+0x13e/0x1f8 Kernel panic - not syncing: Fatal exception: panic_on_oops
occured when /sys/bus/ap/a[pq]mask was updated with a relative mask value (like +0x10-0x12,+60,-90) with one of the numeric values exceeding INT_MAX.
The fix is simple: use unsigned long values for the internal variables. The correct checks are already in place in the function but a simple int for the internal variables was used with the possibility to overflow.
--- drivers/s390/crypto/ap_bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/crypto/ap_bus.c +1 -1
@@ -1031,7 +1031,7 @@ static int hex2bitmap(const char *str, u*/ static int modify_bitmap (const char *str,unsigned long *bitmap,int bits) { -int a, i, z; +unsigned long a, i, z;char *np, sign;/* bits needs to be a multiple of 8 */
Greg Kroah-Hartman
maintainerPATCH 396/402 s390/cpacf: Split and rework cpacf query functions
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Harald Freudenberger <[email protected]>
commit 830999bd7e72f4128b9dfa37090d9fa8120ce323 upstream.
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 ( +" 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 ( -" 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 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 } } +/** +* 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)) {
Greg Kroah-Hartman
maintainerPATCH 397/402 s390/cpacf: Make use of invalid opcode produce a link error
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Harald Freudenberger <[email protected]>
commit 32e8bd6423fc127d2b37bdcf804fd76af3bbec79 upstream.
Instead of calling BUG() at runtime introduce and use a prototype for a non-existing function to produce a link error during compile when a not supported opcode is used with the __cpacf_query() or __cpacf_check_opcode() inline functions.
--- arch/s390/include/asm/cpacf.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
arch/s390/include/asm/cpacf.h +10 -2
@@ -161,6 +161,13 @@typedef struct {unsigned char bytes[16 ]; }cpacf_mask_t ; +/* +* Prototype for a not existing function to produce a link +* error if __cpacf_query() or __cpacf_check_opcode() is used +* with an invalid compile time const opcode. +*/ +void __cpacf_bad_opcode (void ); + static __always_inline void __cpacf_query_rre(u32 opc, u8 r1, u8 r2,cpacf_mask_t *mask) {
@@ -232,7 +239,7 @@ static __always_inline void __cpacf_quer__cpacf_query_rre (CPACF_PRNO ,2 ,4 , mask);break ;default : -BUG (); +__cpacf_bad_opcode (); } }
@@ -257,7 +264,8 @@ static __always_inline int __cpacf_checkcase CPACF_KMA :return test_facility (146 );/* check for MSA8 */ default : -BUG (); +__cpacf_bad_opcode (); +return 0 ; } }
Greg Kroah-Hartman
maintainerPATCH 398/402 i3c: master: svc: fix invalidate IBI type and miss call client IBI handler
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Frank Li <[email protected]>
commit 38baed9b8600008e5d7bc8cb9ceccc1af3dd54b7 upstream.
In an In-Band Interrupt (IBI) handle, the code logic is as follows:
1: writel(SVC_I3C_MCTRL_REQUEST_AUTO_IBI | SVC_I3C_MCTRL_IBIRESP_AUTO,
master->regs + SVC_I3C_MCTRL);
2: ret = readl_relaxed_poll_timeout(master->regs + SVC_I3C_MSTATUS, val,
SVC_I3C_MSTATUS_IBIWON(val), 0, 1000); ...
3: ibitype = SVC_I3C_MSTATUS_IBITYPE(status);
ibiaddr = SVC_I3C_MSTATUS_IBIADDR(status);
SVC_I3C_MSTATUS_IBIWON may be set before step 1. Thus, step 2 will return immediately, and the I3C controller has not sent out the 9th SCL yet. Consequently, ibitype and ibiaddr are 0, resulting in an unknown IBI type occurrence and missing call I3C client driver's IBI handler.
A typical case is that SVC_I3C_MSTATUS_IBIWON is set when an IBI occurs during the controller send start frame in svc_i3c_master_xfer().
Clear SVC_I3C_MSTATUS_IBIWON before issue SVC_I3C_MCTRL_REQUEST_AUTO_IBI to fix this issue.
--- drivers/i3c/master/svc-i3c-master.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
drivers/i3c/master/svc-i3c-master.c +13 -3
@@ -356,6 +356,19 @@ static void svc_i3c_master_ibi_work(struint ret;mutex_lock (&master->lock); +/* +* IBIWON may be set before SVC_I3C_MCTRL_REQUEST_AUTO_IBI, causing +* readl_relaxed_poll_timeout() to return immediately. Consequently, +* ibitype will be 0 since it was last updated only after the 8th SCL +* cycle, leading to missed client IBI handlers. +* +* A typical scenario is when IBIWON occurs and bus arbitration is lost +* at svc_i3c_master_priv_xfers(). +* +* Clear SVC_I3C_MINT_IBIWON before sending SVC_I3C_MCTRL_REQUEST_AUTO_IBI. +*/ +writel (SVC_I3C_MINT_IBIWON , master->regs +SVC_I3C_MSTATUS ); +/* Acknowledge the incoming interrupt with the AUTOIBI mechanism */ writel(SVC_I3C_MCTRL_REQUEST_AUTO_IBI | SVC_I3C_MCTRL_IBIRESP_AUTO,
@@ -370,9 +383,6 @@ static void svc_i3c_master_ibi_work(stru goto reenable_ibis; } -/* Clear the interrupt status */ -writel (SVC_I3C_MINT_IBIWON , master->regs +SVC_I3C_MSTATUS ); - status =readl (master->regs +SVC_I3C_MSTATUS ); ibitype =SVC_I3C_MSTATUS_IBITYPE (status); ibiaddr =SVC_I3C_MSTATUS_IBIADDR (status);
Greg Kroah-Hartman
maintainerPATCH 399/402 EDAC/igen6: Convert PCIBIOS_* return codes to errnos
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilpo Järvinen <[email protected]>
commit f8367a74aebf88dc8b58a0db6a6c90b4cb8fc9d3 upstream.
errcmd_enable_error_reporting() uses pci_{read,write}_config_word() that return PCIBIOS_* codes. The return code is then returned all the way into the probe function igen6_probe() that returns it as is. The probe functions, however, should return normal errnos.
Convert PCIBIOS_* returns code using pcibios_err_to_errno() into normal errno before returning it from errcmd_enable_error_reporting().
--- drivers/edac/igen6_edac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/edac/igen6_edac.c +2 -2
@@ -627,7 +627,7 @@ static int errcmd_enable_error_reporting rc =pci_read_config_word (imc->pdev,ERRCMD_OFFSET , &errcmd);if (rc) -return rc; +return pcibios_err_to_errno (rc);if (enable) errcmd |=ERRCMD_CE |ERRSTS_UE ;
@@ -636,7 +636,7 @@ static int errcmd_enable_error_reporting rc =pci_write_config_word (imc->pdev,ERRCMD_OFFSET , errcmd);if (rc) -return rc; +return pcibios_err_to_errno (rc);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 400/402 nfs: fix undefined behavior in nfs_block_bits()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sergey Shtylyov <[email protected]>
commit 3c0a2e0b0ae661457c8505fecc7be5501aa7a715 upstream.
Shifting *signed int* typed constant 1 left by 31 bits causes undefined behavior. Specify the correct *unsigned long* type by using 1UL instead.
Found by Linux Verification Center (linuxtesting.org) with the Svace static analysis tool.
--- fs/nfs/internal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/nfs/internal.h +2 -2
@@ -653,9 +653,9 @@ unsigned long nfs_block_bits(unsigned loif ((bsize & (bsize -1 )) || nrbitsp) {unsigned char nrbits; -for (nrbits =31 ; nrbits && !(bsize & (1 << nrbits)); nrbits--) +for (nrbits =31 ; nrbits && !(bsize & (1UL << nrbits)); nrbits--) ; - bsize =1 << nrbits; + bsize =1UL << nrbits;if (nrbitsp) *nrbitsp = nrbits; }
Greg Kroah-Hartman
maintainerPATCH 401/402 NFS: Fix READ_PLUS when server doesnt support OP_READ_PLUS
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anna Schumaker <[email protected]>
commit f06d1b10cb016d5aaecdb1804fefca025387bd10 upstream.
Olga showed me a case where the client was sending multiple READ_PLUS calls to the server in parallel, and the server replied NFS4ERR_OPNOTSUPP to each. The client would fall back to READ for the first reply, but fail to retry the other calls.
I fix this by removing the test for NFS_CAP_READ_PLUS in nfs4_read_plus_not_supported(). This allows us to reschedule any READ_PLUS call that has a NFS4ERR_OPNOTSUPP return value, even after the capability has been cleared.
--- fs/nfs/nfs4proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/nfs4proc.c +1 -1
@@ -5421,7 +5421,7 @@ static bool nfs4_read_plus_not_supportedstruct rpc_message *msg = &task->tk_msg;if (msg->rpc_proc == &nfs4_procedures[NFSPROC4_CLNT_READ_PLUS ] && - server->caps &NFS_CAP_READ_PLUS && task->tk_status == -ENOTSUPP ) { + task->tk_status == -ENOTSUPP ) { server->caps &= ~NFS_CAP_READ_PLUS ; msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_READ ];rpc_restart_call_prepare (task);
Greg Kroah-Hartman
maintainerPATCH 402/402 scsi: ufs: ufs-qcom: Clear qunipro_g4_sel for HW major version > 5
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Neil Armstrong <[email protected]>
commit c422fbd5cb58c9a078172ae1e9750971b738a197 upstream.
The qunipro_g4_sel clear is also needed for new platforms with major version > 5. Fix the version check to take this into account.
--- drivers/scsi/ufs/ufs-qcom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ufs/ufs-qcom.c +1 -1
@@ -243,7 +243,7 @@ static void ufs_qcom_select_unipro_mode(ufs_qcom_cap_qunipro (host) ?QUNIPRO_SEL :0 , REG_UFS_CFG1); -if (host->hw_ver.major ==0x05 ) +if (host->hw_ver.major >=0x05 )ufshcd_rmwl (host->hba,QUNIPRO_G4_SEL ,0 ,REG_UFS_CFG0 ); }
Hello,
Quoted 5 lines · On Thu, 13 Jun 2024 13:29:17 +0200 Greg Kroah-Hartman…
This is the start of the stable review cycle for the 5.15.161 release. There are 402 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 8 lines
Responses should be made by Sat, 15 Jun 2024 11:31:50 +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.15.161-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.
This rc kernel passes DAMON functionality test[1] on my test machine. Attaching the test results summary below. Please note that I retrieved the kernel from linux-stable-rc tree[2].
[1] https://github.com/awslabs/damon-tests/tree/next/corr
[2] 892374ff1e8d ("Linux 5.15.161-rc1")
Thanks,
SJ
[...]
---
ok 1 selftests: damon: debugfs_attrs.sh
ok 1 selftests: damon-tests: kunit.sh
ok 2 selftests: damon-tests: huge_count_read_write.sh
ok 3 selftests: damon-tests: buffer_overflow.sh
ok 4 selftests: damon-tests: rm_contexts.sh
ok 5 selftests: damon-tests: record_null_deref.sh
ok 6 selftests: damon-tests: dbgfs_target_ids_read_before_terminate_race.sh ok 7 selftests: damon-tests: dbgfs_target_ids_pid_leak.sh
ok 8 selftests: damon-tests: damo_tests.sh
ok 9 selftests: damon-tests: masim-record.sh
ok 10 selftests: damon-tests: build_i386.sh
ok 11 selftests: damon-tests: build_arm64.sh
ok 12 selftests: damon-tests: build_m68k.sh
ok 13 selftests: damon-tests: build_i386_idle_flag.sh
ok 14 selftests: damon-tests: build_i386_highpte.sh
ok 15 selftests: damon-tests: build_nomemcg.sh
[33m
[92mPASS [39m
Hello Greg and Sasha,
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.161 release. There are 402 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 Sat, 15 Jun 2024 11:31:50 +0000. Anything received after that time might be too late.
perf build breaks on 5.15.161:(and on 5.4.278, 5.10.219)
In file included from util/cache.h:7,
from builtin-annotate.c:13:util/../ui/ui.h:5:10: fatal error: ../util/mutex.h: No such file or directory
5 | #include "../util/mutex.h"
| ^~~~~~~~~~~~~~~~~compilation terminated.
make[3]: *** [/home/linux-stable-rc/tools/build/Makefile.build:97: builtin-annotate.o] Error 1 make[2]: *** [Makefile.perf:658: perf-in.o] Error 2
make[2]: *** Waiting for unfinished jobs....
From the git log:
commit 83185fafbd143274c0313897fd8fda41aecffc93
Author: Ian Rogers <[email protected]> Date: Fri Aug 26 09:42:33 2022 -0700
perf ui: Update use of pthread mutex
[ Upstream commit 82aff6cc070417f26f9b02b26e63c17ff43b4044 ]
Switch to the use of mutex wrappers that provide better error checking.
I think building perf while adding perf patches would help us prevent from running into this issue. cd tools/perf/ ; make -j$(nproc) all
We can choose one of the three ways to solve this :
1. Drop this patch and resolve conflicts in the next patch by keeping pthread_mutex_*, but this might not help future backports.
2. Add another dependency patch which introduces header file in util folder, that is also not clean backport due to a missing commit, but I have tried preparing a backport. I am not sure if that is a preferred way but with the backport inserted before: commit 83185fafbd143274c0313897fd8fda41aecffc93 (between PATCH 224 and 225 in this series). Attached the backport. [ 0001-perf-mutex-Wrapped-usage-of-mutex-and-cond.patch ]
3. Clean cherry-pick way: instead of resolving conflict add one more prerequisite patch:
just before commit 83185fafbd14 in 5.15.y: Cherry-pick:
a. git cherry-pick -s 92ec3cc94c2c // list_sort.h addition b. git cherry-pick -s e57d897703c3 // mutex.h addition
tools/perf builds with option 2/3, tested it.
For 5.10.y: Option 2 and 3 works.
For 5.4.y we need other way to fix this.
Thanks,
Harshit
Quoted 10 lines
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.161-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
From 4c0b750d809bca811a402c6931774449d844f1f4 Mon Sep 17 00:00:00 2001
From: Pavithra Gurushankar <[email protected]>
Date: Fri, 26 Aug 2022 09:42:25 -0700
Subject: [PATCH 5.15.y] perf mutex: Wrapped usage of mutex and cond
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[ Upstream commit e57d897703c3bf8b66680c69c0e75fbd9d9617f1 ]
Added a new header file mutex.h that wraps the usage of pthread_mutex_t and pthread_cond_t. By abstracting these it is possible to introduce error checking.
[Harshit: Minor conflict resolution due to missing commit: 92ec3cc94c2c ("tools lib: Adopt list_sort() from the kernel sources") in 5.15.y]
--- tools/perf/util/Build | 1 + tools/perf/util/mutex.c | 117 ++++++++++++++++++++++++++++++++++++++++ tools/perf/util/mutex.h | 48 +++++++++++++++++ 3 files changed, 166 insertions(+) create mode 100644 tools/perf/util/mutex.c create mode 100644 tools/perf/util/mutex.h
tools/perf/util/Build +1 -0
@@ -138,6 +138,7 @@ perf-y += expr.o perf-y += branch.o perf-y += mem2node.o perf-y += clockid.o +perf-y += mutex.o perf-$(CONFIG_LIBBPF) += bpf-loader.o perf-$(CONFIG_LIBBPF) += bpf_map.o
tools/perf/util/mutex.c new file +117 -0
117 lines not on this page · raw message
tools/perf/util/mutex.h new file +48 -0
48 lines not on this page · raw message
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerQuoted 37 lines · Harshit Mogalapalli
Hello Greg and Sasha,
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.161 release. There are 402 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 Sat, 15 Jun 2024 11:31:50 +0000. Anything received after that time might be too late.
perf build breaks on 5.15.161:(and on 5.4.278, 5.10.219)
In file included from
util/cache.h:7,
from builtin-annotate.c:13:util/../ui/ui.h:5:10: fatal error:../util/mutex.h: No such file or directory5 | #include "../util/mutex.h" | ^~~~~~~~~~~~~~~~~compilation terminated.
make[3]: *** [/home/linux-stable-rc/tools/build/Makefile.build:97:
builtin-annotate.o] Error 1
make[2]: *** [Makefile.perf:658: perf-in.o] Error 2 make[2]: *** Waiting for unfinished jobs....From the git log:
commit
83185fafbd143274c0313897fd8fda41aecffc93Author: Ian Rogers <[email protected]> Date: Fri Aug 26 09:42:33 2022 -0700perf ui: Update use of pthread mutex
Quoted 7 lines
[ Upstream commit
82aff6cc070417f26f9b02b26e63c17ff43b4044]Switch to the use of mutex wrappers that provide better error checking.
I think building perf while adding perf patches would help us prevent from running into this issue. cd
tools/perf/; make -j$(nproc) all
Maybe, but I can't seem to build perf at all for quite a while, so I doubt that anyone really cares here, right?
Quoted 4 lines
We can choose one of the three ways to solve this :
1. Drop this patch and resolve conflicts in the next patch by keeping pthread_mutex_*, but this might not help future backports.
Let me just drop all of the perf patches for now from 5.15 and then I'll take some tested backports if really needed.
Otherwise, why not just use perf from the latest 6.9 tree?
Quoted 10 lines
2. Add another dependency patch which introduces header file in util folder, that is also not clean backport due to a missing commit, but I have tried preparing a backport. I am not sure if that is a preferred way but with the backport inserted before: commit
83185fafbd143274c0313897fd8fda41aecffc93(between PATCH 224 and 225 in this series). Attached the backport. [ 0001-perf-mutex-Wrapped-usage-of-mutex-and-cond.patch ]3. Clean cherry-pick way: instead of resolving conflict add one more prerequisite patch:
just before commit83185fafbd14in 5.15.y: Cherry-pick:
Quoted 6 lines
a. git cherry-pick -s 92ec3cc94c2c // list_sort.h addition b. git cherry-pick -s e57d897703c3 // mutex.h addition
tools/perfbuilds with option 2/3, tested it.For 5.10.y: Option 2 and 3 works.
I'll just drop this from 5.10 and 5.15.
Quoted 1 line
For 5.4.y we need other way to fix this.
Again, do you really want to use the 5.4 version of perf?
thanks,
greg k-h
Quoted 6 lines · Greg Kroah-Hartman
Quoted 2 lines · Harshit Mogalapalli
I think building perf while adding perf patches would help us prevent from running into this issue. cd
tools/perf/; make -j$(nproc) allMaybe, but I can't seem to build perf at all for quite a while, so I doubt that anyone really cares here, right?
We're building perf and it worked before these patches. It's part of our kernel build and we do ship the result to customers. So we care :-)
Quoted 7 lines
Quoted 4 lines
We can choose one of the three ways to solve this :
1. Drop this patch and resolve conflicts in the next patch by keeping pthread_mutex_*, but this might not help future backports.
Let me just drop all of the perf patches for now from 5.15 and then I'll take some tested backports if really needed.
Sounds good, thanks. We'll have a look at backports.
Quoted 1 line
Otherwise, why not just use perf from the latest 6.9 tree?
We have a build pipeline that's set up to build everything from the same source tree and it's not really feasible to mix and match versions like that -- besides, we don't want to jump from 5.15 to 6.9 for this stuff any more than we do for the kernel itself.
Thanks,
Vegard
Quoted 11 lines · Vegard Nossum
Quoted 6 lines · Greg Kroah-Hartman
Quoted 2 lines · Harshit Mogalapalli
I think building perf while adding perf patches would help us prevent from running into this issue. cd
tools/perf/; make -j$(nproc) allMaybe, but I can't seem to build perf at all for quite a while, so I doubt that anyone really cares here, right?
We're building perf and it worked before these patches. It's part of our kernel build and we do ship the result to customers. So we care :-)
Likewise here, we care about making sure that perf builds and works for any given stable release stream.
--
Florian
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.161 release. There are 402 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 Sat, 15 Jun 2024 11:31:50 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.161-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.161 release. There are 402 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.161 release. There are 402 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 Sat, 15 Jun 2024 11:31:50 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.161-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
All tests passing for Tegra ...
Test results for stable-v5.15:
10 builds: 10 pass, 0 fail
26 boots: 26 pass, 0 fail
102 tests: 102 pass, 0 failLinux version: 5.15.161-rc1-g382eb0c78882
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra194-p3509-0000+p3668-0000,
tegra20-ventana, tegra210-p2371-2180,
tegra210-p3450-0000, tegra30-cardhu-a04Jon
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.161 release. There are 402 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 Sat, 15 Jun 2024 11:31:50 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.161-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.161 release. There are 402 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 Sat, 15 Jun 2024 11:31:50 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.161-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
## Build
* kernel: 5.15.161-rc1
* git: https://gitlab.com/Linaro/lkft/mirrors/stable/linux-stable-rc
* git branch: linux-5.15.y
* git commit: 382eb0c7888246aec43f7bbb93ef43abf816ec32
* git describe: v5.15.160-403-g382eb0c78882
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.15.y/build/v5.15.160-403-g382eb0c78882
## Test Regressions (compared to v5.15.160)
## Metric Regressions (compared to v5.15.160)
## Test Fixes (compared to v5.15.160)
## Metric Fixes (compared to v5.15.160)
## Test result summary
total: 87886, pass: 70665, fail: 2514, skip: 14636, xfail: 71
## Build Summary
* arc: 5 total, 5 passed, 0 failed
* arm: 104 total, 104 passed, 0 failed
* arm64: 31 total, 31 passed, 0 failed
* i386: 25 total, 25 passed, 0 failed
* mips: 22 total, 22 passed, 0 failed
* parisc: 3 total, 3 passed, 0 failed
* powerpc: 24 total, 24 passed, 0 failed
* riscv: 8 total, 8 passed, 0 failed
* s390: 9 total, 9 passed, 0 failed
* sh: 10 total, 10 passed, 0 failed
* sparc: 6 total, 6 passed, 0 failed
* x86_64: 27 total, 27 passed, 0 failed
## Test suites summary
* boot
* kselftest-android
* kselftest-arm64
* kselftest-breakpoints
* kselftest-capabilities
* kselftest-cgroup
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-cpufreq
* kselftest-drivers-dma-buf
* kselftest-efivarfs
* kselftest-exec
* kselftest-filesystems
* kselftest-filesystems-binderfs
* kselftest-filesystems-epoll
* kselftest-firmware
* kselftest-fpu
* kselftest-ftrace
* kselftest-futex
* kselftest-gpio
* kselftest-intel_pstate
* kselftest-ipc
* kselftest-ir
* kselftest-kcmp
* kselftest-kexec
* kselftest-kvm
* kselftest-lib
* kselftest-livepatch
* kselftest-membarrier
* kselftest-memfd
* kselftest-memory-hotplug
* kselftest-mincore
* kselftest-mm
* kselftest-mount
* kselftest-mqueue
* kselftest-net
* kselftest-net-forwarding
* kselftest-net-mptcp
* kselftest-netfilter
* kselftest-nsfs
* kselftest-openat2
* kselftest-pid_namespace
* kselftest-pidfd
* kselftest-proc
* kselftest-pstore
* kselftest-ptrace
* kselftest-rseq
* kselftest-rtc
* kselftest-seccomp
* kselftest-sigaltstack
* kselftest-size
* kselftest-splice
* kselftest-static_keys
* kselftest-sync
* kselftest-sysctl
* kselftest-tc-testing
* kselftest-timens
* kselftest-timers
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user
* kselftest-user_events
* kselftest-vDSO
* kselftest-watchdog
* kselftest-x86
* kselftest-zram
* kunit
* kvm-unit-tests
* libgpiod
* log-parser-boot
* log-parser-test
* ltp-commands
* ltp-containers
* ltp-controllers
* ltp-cpuhotplug
* ltp-crypto
* ltp-cve
* ltp-dio
* ltp-fcntl-locktests
* ltp-fs
* ltp-fs_bind
* ltp-fs_perms_simple
* ltp-hugetlb
* ltp-ipc
* ltp-math
* ltp-mm
* ltp-nptl
* ltp-pty
* ltp-sched
* ltp-smoke
* ltp-smoketest
* ltp-syscalls
* ltp-tracing
* perf
* rcutorture
--
Linaro LKFT
https://lkft.linaro.org
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.161 release. There are 402 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 Sat, 15 Jun 2024 11:31:50 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.161-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
Same perf build failure as already reported by Harshit.
Signature · 1 line
Florian
Greg Kroah-Hartman
maintainerQuoted 17 lines · Florian Fainelli
Quoted 14 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.161 release. There are 402 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 Sat, 15 Jun 2024 11:31:50 +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.15.161-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.
Quoted 5 lines
Quoted 3 lines
thanks,
greg k-h
Same perf build failure as already reported by Harshit.
I dropped all perf changes from this tree for the release so all should be good now.
thanks,
greg k-h
Hi Greg,
Quoted 18 lines · Greg Kroah-Hartman
Quoted 17 lines · Florian Fainelli
Quoted 14 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.161 release. There are 402 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 Sat, 15 Jun 2024 11:31:50 +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.15.161-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.
Quoted 9 lines
Quoted 5 lines
Quoted 3 lines
thanks,
greg k-h
Same perf build failure as already reported by Harshit.
I dropped all perf changes from this tree for the release so all should be good now.
Yes, I have re-triggered the tests and all good now for 5.4.278 and 5.15.161. Thanks for taking care of this.
Thanks,
Harshit
Quoted 4 lines
thanks,
greg k-h