netfilter: log: Check param to avoid overflow in nf_log_set
The nf_log_set is an interface function, so it should do the strict sanity check of parameters. Convert the return value of nf_log_set as int instead of void. When the pf is invalid, return -EOPNOTSUPP. Signed-off-by: Gao Feng <fgao@ikuai8.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:

committed by
Pablo Neira Ayuso

parent
3cb27991aa
commit
779994fa36
@@ -379,8 +379,7 @@ static struct nf_logger nf_ip6_logger __read_mostly = {
|
||||
|
||||
static int __net_init nf_log_ipv6_net_init(struct net *net)
|
||||
{
|
||||
nf_log_set(net, NFPROTO_IPV6, &nf_ip6_logger);
|
||||
return 0;
|
||||
return nf_log_set(net, NFPROTO_IPV6, &nf_ip6_logger);
|
||||
}
|
||||
|
||||
static void __net_exit nf_log_ipv6_net_exit(struct net *net)
|
||||
|
Reference in New Issue
Block a user