From cd705086297c26bfb42bb562af2e125d8b7d2b85 Mon Sep 17 00:00:00 2001 From: chengyechun Date: Mon, 14 Aug 2023 16:32:35 +0800 Subject: [PATCH] prevent segfault in af_request_type (cherry picked from commit 9b8250a8737d2bccf7bf15a468a686d5f3d6ac00) --- backport-fix-bridge-info-parsing.patch | 27 ++++++++++++++++++ ...-prevent-segfault-in-af_request_type.patch | 28 +++++++++++++++++++ libnl3.spec | 12 +++++++- 3 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 backport-fix-bridge-info-parsing.patch create mode 100644 backport-prevent-segfault-in-af_request_type.patch diff --git a/backport-fix-bridge-info-parsing.patch b/backport-fix-bridge-info-parsing.patch new file mode 100644 index 0000000..a668a48 --- /dev/null +++ b/backport-fix-bridge-info-parsing.patch @@ -0,0 +1,27 @@ +From 143cee1d381753c3ff01d51b39d7717d5c59bd2 Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Tue, 25 Jul 2023 02:09:46 AM GMT+0800 +Subject: [PATCH] fix bridge info parsing + +Conflict:NA +Reference:https://github.com/thom311/libnl/commit/143cee1d381753c3ff01d51b39d7717d5c59bd2 + +--- + lib/route/link/bridge.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lib/route/link/bridge.c b/lib/route/link/bridge.c +index bd04253..919828f 100644 +--- a/lib/route/link/bridge.c ++++ b/lib/route/link/bridge.c +@@ -189,6 +189,7 @@ static int bridge_parse_af_full(struct rtnl_link *link, struct nlattr *attr_full + if (nla_type(attr) == IFLA_BRIDGE_MODE) { + bd->b_hwmode = nla_get_u16(attr); + bd->ce_mask |= BRIDGE_ATTR_HWMODE; ++ continue; + } else if (nla_type(attr) != IFLA_BRIDGE_VLAN_INFO) + continue; + +-- +2.23.0 + diff --git a/backport-prevent-segfault-in-af_request_type.patch b/backport-prevent-segfault-in-af_request_type.patch new file mode 100644 index 0000000..30d276e --- /dev/null +++ b/backport-prevent-segfault-in-af_request_type.patch @@ -0,0 +1,28 @@ +From 6519a9173f900b364f014a2321a17aa6bf652e6d Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Tue, 25 Jul 2023 01:38:44 AM GMT+0800 +Subject: [PATCH] prevent segfault in af_request_type + +Conflict:NA +Reference:https://github.com/thom311/libnl/commit/6519a9173f900b364f014a2321a17aa6bf652e6d + +--- + lib/route/link.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/route/link.c b/lib/route/link.c +index df8ea5b..e3f657b 100644 +--- a/lib/route/link.c ++++ b/lib/route/link.c +@@ -115,7 +115,7 @@ static int af_request_type(int af_type, struct rtnl_link *changes) + struct rtnl_link_af_ops *ops; + + ops = rtnl_link_af_ops_lookup(af_type); +- if (ops && ops->ao_override_rtm(changes)) ++ if (ops && ops->ao_override_rtm && ops->ao_override_rtm(changes)) + return RTM_SETLINK; + + return RTM_NEWLINK; +-- +2.23.0 + diff --git a/libnl3.spec b/libnl3.spec index 81601d4..f55ab18 100644 --- a/libnl3.spec +++ b/libnl3.spec @@ -1,11 +1,14 @@ Name: libnl3 Version: 3.7.0 -Release: 1 +Release: 2 Summary: Providing APIs to netlink protocol based Linux kernel interfaces License: LGPLv2 URL: http://www.infradead.org/~tgr/libnl/ Source: https://github.com/thom311/libnl/releases/download/libnl3_7_0/libnl-3.7.0.tar.gz +Patch6000: backport-prevent-segfault-in-af_request_type.patch +Patch6001: backport-fix-bridge-info-parsing.patch + BuildRequires: flex bison libtool autoconf automake swig Requires: %{name} = %{version}-%{release} @@ -89,6 +92,13 @@ cd python %{python3_sitearch}/netlink-*.egg-info %changelog +* Mon Aug 14 2023 chengyechun - 3.7.0-2 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:prevent segfault in af_request_type + fix bridge info parsing + * Wed Nov 9 2022 chengyechun - 3.7.0-1 - Type:enhancement - ID:NA -- Gitee