<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/crypto/lrw.c, branch linux-4.14.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.14.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.14.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-05-20T06:17:11Z</updated>
<entry>
<title>gcc-10: avoid shadowing standard library 'free()' in crypto</title>
<updated>2020-05-20T06:17:11Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2020-05-09T22:58:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=778e0dad72eb7f9ff3728fa9d99df7768a111307'/>
<id>urn:sha1:778e0dad72eb7f9ff3728fa9d99df7768a111307</id>
<content type='text'>
commit 1a263ae60b04de959d9ce9caea4889385eefcc7b upstream.

gcc-10 has started warning about conflicting types for a few new
built-in functions, particularly 'free()'.

This results in warnings like:

   crypto/xts.c:325:13: warning: conflicting types for built-in function ‘free’; expected ‘void(void *)’ [-Wbuiltin-declaration-mismatch]

because the crypto layer had its local freeing functions called
'free()'.

Gcc-10 is in the wrong here, since that function is marked 'static', and
thus there is no chance of confusion with any standard library function
namespace.

But the simplest thing to do is to just use a different name here, and
avoid this gcc mis-feature.

[ Side note: gcc knowing about 'free()' is in itself not the
  mis-feature: the semantics of 'free()' are special enough that a
  compiler can validly do special things when seeing it.

  So the mis-feature here is that gcc thinks that 'free()' is some
  restricted name, and you can't shadow it as a local static function.

  Making the special 'free()' semantics be a function attribute rather
  than tied to the name would be the much better model ]

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>crypto: lrw - Fix out-of bounds access on counter overflow</title>
<updated>2018-11-13T19:15:07Z</updated>
<author>
<name>Ondrej Mosnacek</name>
</author>
<published>2018-09-13T08:51:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e86f4842f84a4494227aa4d1ab76acb68d86fb1a'/>
<id>urn:sha1:e86f4842f84a4494227aa4d1ab76acb68d86fb1a</id>
<content type='text'>
commit fbe1a850b3b1522e9fc22319ccbbcd2ab05328d2 upstream.

When the LRW block counter overflows, the current implementation returns
128 as the index to the precomputed multiplication table, which has 128
entries. This patch fixes it to return the correct value (127).

Fixes: 64470f1b8510 ("[CRYPTO] lrw: Liskov Rivest Wagner, a tweakable narrow block cipher mode")
Cc: &lt;stable@vger.kernel.org&gt; # 2.6.20+
Reported-by: Eric Biggers &lt;ebiggers@kernel.org&gt;
Signed-off-by: Ondrej Mosnacek &lt;omosnace@redhat.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>crypto: lrw - Free rctx-&gt;ext with kzfree</title>
<updated>2018-04-08T12:26:31Z</updated>
<author>
<name>Herbert Xu</name>
</author>
<published>2018-03-23T00:14:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=77827f3d63d0b12d840ed27b362f877e049dbbf5'/>
<id>urn:sha1:77827f3d63d0b12d840ed27b362f877e049dbbf5</id>
<content type='text'>
commit 8c9bdab21289c211ca1ca6a5f9b7537b4a600a02 upstream.

The buffer rctx-&gt;ext contains potentially sensitive data and should
be freed with kzfree.

Cc: &lt;stable@vger.kernel.org&gt;
Fixes: 700cb3f5fe75 ("crypto: lrw - Convert to skcipher")
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>crypto: lrw - Fix an error handling path in 'create()'</title>
<updated>2017-12-25T13:26:25Z</updated>
<author>
<name>Christophe Jaillet</name>
</author>
<published>2017-10-08T09:39:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bd5139895727bcf97a411bf17fc137fb0d57f55c'/>
<id>urn:sha1:bd5139895727bcf97a411bf17fc137fb0d57f55c</id>
<content type='text'>
[ Upstream commit 616129cc6e75fb4da6681c16c981fa82dfe5e4c7 ]

All error handling paths 'goto err_drop_spawn' except this one.
In order to avoid some resources leak, we should do it as well here.

Fixes: 700cb3f5fe75 ("crypto: lrw - Convert to skcipher")
Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>crypto: lrw - Fix use-after-free on EINPROGRESS</title>
<updated>2017-04-10T11:09:17Z</updated>
<author>
<name>Herbert Xu</name>
</author>
<published>2017-04-10T09:15:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4702bbeefb490e315189636a5588628c1151223d'/>
<id>urn:sha1:4702bbeefb490e315189636a5588628c1151223d</id>
<content type='text'>
When we get an EINPROGRESS completion in lrw, we will end up marking
the request as done and freeing it.  This then blows up when the
request is really completed as we've already freed the memory.

Fixes: 700cb3f5fe75 ("crypto: lrw - Convert to skcipher")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: xts,lrw - fix out-of-bounds write after kmalloc failure</title>
<updated>2017-03-24T13:51:34Z</updated>
<author>
<name>Eric Biggers</name>
</author>
<published>2017-03-23T20:39:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9df0eb180c2074451f25556eb566d89c7057c2ac'/>
<id>urn:sha1:9df0eb180c2074451f25556eb566d89c7057c2ac</id>
<content type='text'>
In the generic XTS and LRW algorithms, for input data &gt; 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-&gt;cryptlen in this case, resulting in pre_crypt()
overrunning the embedded buffer.  Fix this by setting subreq-&gt;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 &lt;dvyukov@google.com&gt;
Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: lrw - Convert to skcipher</title>
<updated>2016-11-28T13:23:17Z</updated>
<author>
<name>Herbert Xu</name>
</author>
<published>2016-11-22T12:08:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=700cb3f5fe755b1a2d0f5cf3ae89ad7ef69d321f'/>
<id>urn:sha1:700cb3f5fe755b1a2d0f5cf3ae89ad7ef69d321f</id>
<content type='text'>
This patch converts lrw over to the skcipher interface.  It also
optimises the implementation to be based on ECB instead of the
underlying cipher.  For compatibility the existing naming scheme
of lrw(aes) is maintained as opposed to the more obvious one of
lrw(ecb(aes)).

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: include crypto- module prefix in template</title>
<updated>2014-11-26T12:06:30Z</updated>
<author>
<name>Kees Cook</name>
</author>
<published>2014-11-25T00:32:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4943ba16bbc2db05115707b3ff7b4874e9e3c560'/>
<id>urn:sha1:4943ba16bbc2db05115707b3ff7b4874e9e3c560</id>
<content type='text'>
This adds the module loading prefix "crypto-" to the template lookup
as well.

For example, attempting to load 'vfat(blowfish)' via AF_ALG now correctly
includes the "crypto-" prefix at every level, correctly rejecting "vfat":

	net-pf-38
	algif-hash
	crypto-vfat(blowfish)
	crypto-vfat(blowfish)-all
	crypto-vfat

Reported-by: Mathias Krause &lt;minipli@googlemail.com&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Acked-by: Mathias Krause &lt;minipli@googlemail.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: lrw - add interface for parallelized cipher implementions</title>
<updated>2011-11-09T03:50:31Z</updated>
<author>
<name>Jussi Kivilinna</name>
</author>
<published>2011-11-09T03:50:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6c2205b8ffec035f4925b8ee84b7758afeee58b5'/>
<id>urn:sha1:6c2205b8ffec035f4925b8ee84b7758afeee58b5</id>
<content type='text'>
Export gf128mul table initialization routines and add lrw_crypt() function
that can be used by cipher implementations that can benefit from parallelized
cipher operations.

Signed-off-by: Jussi Kivilinna &lt;jussi.kivilinna@mbnet.fi&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: lrw - split gf128mul table initialization from setkey</title>
<updated>2011-11-09T03:43:01Z</updated>
<author>
<name>Jussi Kivilinna</name>
</author>
<published>2011-10-18T10:32:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=171c02048f50d7187991f251ddeed2d7e5de104f'/>
<id>urn:sha1:171c02048f50d7187991f251ddeed2d7e5de104f</id>
<content type='text'>
Split gf128mul initialization from setkey so that it can be used outside
lrw-module.

Signed-off-by: Jussi Kivilinna &lt;jussi.kivilinna@mbnet.fi&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
</feed>
