Patch "ipsec: check return value of skb_to_sgvec always" has been added to the 3.18-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
ipsec: check return value of skb_to_sgvec always
to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
ipsec-check-return-value-of-skb_to_sgvec-always.patch
and it can be found in the queue-3.18 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
3f29770723fe498a5c5f57c3a31a996ebdde03e1Mon Sep 17 00:00:00 2001
From: "Jason A. Donenfeld" <[email protected]>
Date: Sun, 4 Jun 2017 04:16:23 +0200
Subject: ipsec: check return value of skb_to_sgvec always
From: Jason A. Donenfeld <[email protected]>
commit 3f29770723fe498a5c5f57c3a31a996ebdde03e1 upstream.
--- net/ipv4/ah4.c | 8 ++++++-- net/ipv4/esp4.c | 12 ++++++++---- net/ipv6/ah6.c | 8 ++++++-- net/ipv6/esp6.c | 12 ++++++++---- 4 files changed, 28 insertions(+), 12 deletions(-)
net/ipv4/ah4.c +6 -2
@@ -220,7 +220,9 @@ static int ah_output(struct xfrm_state * ah->seq_no =htonl (XFRM_SKB_CB (skb)->seq.output.low);sg_init_table (sg, nfrags + sglists); -skb_to_sgvec_nomark (skb, sg,0 , skb->len); + err =skb_to_sgvec_nomark (skb, sg,0 , skb->len); +if (unlikely (err <0 )) + goto out_free;if (x->props.flags &XFRM_STATE_ESN ) {/* Attach seqhi sg right after packet payload */
@@ -391,7 +393,9 @@ static int ah_input(struct xfrm_state *xskb_push (skb, ihl);sg_init_table (sg, nfrags + sglists); -skb_to_sgvec_nomark (skb, sg,0 , skb->len); + err =skb_to_sgvec_nomark (skb, sg,0 , skb->len); +if (unlikely (err <0 )) + goto out_free;if (x->props.flags &XFRM_STATE_ESN ) {/* Attach seqhi sg right after packet payload */
net/ipv4/esp4.c +8 -4
@@ -239,9 +239,11 @@ static int esp_output(struct xfrm_state esph->seq_no =htonl (XFRM_SKB_CB (skb)->seq.output.low);sg_init_table (sg, nfrags); -skb_to_sgvec (skb, sg, - esph->enc_data +crypto_aead_ivsize (aead) - skb->data, - clen + alen); + err =skb_to_sgvec (skb, sg, + esph->enc_data +crypto_aead_ivsize (aead) - skb->data, + clen + alen); +if (unlikely (err <0 )) + goto error;if ((x->props.flags &XFRM_STATE_ESN )) {sg_init_table (asg,3 );
@@ -426,7 +428,9 @@ static int esp_input(struct xfrm_state * iv = esph->enc_data;sg_init_table (sg, nfrags); -skb_to_sgvec (skb, sg,sizeof (*esph) +crypto_aead_ivsize (aead), elen); + err =skb_to_sgvec (skb, sg,sizeof (*esph) +crypto_aead_ivsize (aead), elen); +if (unlikely (err <0 )) + goto out;if ((x->props.flags &XFRM_STATE_ESN )) {sg_init_table (asg,3 );
net/ipv6/ah6.c +6 -2
@@ -423,7 +423,9 @@ static int ah6_output(struct xfrm_state ah->seq_no =htonl (XFRM_SKB_CB (skb)->seq.output.low);sg_init_table (sg, nfrags + sglists); -skb_to_sgvec_nomark (skb, sg,0 , skb->len); + err =skb_to_sgvec_nomark (skb, sg,0 , skb->len); +if (unlikely (err <0 )) + goto out_free;if (x->props.flags &XFRM_STATE_ESN ) {/* Attach seqhi sg right after packet payload */
@@ -601,7 +603,9 @@ static int ah6_input(struct xfrm_state * ip6h->hop_limit =0 ;sg_init_table (sg, nfrags + sglists); -skb_to_sgvec_nomark (skb, sg,0 , skb->len); + err =skb_to_sgvec_nomark (skb, sg,0 , skb->len); +if (unlikely (err <0 )) + goto out_free;if (x->props.flags &XFRM_STATE_ESN ) {/* Attach seqhi sg right after packet payload */
net/ipv6/esp6.c +8 -4
@@ -231,9 +231,11 @@ static int esp6_output(struct xfrm_state esph->seq_no =htonl (XFRM_SKB_CB (skb)->seq.output.low);sg_init_table (sg, nfrags); -skb_to_sgvec (skb, sg, - esph->enc_data +crypto_aead_ivsize (aead) - skb->data, - clen + alen); + err =skb_to_sgvec (skb, sg, + esph->enc_data +crypto_aead_ivsize (aead) - skb->data, + clen + alen); +if (unlikely (err <0 )) + goto error;if ((x->props.flags &XFRM_STATE_ESN )) {sg_init_table (asg,3 );
@@ -381,7 +383,9 @@ static int esp6_input(struct xfrm_state iv = esph->enc_data;sg_init_table (sg, nfrags); -skb_to_sgvec (skb, sg,sizeof (*esph) +crypto_aead_ivsize (aead), elen); + ret =skb_to_sgvec (skb, sg,sizeof (*esph) +crypto_aead_ivsize (aead), elen); +if (unlikely (ret <0 )) + goto out;if ((x->props.flags &XFRM_STATE_ESN )) {sg_init_table (asg,3 );
Patches currently in stable-queue which might be from [email protected] are
queue-3.18/ipsec-check-return-value-of-skb_to_sgvec-always.patch queue-3.18/skbuff-return-emsgsize-in-skb_to_sgvec-to-prevent-overflow.patch queue-3.18/rxrpc-check-return-value-of-skb_to_sgvec-always.patch queue-3.18/virtio_net-check-return-value-of-skb_to_sgvec-always.patch queue-3.18/virtio_net-check-return-value-of-skb_to_sgvec-in-one-more-location.patch