mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-27 17:35:18 -04:00
netfilter: nf_conntrack_expect: bail out on insert dead expectations
If the NF_CT_EXPECT_DEAD expectation flag is set on, bail out on
insertion. Moreover, add also DEBUG_NET_WARN_ON_ONCE() since this should
not ever happen. This is hardening commit b8b09dc2bf ("netfilter:
nf_conntrack_expect: use conntrack GC to reap expectations").
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
@@ -528,6 +528,12 @@ int nf_ct_expect_related_report(struct nf_conntrack_expect *expect,
|
||||
int ret;
|
||||
|
||||
spin_lock_bh(&nf_conntrack_expect_lock);
|
||||
if (expect->flags & NF_CT_EXPECT_DEAD) {
|
||||
DEBUG_NET_WARN_ON_ONCE(1);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
master_help = nfct_help(expect->master);
|
||||
if (!master_help) {
|
||||
ret = -ESHUTDOWN;
|
||||
|
||||
Reference in New Issue
Block a user