1From e900d40afdb731d2270a5110833ae49192974355 Mon Sep 17 00:00:00 2001 2From: Florian Westphal <fw@strlen.de> 3Date: Tue, 14 Mar 2023 22:36:50 +0100 4Subject: [PATCH] xtables-eb: fix crash when opts isn't reallocated 5 6opts may point to statically allocated memory. 7This fixes abort() from libc. 8 9Conflict: NA 10Reference: https://git.netfilter.org/iptables/commit?id=e900d40afdb731d2270a5110833ae49192974355 11 12Signed-off-by: Florian Westphal <fw@strlen.de> 13--- 14 iptables/xtables-eb.c | 3 ++- 15 1 file changed, 2 insertions(+), 1 deletion(-) 16 17diff --git a/iptables/xtables-eb.c b/iptables/xtables-eb.c 18index 3a73e797..068dffd2 100644 19--- a/iptables/xtables-eb.c 20+++ b/iptables/xtables-eb.c 21@@ -675,7 +675,8 @@ void nft_fini_eb(struct nft_handle *h) 22 free(target->t); 23 } 24 25- free(opts); 26+ if (opts != ebt_original_options) 27+ free(opts); 28 29 nft_fini(h); 30 xtables_fini(); 31-- 322.23.0 33