]> git.itanic.dy.fi Git - linux-stable/commit
netfilter: conntrack: convert nf_conntrack_update to netfilter verdicts
authorFlorian Westphal <fw@strlen.de>
Wed, 11 Oct 2023 07:59:36 +0000 (09:59 +0200)
committerFlorian Westphal <fw@strlen.de>
Wed, 18 Oct 2023 08:26:43 +0000 (10:26 +0200)
commit6291b3a67ad55102f163f6a636bc540e460f892d
tree5b74eed17ed806963d8542c2fb69518e09a8689f
parent4d26ab0086aab2d77c54e54020e47737dc6ed165
netfilter: conntrack: convert nf_conntrack_update to netfilter verdicts

This function calls helpers that can return nf-verdicts, but then
those get converted to -1/0 as thats what the caller expects.

Theoretically NF_DROP could have an errno number set in the upper 24
bits of the return value. Or any of those helpers could return
NF_STOLEN, which would result in use-after-free.

This is fine as-is, the called functions don't do this yet.

But its better to avoid possible future problems if the upcoming
patchset to add NF_DROP_REASON() support gains further users, so remove
the 0/-1 translation from the picture and pass the verdicts down to
the caller.

Signed-off-by: Florian Westphal <fw@strlen.de>
net/netfilter/nf_conntrack_core.c
net/netfilter/nfnetlink_queue.c