mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
netfilter: cttimeout: ctnl_timeout_find_get() returns incorrect pointer to type
Compiler did not catch incorrect typing in the rcu hook assignment.
% nfct add timeout test-tcp inet tcp established 100 close 10 close_wait 10
% iptables -I OUTPUT -t raw -p tcp -j CT --timeout test-tcp
dmesg - xt_CT: Timeout policy `test-tcp' can only be used by L3 protocol number 25000
The CT target bails out with incorrect layer 3 protocol number.
Fixes: 6c1fd7dc48
("netfilter: cttimeout: decouple timeout policy from nfnetlink_cttimeout object")
Reported-by: Harsha Sharma <harshasharmaiitr@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
a874752a10
commit
99e25d071f
1 changed files with 3 additions and 3 deletions
|
@ -489,8 +489,8 @@ static int cttimeout_default_get(struct net *net, struct sock *ctnl,
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct ctnl_timeout *
|
static struct nf_ct_timeout *ctnl_timeout_find_get(struct net *net,
|
||||||
ctnl_timeout_find_get(struct net *net, const char *name)
|
const char *name)
|
||||||
{
|
{
|
||||||
struct ctnl_timeout *timeout, *matching = NULL;
|
struct ctnl_timeout *timeout, *matching = NULL;
|
||||||
|
|
||||||
|
@ -509,7 +509,7 @@ ctnl_timeout_find_get(struct net *net, const char *name)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
err:
|
err:
|
||||||
return matching;
|
return matching ? &matching->timeout : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ctnl_timeout_put(struct nf_ct_timeout *t)
|
static void ctnl_timeout_put(struct nf_ct_timeout *t)
|
||||||
|
|
Loading…
Reference in a new issue