Re: [PATCH nf] netfilter: nf_tables: can't fail after linking rule into active rule list

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

 



On Tue, Apr 10, 2018 at 09:30:27AM +0200, Florian Westphal wrote:
> rules in nftables a free'd using kfree, but protected by rcu, i.e. we
> must wait for a grace period to elapse.
> 
> Normal removal patch does this, but nf_tables_newrule() doesn't obey
> this rule during error handling.
> 
> It calls nft_trans_rule_add() *after* linking rule, and, if that
> fails to allocate memory, it unlinks the rule and then kfree() it --
> this is unsafe.
> 
> Switch order -- first add rule to transaction list, THEN link it
> to public list.
> 
> Note: nft_trans_rule_add() uses GFP_KERNEL; it will not fail so this
> is not a problem in practice (spotted only during code review).

Also applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



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

  Powered by Linux