A userspace helper is created with helper->l4proto taken from NFCTH_TUPLE_L4PROTONUM, which accepts any u8 value, including 0. Such a helper can never be assigned to a connection by tuple lookup, as no connection has protocol 0. But a conntrack helper with l4proto 0 is treated as protocol agnostic by the l4 protocol check added to nf_ct_call_helper(). Userspace helpers parse protocol specific payload and must never be exempt from that check. Reject protocol 0 via netlink policy so this cannot happen. LLM finding, no bug report, considered a cleanup. Signed-off-by: Florian Westphal --- net/netfilter/nfnetlink_cthelper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/nfnetlink_cthelper.c b/net/netfilter/nfnetlink_cthelper.c index a09b2fdbf9b4..b5e4433c32bc 100644 --- a/net/netfilter/nfnetlink_cthelper.c +++ b/net/netfilter/nfnetlink_cthelper.c @@ -68,7 +68,7 @@ nfnl_userspace_cthelper(struct sk_buff *skb, unsigned int protoff, static const struct nla_policy nfnl_cthelper_tuple_pol[NFCTH_TUPLE_MAX+1] = { [NFCTH_TUPLE_L3PROTONUM] = NLA_POLICY_MAX(NLA_BE16, NFPROTO_IPV6), - [NFCTH_TUPLE_L4PROTONUM] = { .type = NLA_U8, }, + [NFCTH_TUPLE_L4PROTONUM] = NLA_POLICY_MIN(NLA_U8, 1), }; static int -- 2.56.1