!83 [sync] PR-82: fix one patch from commity

From: @openeuler-sync-bot 
Reviewed-by: @seuzw 
Signed-off-by: @seuzw
This commit is contained in:
openeuler-ci-bot 2023-04-13 02:31:21 +00:00 committed by Gitee
commit 4f90d323fe
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,32 @@
From e900d40afdb731d2270a5110833ae49192974355 Mon Sep 17 00:00:00 2001
From: Florian Westphal <fw@strlen.de>
Date: Tue, 14 Mar 2023 22:36:50 +0100
Subject: [PATCH] xtables-eb: fix crash when opts isn't reallocated
opts may point to statically allocated memory.
This fixes abort() from libc.
Conflict: NA
Reference: https://git.netfilter.org/iptables/commit?id=e900d40afdb731d2270a5110833ae49192974355
Signed-off-by: Florian Westphal <fw@strlen.de>
---
iptables/xtables-eb.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/iptables/xtables-eb.c b/iptables/xtables-eb.c
index 3a73e797..068dffd2 100644
--- a/iptables/xtables-eb.c
+++ b/iptables/xtables-eb.c
@@ -675,7 +675,8 @@ void nft_fini_eb(struct nft_handle *h)
free(target->t);
}
- free(opts);
+ if (opts != ebt_original_options)
+ free(opts);
nft_fini(h);
xtables_fini();
--
2.23.0

View File

@ -2,7 +2,7 @@
%global legacy_actions %{_libexecdir}/initscripts/legacy-actions
Name: iptables
Version: 1.8.7
Release: 12
Release: 13
Summary: IP packet filter administration utilities
License: GPLv2 and Artistic Licence 2.0 and ISC
URL: https://www.netfilter.org/
@ -31,6 +31,8 @@ Patch13: backport-nft-Plug-memleak-in-nft_rule_zero_counters.patch
Patch14: backport-iptables-Plug-memleaks-in-print_firewall.patch
Patch15: backport-ebtables-translate-Print-flush-command-after-parsing-is-finished.patch
Patch16: backport-xtables-eb-fix-crash-when-opts-isn-t-reallocated.patch
BuildRequires: bison flex gcc kernel-headers libpcap-devel libselinux-devel systemd
BuildRequires: libmnl-devel libnetfilter_conntrack-devel libnfnetlink-devel libnftnl-devel
BuildRequires: autogen autoconf automake libtool
@ -338,6 +340,12 @@ fi
%{_mandir}/man8/xtables-legacy*
%changelog
* Wed Apr 12 2023 zhanghao <zhanghao383@huawei.com> - 1.8.7-13
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:xtables-eb: fix crash when opts isn't reallocated
* Tue Mar 21 2023 zhanghao <zhanghao383@huawei.com> - 1.8.7-12
- Type:bugfix
- CVE:NA