From 2b700ba06874425c7d46ed5c3ac03ab919e43fd5 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 4 Jul 2022 14:36:52 +0200 Subject: [PATCH] 4.19-stable patches added patches: net-ipv6-unexport-__init-annotated-seg6_hmac_net_init.patch --- ...-__init-annotated-seg6_hmac_net_init.patch | 41 +++++++++++++++++++ queue-4.19/series | 1 + 2 files changed, 42 insertions(+) create mode 100644 queue-4.19/net-ipv6-unexport-__init-annotated-seg6_hmac_net_init.patch diff --git a/queue-4.19/net-ipv6-unexport-__init-annotated-seg6_hmac_net_init.patch b/queue-4.19/net-ipv6-unexport-__init-annotated-seg6_hmac_net_init.patch new file mode 100644 index 00000000000..91922e80128 --- /dev/null +++ b/queue-4.19/net-ipv6-unexport-__init-annotated-seg6_hmac_net_init.patch @@ -0,0 +1,41 @@ +From 53ad46169fe2996fe1b623ba6c9c4fa33847876f Mon Sep 17 00:00:00 2001 +From: YueHaibing +Date: Tue, 28 Jun 2022 11:31:34 +0800 +Subject: net: ipv6: unexport __init-annotated seg6_hmac_net_init() + +From: YueHaibing + +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 +Signed-off-by: YueHaibing +Link: https://lore.kernel.org/r/20220628033134.21088-1-yuehaibing@huawei.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv6/seg6_hmac.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/net/ipv6/seg6_hmac.c ++++ b/net/ipv6/seg6_hmac.c +@@ -415,7 +415,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-4.19/series b/queue-4.19/series index 65ec724d205..52019a2072e 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -11,3 +11,4 @@ net-tun-unlink-napi-from-device-on-destruction.patch net-tun-stop-napi-when-detaching-queues.patch rdma-qedr-fix-reporting-qp-timeout-attribute.patch usbnet-fix-memory-allocation-in-helpers.patch +net-ipv6-unexport-__init-annotated-seg6_hmac_net_init.patch -- 2.47.3