The problem here is that get_frag() does not set 'inv' in any case, so
when later checking its value, garbage may be read. Sanitize this case
by setting 'inv' to false before calling get_frag().

Signed-off-by: Phil Sutter <p...@nwl.cc>
---
 iptables/nft-ipv4.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/iptables/nft-ipv4.c b/iptables/nft-ipv4.c
index 3db31bd38d016..36ddebbe11c19 100644
--- a/iptables/nft-ipv4.c
+++ b/iptables/nft-ipv4.c
@@ -234,6 +234,7 @@ static void nft_ipv4_parse_payload(struct nft_xt_ctx *ctx,
                break;
        case offsetof(struct iphdr, frag_off):
                cs->fw.ip.flags |= IPT_F_FRAG;
+               inv = false;
                get_frag(ctx, e, &inv);
                if (inv)
                        cs->fw.ip.invflags |= IPT_INV_FRAG;
-- 
2.18.0

Reply via email to