Re: [PATCH] netfilter: nf_nat: fix crash in nf_nat_csum

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

 



On 29.05.2011 22:42, Julian Anastasov wrote:
> 
> 	Fix crash in nf_nat_csum when mangling packets
> in OUTPUT hook where skb->dev is not defined, it is set
> later before POSTROUTING. Problem happens for CHECKSUM_NONE.
> We can check device from rt but using CHECKSUM_PARTIAL
> should be safe (skb_checksum_help).

We don't call helpers in LOCAL_OUT, how can this happen?

> 
> Signed-off-by: Julian Anastasov <ja@xxxxxx>
> ---
> 
> diff -urp v2.6.39/linux/net/ipv4/netfilter/nf_nat_helper.c linux/net/ipv4/netfilter/nf_nat_helper.c
> --- v2.6.39/linux/net/ipv4/netfilter/nf_nat_helper.c	2011-01-06 00:01:22.000000000 +0200
> +++ linux/net/ipv4/netfilter/nf_nat_helper.c	2011-05-29 23:14:40.166245897 +0300
> @@ -160,7 +160,7 @@ static void nf_nat_csum(struct sk_buff *
>  
>  	if (skb->ip_summed != CHECKSUM_PARTIAL) {
>  		if (!(rt->rt_flags & RTCF_LOCAL) &&
> -		    skb->dev->features & NETIF_F_V4_CSUM) {
> +		    (!skb->dev || skb->dev->features & NETIF_F_V4_CSUM)) {
>  			skb->ip_summed = CHECKSUM_PARTIAL;
>  			skb->csum_start = skb_headroom(skb) +
>  					  skb_network_offset(skb) +
> 

--
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