mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tom Lendacky <thomas.lendacky@amd.com>
To: <davem@davemloft.net>, <linux-crytpo@vger.kernel.org>,
	<herbert@gondor.hengli.com.au>
Cc: <linux-kernel@vger.kernel.org>
Subject: [PATCH 02/10] crypto: scatterwalk - Set the chain pointer indication bit
Date: Tue, 12 Nov 2013 11:39:12 -0600	[thread overview]
Message-ID: <20131112173912.18862.13846.stgit@tlendack-t1.amdoffice.net> (raw)
In-Reply-To: <20131112173900.18862.68623.stgit@tlendack-t1.amdoffice.net>

The scatterwalk_crypto_chain function invokes the scatterwalk_sg_chain
function to chain two scatterlists, but the chain pointer indication
bit is not set.  When the resulting scatterlist is used, for example,
by sg_nents to count the number of scatterlist entries, a segfault occurs
because sg_nents does not follow the chain pointer to the chained scatterlist.

Update scatterwalk_sg_chain to set the chain pointer indication bit as is
done by the sg_chain function.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
---
 include/crypto/scatterwalk.h |    1 +
 1 file changed, 1 insertion(+)

diff --git a/include/crypto/scatterwalk.h b/include/crypto/scatterwalk.h
index 13621cc..64ebede 100644
--- a/include/crypto/scatterwalk.h
+++ b/include/crypto/scatterwalk.h
@@ -36,6 +36,7 @@ static inline void scatterwalk_sg_chain(struct scatterlist *sg1, int num,
 {
 	sg_set_page(&sg1[num - 1], (void *)sg2, 0, 0);
 	sg1[num - 1].page_link &= ~0x02;
+	sg1[num - 1].page_link |= 0x01;
 }
 
 static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg)



  parent reply	other threads:[~2013-11-12 17:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-12 17:39 [PATCH 00/10] AMD Cryptographic Coprocessor support Tom Lendacky
2013-11-12 17:39 ` [PATCH 01/10] crypto: authenc - Find proper IV address in ablkcipher callback Tom Lendacky
2013-11-12 17:39 ` Tom Lendacky [this message]
2013-11-12 17:39 ` [PATCH 03/10] crypto: CCP device driver and interface support Tom Lendacky
2013-11-12 17:39 ` [PATCH 04/10] crypto: crypto API interface to the CCP device driver Tom Lendacky
2013-11-12 17:39 ` [PATCH 05/10] crypto: CCP AES crypto API support Tom Lendacky
2013-11-12 17:39 ` [PATCH 06/10] crypto: CCP AES CMAC mode " Tom Lendacky
2013-11-12 17:39 ` [PATCH 07/10] crypto: CCP XTS-AES " Tom Lendacky
2013-11-12 17:39 ` [PATCH 08/10] crypto: CCP SHA " Tom Lendacky
2013-11-12 17:39 ` [PATCH 09/10] crytpo: CCP device driver build files Tom Lendacky
2013-11-12 17:39 ` [PATCH 10/10] crypto: CCP maintainer information Tom Lendacky
2013-11-12 17:45 [PATCH 00/10] AMD Cryptographic Coprocessor support Tom Lendacky
2013-11-12 17:46 ` [PATCH 02/10] crypto: scatterwalk - Set the chain pointer indication bit Tom Lendacky
2013-11-28 14:21   ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131112173912.18862.13846.stgit@tlendack-t1.amdoffice.net \
    --to=thomas.lendacky@amd.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.hengli.com.au \
    --cc=linux-crytpo@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®