Skip to content

Commit 4f4ecd5

Browse files
committed
Merge branch 'master' of git://1984.lsi.us.es/nf
Pablo Neira Ayuso says: ==================== The following patchset contains netfilter updates for your net tree, they are: * Fix missing the skb->trace reset in nf_reset, noticed by Gao Feng while using the TRACE target with several net namespaces. * Fix prefix translation in IPv6 NPT if non-multiple of 32 prefixes are used, from Matthias Schiffer. * Fix invalid nfacct objects with empty name, they are now rejected with -EINVAL, spotted by Michael Zintakis, patch from myself. * A couple of fixes for wrong return values in the error path of nfnetlink_queue and nf_conntrack, from Wei Yongjun. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 518314f + 906b1c3 commit 4f4ecd5

File tree

5 files changed

+10
-2
lines changed

5 files changed

+10
-2
lines changed

include/linux/skbuff.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2641,6 +2641,9 @@ static inline void nf_reset(struct sk_buff *skb)
26412641
nf_bridge_put(skb->nf_bridge);
26422642
skb->nf_bridge = NULL;
26432643
#endif
2644+
#if IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TRACE)
2645+
skb->nf_trace = 0;
2646+
#endif
26442647
}
26452648

26462649
/* Note: This doesn't put any conntrack and bridge info in dst. */

net/ipv6/netfilter/ip6t_NPT.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static bool ip6t_npt_map_pfx(const struct ip6t_npt_tginfo *npt,
5757
if (pfx_len - i >= 32)
5858
mask = 0;
5959
else
60-
mask = htonl(~((1 << (pfx_len - i)) - 1));
60+
mask = htonl((1 << (i - pfx_len + 32)) - 1);
6161

6262
idx = i / 32;
6363
addr->s6_addr32[idx] &= mask;

net/netfilter/nf_conntrack_standalone.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,7 @@ static int __init nf_conntrack_standalone_init(void)
568568
register_net_sysctl(&init_net, "net", nf_ct_netfilter_table);
569569
if (!nf_ct_netfilter_header) {
570570
pr_err("nf_conntrack: can't register to sysctl.\n");
571+
ret = -ENOMEM;
571572
goto out_sysctl;
572573
}
573574
#endif

net/netfilter/nfnetlink_acct.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ nfnl_acct_new(struct sock *nfnl, struct sk_buff *skb,
4949
return -EINVAL;
5050

5151
acct_name = nla_data(tb[NFACCT_NAME]);
52+
if (strlen(acct_name) == 0)
53+
return -EINVAL;
5254

5355
list_for_each_entry(nfacct, &nfnl_acct_list, head) {
5456
if (strncmp(nfacct->name, acct_name, NFACCT_NAME_MAX) != 0)

net/netfilter/nfnetlink_queue_core.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1062,8 +1062,10 @@ static int __init nfnetlink_queue_init(void)
10621062

10631063
#ifdef CONFIG_PROC_FS
10641064
if (!proc_create("nfnetlink_queue", 0440,
1065-
proc_net_netfilter, &nfqnl_file_ops))
1065+
proc_net_netfilter, &nfqnl_file_ops)) {
1066+
status = -ENOMEM;
10661067
goto cleanup_subsys;
1068+
}
10671069
#endif
10681070

10691071
register_netdevice_notifier(&nfqnl_dev_notifier);

0 commit comments

Comments
 (0)