diff options
Diffstat (limited to 'net/ipv4/esp4.c')
| -rw-r--r-- | net/ipv4/esp4.c | 5 | 
1 files changed, 2 insertions, 3 deletions
| diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c index 70e6c87fbe3d..d747166bb291 100644 --- a/net/ipv4/esp4.c +++ b/net/ipv4/esp4.c @@ -446,7 +446,6 @@ int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *  	struct page *page;  	struct sk_buff *trailer;  	int tailen = esp->tailen; -	unsigned int allocsz;  	/* this is non-NULL only with TCP/UDP Encapsulation */  	if (x->encap) { @@ -456,8 +455,8 @@ int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *  			return err;  	} -	allocsz = ALIGN(skb->data_len + tailen, L1_CACHE_BYTES); -	if (allocsz > ESP_SKB_FRAG_MAXSIZE) +	if (ALIGN(tailen, L1_CACHE_BYTES) > PAGE_SIZE || +	    ALIGN(skb->data_len, L1_CACHE_BYTES) > PAGE_SIZE)  		goto cow;  	if (!skb_cloned(skb)) { | 
