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


Groups > linux.kernel > #1540643

[PATCH] wusbcore: Fix one more crypto-on-the-stack bug

From Andy Lutomirski <luto@kernel.org>
Newsgroups linux.kernel
Subject [PATCH] wusbcore: Fix one more crypto-on-the-stack bug
Date 2016-12-12 22:00 +0100
Message-ID <sNFRv-yr-13@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


The driver put a constant buffer of all zeros on the stack and
pointed a scatterlist entry at it.  This doesn't work with virtual
stacks.  Make the buffer static to fix it.

Cc: stable@vger.kernel.org # 4.9 only
Reported-by: Eric Biggers <ebiggers3@gmail.com>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
 drivers/usb/wusbcore/crypto.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/wusbcore/crypto.c b/drivers/usb/wusbcore/crypto.c
index 79451f7ef1b7..a7e007a0cd49 100644
--- a/drivers/usb/wusbcore/crypto.c
+++ b/drivers/usb/wusbcore/crypto.c
@@ -216,7 +216,7 @@ static int wusb_ccm_mac(struct crypto_skcipher *tfm_cbc,
 	struct scatterlist sg[4], sg_dst;
 	void *dst_buf;
 	size_t dst_size;
-	const u8 bzero[16] = { 0 };
+	static const u8 bzero[16] = { 0 };
 	u8 iv[crypto_skcipher_ivsize(tfm_cbc)];
 	size_t zero_padding;
 
-- 
2.9.3

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] wusbcore: Fix one more crypto-on-the-stack bug Andy Lutomirski <luto@kernel.org> - 2016-12-12 22:00 +0100
  [PATCH] keys/encrypted: Fix two crypto-on-the-stack bugs Andy Lutomirski <luto@kernel.org> - 2016-12-12 22:00 +0100
    Re: [PATCH] keys/encrypted: Fix two crypto-on-the-stack bugs David Howells <dhowells@redhat.com> - 2016-12-12 23:30 +0100
      Re: [PATCH] keys/encrypted: Fix two crypto-on-the-stack bugs Andy Lutomirski <luto@kernel.org> - 2016-12-13 01:40 +0100
    RE: [PATCH] keys/encrypted: Fix two crypto-on-the-stack bugs David Laight <David.Laight@ACULAB.COM> - 2016-12-13 13:50 +0100
      Re: [PATCH] keys/encrypted: Fix two crypto-on-the-stack bugs David Howells <dhowells@redhat.com> - 2016-12-13 17:50 +0100
        Re: [PATCH] keys/encrypted: Fix two crypto-on-the-stack bugs Andy Lutomirski <luto@amacapital.net> - 2016-12-13 18:10 +0100
          Re: [PATCH] keys/encrypted: Fix two crypto-on-the-stack bugs David Howells <dhowells@redhat.com> - 2016-12-13 21:20 +0100
      Re: [PATCH] keys/encrypted: Fix two crypto-on-the-stack bugs Andy Lutomirski <luto@amacapital.net> - 2016-12-13 17:50 +0100
        Re: [PATCH] keys/encrypted: Fix two crypto-on-the-stack bugs Joerg Roedel <joro@8bytes.org> - 2016-12-14 18:00 +0100
  [PATCH] crypto: Make a few drivers depend on !VMAP_STACK Andy Lutomirski <luto@kernel.org> - 2016-12-12 22:00 +0100
    Re: [PATCH] crypto: Make a few drivers depend on !VMAP_STACK Herbert Xu <herbert@gondor.apana.org.au> - 2016-12-13 04:50 +0100
  [PATCH] orinoco: Use shash instead of ahash for MIC calculations Andy Lutomirski <luto@kernel.org> - 2016-12-12 22:00 +0100
    Re: [PATCH] orinoco: Use shash instead of ahash for MIC calculations Eric Biggers <ebiggers3@gmail.com> - 2016-12-13 09:00 +0100
    Re: [PATCH] orinoco: Use shash instead of ahash for MIC calculations Kalle Valo <kvalo@codeaurora.org> - 2016-12-13 12:40 +0100
      Re: [PATCH] orinoco: Use shash instead of ahash for MIC calculations Andy Lutomirski <luto@amacapital.net> - 2016-12-13 17:50 +0100
        Re: [PATCH] orinoco: Use shash instead of ahash for MIC calculations Kalle Valo <kvalo@codeaurora.org> - 2016-12-13 18:10 +0100
    Re: orinoco: Use shash instead of ahash for MIC calculations Kalle Valo <kvalo@codeaurora.org> - 2016-12-30 12:40 +0100
      Re: orinoco: Use shash instead of ahash for MIC calculations Kalle Valo <kvalo@codeaurora.org> - 2016-12-30 13:10 +0100
        Re: orinoco: Use shash instead of ahash for MIC calculations Kalle Valo <kvalo@adurom.com> - 2016-12-30 13:50 +0100
  Re: [PATCH] wusbcore: Fix one more crypto-on-the-stack bug Greg KH <gregkh@linuxfoundation.org> - 2016-12-12 22:50 +0100
    Re: [PATCH] wusbcore: Fix one more crypto-on-the-stack bug Andy Lutomirski <luto@amacapital.net> - 2016-12-13 01:00 +0100

csiph-web