]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Jul 2022 12:37:04 +0000 (14:37 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Jul 2022 12:37:04 +0000 (14:37 +0200)
added patches:
net-ipv6-unexport-__init-annotated-seg6_hmac_net_init.patch
nfsd-restore-einval-error-translation-in-nfsd_commit.patch

queue-5.10/net-ipv6-unexport-__init-annotated-seg6_hmac_net_init.patch [new file with mode: 0644]
queue-5.10/nfsd-restore-einval-error-translation-in-nfsd_commit.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/net-ipv6-unexport-__init-annotated-seg6_hmac_net_init.patch b/queue-5.10/net-ipv6-unexport-__init-annotated-seg6_hmac_net_init.patch
new file mode 100644 (file)
index 0000000..d789323
--- /dev/null
@@ -0,0 +1,41 @@
+From 53ad46169fe2996fe1b623ba6c9c4fa33847876f Mon Sep 17 00:00:00 2001
+From: YueHaibing <yuehaibing@huawei.com>
+Date: Tue, 28 Jun 2022 11:31:34 +0800
+Subject: net: ipv6: unexport __init-annotated seg6_hmac_net_init()
+
+From: YueHaibing <yuehaibing@huawei.com>
+
+commit 53ad46169fe2996fe1b623ba6c9c4fa33847876f upstream.
+
+As of commit 5801f064e351 ("net: ipv6: unexport __init-annotated seg6_hmac_init()"),
+EXPORT_SYMBOL and __init is a bad combination because the .init.text
+section is freed up after the initialization. Hence, modules cannot
+use symbols annotated __init. The access to a freed symbol may end up
+with kernel panic.
+
+This remove the EXPORT_SYMBOL to fix modpost warning:
+
+WARNING: modpost: vmlinux.o(___ksymtab+seg6_hmac_net_init+0x0): Section mismatch in reference from the variable __ksymtab_seg6_hmac_net_init to the function .init.text:seg6_hmac_net_init()
+The symbol seg6_hmac_net_init is exported and annotated __init
+Fix this by removing the __init annotation of seg6_hmac_net_init or drop the export.
+
+Fixes: bf355b8d2c30 ("ipv6: sr: add core files for SR HMAC support")
+Reported-by: Hulk Robot <hulkci@huawei.com>
+Signed-off-by: YueHaibing <yuehaibing@huawei.com>
+Link: https://lore.kernel.org/r/20220628033134.21088-1-yuehaibing@huawei.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ipv6/seg6_hmac.c |    1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/net/ipv6/seg6_hmac.c
++++ b/net/ipv6/seg6_hmac.c
+@@ -409,7 +409,6 @@ int __net_init seg6_hmac_net_init(struct
+       return 0;
+ }
+-EXPORT_SYMBOL(seg6_hmac_net_init);
+ void seg6_hmac_exit(void)
+ {
diff --git a/queue-5.10/nfsd-restore-einval-error-translation-in-nfsd_commit.patch b/queue-5.10/nfsd-restore-einval-error-translation-in-nfsd_commit.patch
new file mode 100644 (file)
index 0000000..fa281c8
--- /dev/null
@@ -0,0 +1,43 @@
+From 8a9ffb8c857c2c99403bd6483a5a005fed5c0773 Mon Sep 17 00:00:00 2001
+From: Alexey Khoroshilov <khoroshilov@ispras.ru>
+Date: Sat, 25 Jun 2022 23:52:43 +0300
+Subject: NFSD: restore EINVAL error translation in nfsd_commit()
+
+From: Alexey Khoroshilov <khoroshilov@ispras.ru>
+
+commit 8a9ffb8c857c2c99403bd6483a5a005fed5c0773 upstream.
+
+commit 555dbf1a9aac ("nfsd: Replace use of rwsem with errseq_t")
+incidentally broke translation of -EINVAL to nfserr_notsupp.
+The patch restores that.
+
+Found by Linux Verification Center (linuxtesting.org) with SVACE.
+
+Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
+Fixes: 555dbf1a9aac ("nfsd: Replace use of rwsem with errseq_t")
+Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/nfsd/vfs.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/fs/nfsd/vfs.c
++++ b/fs/nfsd/vfs.c
+@@ -1156,6 +1156,7 @@ nfsd_commit(struct svc_rqst *rqstp, stru
+                                               nfsd_net_id));
+                       err2 = filemap_check_wb_err(nf->nf_file->f_mapping,
+                                                   since);
++                      err = nfserrno(err2);
+                       break;
+               case -EINVAL:
+                       err = nfserr_notsupp;
+@@ -1163,8 +1164,8 @@ nfsd_commit(struct svc_rqst *rqstp, stru
+               default:
+                       nfsd_reset_boot_verifier(net_generic(nf->nf_net,
+                                                nfsd_net_id));
++                      err = nfserrno(err2);
+               }
+-              err = nfserrno(err2);
+       } else
+               nfsd_copy_boot_verifier(verf, net_generic(nf->nf_net,
+                                       nfsd_net_id));
index 7f4a57d5f3cda337f47d2813d96c64c43c3e948e..d71900c00cba26d30df54440795bc88c0166e99e 100644 (file)
@@ -22,3 +22,5 @@ rdma-qedr-fix-reporting-qp-timeout-attribute.patch
 rdma-cm-fix-memory-leak-in-ib_cm_insert_listen.patch
 linux-dim-fix-divide-by-0-in-rdma-dim.patch
 usbnet-fix-memory-allocation-in-helpers.patch
+net-ipv6-unexport-__init-annotated-seg6_hmac_net_init.patch
+nfsd-restore-einval-error-translation-in-nfsd_commit.patch