From: Greg Kroah-Hartman Date: Thu, 11 Apr 2024 09:47:57 +0000 (+0200) Subject: 4.19-stable patches X-Git-Tag: v4.19.312~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a06e1f3664ce719b7603648f26ddf392259df5bb;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: erspan-check-ifla_gre_erspan_ver-is-set.patch initramfs-fix-populate_initrd_image-section-mismatch.patch ip_gre-do-not-report-erspan-version-on-gre-interface.patch --- diff --git a/queue-4.19/erspan-check-ifla_gre_erspan_ver-is-set.patch b/queue-4.19/erspan-check-ifla_gre_erspan_ver-is-set.patch new file mode 100644 index 00000000000..7a019073d22 --- /dev/null +++ b/queue-4.19/erspan-check-ifla_gre_erspan_ver-is-set.patch @@ -0,0 +1,33 @@ +From 51fa960d3b5163b1af22efdebcabfccc5d615ad6 Mon Sep 17 00:00:00 2001 +From: William Tu +Date: Tue, 12 May 2020 10:36:23 -0700 +Subject: erspan: Check IFLA_GRE_ERSPAN_VER is set. + +From: William Tu + +commit 51fa960d3b5163b1af22efdebcabfccc5d615ad6 upstream. + +Add a check to make sure the IFLA_GRE_ERSPAN_VER is provided by users. + +Fixes: f989d546a2d5 ("erspan: Add type I version 0 support.") +Cc: Eric Dumazet +Signed-off-by: William Tu +Reviewed-by: Eric Dumazet +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv4/ip_gre.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/net/ipv4/ip_gre.c ++++ b/net/ipv4/ip_gre.c +@@ -1182,7 +1182,8 @@ static int erspan_validate(struct nlattr + if (ret) + return ret; + +- if (nla_get_u8(data[IFLA_GRE_ERSPAN_VER]) == 0) ++ if (data[IFLA_GRE_ERSPAN_VER] && ++ nla_get_u8(data[IFLA_GRE_ERSPAN_VER]) == 0) + return 0; + + /* ERSPAN type II/III should only have GRE sequence and key flag */ diff --git a/queue-4.19/initramfs-fix-populate_initrd_image-section-mismatch.patch b/queue-4.19/initramfs-fix-populate_initrd_image-section-mismatch.patch new file mode 100644 index 00000000000..eaf6004039b --- /dev/null +++ b/queue-4.19/initramfs-fix-populate_initrd_image-section-mismatch.patch @@ -0,0 +1,56 @@ +From 4ada1e810038e9dbc20e40b524e05ee1a9d31f98 Mon Sep 17 00:00:00 2001 +From: Geert Uytterhoeven +Date: Fri, 28 Jun 2019 12:07:03 -0700 +Subject: initramfs: fix populate_initrd_image() section mismatch + +From: Geert Uytterhoeven + +commit 4ada1e810038e9dbc20e40b524e05ee1a9d31f98 upstream. + +With gcc-4.6.3: + + WARNING: vmlinux.o(.text.unlikely+0x140): Section mismatch in reference from the function populate_initrd_image() to the variable .init.ramfs.info:__initramfs_size + The function populate_initrd_image() references + the variable __init __initramfs_size. + This is often because populate_initrd_image lacks a __init + annotation or the annotation of __initramfs_size is wrong. + + WARNING: vmlinux.o(.text.unlikely+0x14c): Section mismatch in reference from the function populate_initrd_image() to the function .init.text:unpack_to_rootfs() + The function populate_initrd_image() references + the function __init unpack_to_rootfs(). + This is often because populate_initrd_image lacks a __init + annotation or the annotation of unpack_to_rootfs is wrong. + + WARNING: vmlinux.o(.text.unlikely+0x198): Section mismatch in reference from the function populate_initrd_image() to the function .init.text:xwrite() + The function populate_initrd_image() references + the function __init xwrite(). + This is often because populate_initrd_image lacks a __init + annotation or the annotation of xwrite is wrong. + +Indeed, if the compiler decides not to inline populate_initrd_image(), a +warning is generated. + +Fix this by adding the missing __init annotations. + +Link: http://lkml.kernel.org/r/20190617074340.12779-1-geert@linux-m68k.org +Fixes: 7c184ecd262fe64f ("initramfs: factor out a helper to populate the initrd image") +Signed-off-by: Geert Uytterhoeven +Reviewed-by: Christoph Hellwig +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + init/initramfs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/init/initramfs.c ++++ b/init/initramfs.c +@@ -603,7 +603,7 @@ static void __init clean_rootfs(void) + #endif + + #ifdef CONFIG_BLK_DEV_RAM +-static void populate_initrd_image(char *err) ++static void __init populate_initrd_image(char *err) + { + ssize_t written; + struct file *file; diff --git a/queue-4.19/ip_gre-do-not-report-erspan-version-on-gre-interface.patch b/queue-4.19/ip_gre-do-not-report-erspan-version-on-gre-interface.patch new file mode 100644 index 00000000000..c8c51b399c3 --- /dev/null +++ b/queue-4.19/ip_gre-do-not-report-erspan-version-on-gre-interface.patch @@ -0,0 +1,99 @@ +From ee496694b9eea651ae1aa4c4667d886cdf74aa3b Mon Sep 17 00:00:00 2001 +From: Hangbin Liu +Date: Sat, 3 Dec 2022 11:28:58 +0800 +Subject: ip_gre: do not report erspan version on GRE interface + +From: Hangbin Liu + +commit ee496694b9eea651ae1aa4c4667d886cdf74aa3b upstream. + +Although the type I ERSPAN is based on the barebones IP + GRE +encapsulation and no extra ERSPAN header. Report erspan version on GRE +interface looks unreasonable. Fix this by separating the erspan and gre +fill info. + +IPv6 GRE does not have this info as IPv6 only supports erspan version +1 and 2. + +Reported-by: Jianlin Shi +Fixes: f989d546a2d5 ("erspan: Add type I version 0 support.") +Signed-off-by: Hangbin Liu +Acked-by: William Tu +Link: https://lore.kernel.org/r/20221203032858.3130339-1-liuhangbin@gmail.com +Signed-off-by: Paolo Abeni +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv4/ip_gre.c | 48 +++++++++++++++++++++++++++++------------------- + 1 file changed, 29 insertions(+), 19 deletions(-) + +--- a/net/ipv4/ip_gre.c ++++ b/net/ipv4/ip_gre.c +@@ -1586,24 +1586,6 @@ static int ipgre_fill_info(struct sk_buf + struct ip_tunnel_parm *p = &t->parms; + __be16 o_flags = p->o_flags; + +- if (t->erspan_ver <= 2) { +- if (t->erspan_ver != 0 && !t->collect_md) +- o_flags |= TUNNEL_KEY; +- +- if (nla_put_u8(skb, IFLA_GRE_ERSPAN_VER, t->erspan_ver)) +- goto nla_put_failure; +- +- if (t->erspan_ver == 1) { +- if (nla_put_u32(skb, IFLA_GRE_ERSPAN_INDEX, t->index)) +- goto nla_put_failure; +- } else if (t->erspan_ver == 2) { +- if (nla_put_u8(skb, IFLA_GRE_ERSPAN_DIR, t->dir)) +- goto nla_put_failure; +- if (nla_put_u16(skb, IFLA_GRE_ERSPAN_HWID, t->hwid)) +- goto nla_put_failure; +- } +- } +- + if (nla_put_u32(skb, IFLA_GRE_LINK, p->link) || + nla_put_be16(skb, IFLA_GRE_IFLAGS, + gre_tnl_flags_to_gre_flags(p->i_flags)) || +@@ -1644,6 +1626,34 @@ nla_put_failure: + return -EMSGSIZE; + } + ++static int erspan_fill_info(struct sk_buff *skb, const struct net_device *dev) ++{ ++ struct ip_tunnel *t = netdev_priv(dev); ++ ++ if (t->erspan_ver <= 2) { ++ if (t->erspan_ver != 0 && !t->collect_md) ++ t->parms.o_flags |= TUNNEL_KEY; ++ ++ if (nla_put_u8(skb, IFLA_GRE_ERSPAN_VER, t->erspan_ver)) ++ goto nla_put_failure; ++ ++ if (t->erspan_ver == 1) { ++ if (nla_put_u32(skb, IFLA_GRE_ERSPAN_INDEX, t->index)) ++ goto nla_put_failure; ++ } else if (t->erspan_ver == 2) { ++ if (nla_put_u8(skb, IFLA_GRE_ERSPAN_DIR, t->dir)) ++ goto nla_put_failure; ++ if (nla_put_u16(skb, IFLA_GRE_ERSPAN_HWID, t->hwid)) ++ goto nla_put_failure; ++ } ++ } ++ ++ return ipgre_fill_info(skb, dev); ++ ++nla_put_failure: ++ return -EMSGSIZE; ++} ++ + static void erspan_setup(struct net_device *dev) + { + struct ip_tunnel *t = netdev_priv(dev); +@@ -1722,7 +1732,7 @@ static struct rtnl_link_ops erspan_link_ + .changelink = erspan_changelink, + .dellink = ip_tunnel_dellink, + .get_size = ipgre_get_size, +- .fill_info = ipgre_fill_info, ++ .fill_info = erspan_fill_info, + .get_link_net = ip_tunnel_get_link_net, + }; + diff --git a/queue-4.19/series b/queue-4.19/series index 16a3397eeca..cc702295f86 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -170,3 +170,6 @@ virtio-reenable-config-if-freezing-device-failed.patch x86-mm-pat-fix-vm_pat-handling-in-cow-mappings.patch bluetooth-btintel-fixe-build-regression.patch vmci-fix-possible-memcpy-run-time-warning-in-vmci_datagram_invoke_guest_handler.patch +erspan-check-ifla_gre_erspan_ver-is-set.patch +ip_gre-do-not-report-erspan-version-on-gre-interface.patch +initramfs-fix-populate_initrd_image-section-mismatch.patch