Re: nftables null pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 05, 2014 at 12:21:30PM +0200, Matteo Croce wrote:
> Yes it's reproducible with two config and two list:
> 
> # nft -f /dev/stdin <<EOF
> table ip nat {
>         chain post {
>                 type nat hook postrouting priority 0;
>                 ip saddr 192.168.0.0/24 oif eth0 snat 192.168.1.2
>         }
> }
> EOF
> 
> # nft -n list table nat
> 
> # nft -f /dev/stdin <<EOF
> table ip nat {
>         chain post {
>                 type nat hook postrouting priority 0;
>                 ip saddr 192.168.0.0/24 oif eth0 snat 192.168.1.2
>         }
> }
> EOF
> 
> # nft -n list table nat

Could you give a try to the following patch? Thanks.

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index f95dc95..f7dce2b 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -899,6 +899,9 @@ static struct nft_stats __percpu *nft_stats_alloc(const struct nlattr *attr)
 static void nft_chain_stats_replace(struct nft_base_chain *chain,
 				    struct nft_stats __percpu *newstats)
 {
+	if (newstats == NULL)
+		return;
+
 	if (chain->stats) {
 		struct nft_stats __percpu *oldstats =
 				nft_dereference(chain->stats);

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux