Re: [PATCH net v2] net: netfilter: Fix use-after-free in get_info()

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

 



Dong Chenchen <dongchenchen2@xxxxxxxxxx> wrote:
> While xt_table module was going away and has been removed from
> xt_templates list, we couldnt get refcnt of xt_table->me. Check
> module in xt_net->tables list re-traversal to fix it.
> 
> Fixes: fdacd57c79b7 ("netfilter: x_tables: never register tables by default")
> Signed-off-by: Dong Chenchen <dongchenchen2@xxxxxxxxxx>
> ---
>  net/netfilter/x_tables.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
> index da5d929c7c85..709840612f0d 100644
> --- a/net/netfilter/x_tables.c
> +++ b/net/netfilter/x_tables.c
> @@ -1269,7 +1269,7 @@ struct xt_table *xt_find_table_lock(struct net *net, u_int8_t af,
>  
>  	/* and once again: */
>  	list_for_each_entry(t, &xt_net->tables[af], list)
> -		if (strcmp(t->name, name) == 0)
> +		if (strcmp(t->name, name) == 0 && owner == t->me)
>  			return t;

LGTM, thanks.

Reviewed-by: Florian Westphal <fw@xxxxxxxxx>




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux