From: David Miller <davem@davemloft.net>
To: ebiggers3@gmail.com
Cc: linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au,
linux-kernel@vger.kernel.org, dvyukov@google.com,
syzkaller@googlegroups.com, ebiggers@google.com,
stable@vger.kernel.org
Subject: Re: [PATCH] crypto: xts,lrw - fix out-of-bounds write after kmalloc failure
Date: Thu, 23 Mar 2017 14:05:14 -0700 (PDT) [thread overview]
Message-ID: <20170323.140514.85099184426140784.davem@davemloft.net> (raw)
In-Reply-To: <20170323203946.11242-1-ebiggers3@gmail.com>
From: Eric Biggers <ebiggers3@gmail.com>
Date: Thu, 23 Mar 2017 13:39:46 -0700
> From: Eric Biggers <ebiggers@google.com>
>
> In the generic XTS and LRW algorithms, for input data > 128 bytes, a
> temporary buffer is allocated to hold the values to be XOR'ed with the
> data before and after encryption or decryption. If the allocation
> fails, the fixed-size buffer embedded in the request buffer is meant to
> be used as a fallback --- resulting in more calls to the ECB algorithm,
> but still producing the correct result. However, we weren't correctly
> limiting subreq->cryptlen in this case, resulting in pre_crypt()
> overrunning the embedded buffer. Fix this by setting subreq->cryptlen
> correctly.
>
> Fixes: f1c131b45410 ("crypto: xts - Convert to skcipher")
> Fixes: 700cb3f5fe75 ("crypto: lrw - Convert to skcipher")
> Cc: stable@vger.kernel.org # v4.10+
> Reported-by: Dmitry Vyukov <dvyukov@google.com>
> Signed-off-by: Eric Biggers <ebiggers@google.com>
Acked-by: David S. Miller <davem@davemloft.net>
next prev parent reply other threads:[~2017-03-23 21:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-23 10:51 crypto: out-of-bounds write in pre_crypt Dmitry Vyukov
2017-03-23 20:39 ` Eric Biggers
2017-03-23 20:39 ` [PATCH] crypto: xts,lrw - fix out-of-bounds write after kmalloc failure Eric Biggers
2017-03-23 21:05 ` David Miller [this message]
2017-03-24 14:15 ` 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=20170323.140514.85099184426140784.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=dvyukov@google.com \
--cc=ebiggers3@gmail.com \
--cc=ebiggers@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=syzkaller@googlegroups.com \
/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;
as well as URLs for NNTP newsgroup(s).