Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1334006 > unrolled thread

[PATCH 4.4 099/117] crypto: algif_skcipher - sendmsg SG marking is off by one

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2016-02-15 01:30 +0100
Last post2016-02-15 01:30 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4.4 099/117] crypto: algif_skcipher - sendmsg SG marking is off by one Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:30 +0100

#1334006 — [PATCH 4.4 099/117] crypto: algif_skcipher - sendmsg SG marking is off by one

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2016-02-15 01:30 +0100
Subject[PATCH 4.4 099/117] crypto: algif_skcipher - sendmsg SG marking is off by one
Message-ID<r2fd9-1KG-57@gated-at.bofh.it>
4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Herbert Xu <herbert@gondor.apana.org.au>

commit 202736d99b7f29279db9da61587f11a08a04a9c6 upstream.

We mark the end of the SG list in sendmsg and sendpage and unmark
it on the next send call.  Unfortunately the unmarking in sendmsg
is off-by-one, leading to an SG list that is too short.

Fixes: 0f477b655a52 ("crypto: algif - Mark sgl end at the end of data")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 crypto/algif_skcipher.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/crypto/algif_skcipher.c
+++ b/crypto/algif_skcipher.c
@@ -392,7 +392,8 @@ static int skcipher_sendmsg(struct socke
 
 		sgl = list_entry(ctx->tsgl.prev, struct skcipher_sg_list, list);
 		sg = sgl->sg;
-		sg_unmark_end(sg + sgl->cur);
+		if (sgl->cur)
+			sg_unmark_end(sg + sgl->cur - 1);
 		do {
 			i = sgl->cur;
 			plen = min_t(int, len, PAGE_SIZE);

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web