<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/crypto/ahash.c, branch linux-4.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.1.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.1.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-05-23T01:33:57Z</updated>
<entry>
<title>crypto: ahash - Fix early termination in hash walk</title>
<updated>2018-05-23T01:33:57Z</updated>
<author>
<name>Herbert Xu</name>
</author>
<published>2018-03-26T00:53:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6e4e9aa776470baf9505a9df5bf4b1c2153aef5d'/>
<id>urn:sha1:6e4e9aa776470baf9505a9df5bf4b1c2153aef5d</id>
<content type='text'>
[ Upstream commit 900a081f6912a8985dc15380ec912752cb66025a ]

When we have an unaligned SG list entry where there is no leftover
aligned data, the hash walk code will incorrectly return zero as if
the entire SG list has been processed.

This patch fixes it by moving onto the next page instead.

Reported-by: Eli Cooper &lt;elicooper@gmx.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
</content>
</entry>
<entry>
<title>crypto: hash - introduce crypto_hash_alg_has_setkey()</title>
<updated>2018-03-01T03:09:51Z</updated>
<author>
<name>Eric Biggers</name>
</author>
<published>2018-01-03T19:16:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=524e9a929b5d1e0396216e9ec64dc7fb3560f050'/>
<id>urn:sha1:524e9a929b5d1e0396216e9ec64dc7fb3560f050</id>
<content type='text'>
[ Upstream commit cd6ed77ad5d223dc6299fb58f62e0f5267f7e2ba ]

Templates that use an shash spawn can use crypto_shash_alg_has_setkey()
to determine whether the underlying algorithm requires a key or not.
But there was no corresponding function for ahash spawns.  Add it.

Note that the new function actually has to support both shash and ahash
algorithms, since the ahash API can be used with either.

Cc: stable@vger.kernel.org
Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
</content>
</entry>
<entry>
<title>crypto: ahash - Fix EINPROGRESS notification callback</title>
<updated>2017-05-17T19:08:22Z</updated>
<author>
<name>Herbert Xu</name>
</author>
<published>2017-04-10T09:27:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ce0e21e44f9766aeef6a8c18a750ef9d94c1ca8c'/>
<id>urn:sha1:ce0e21e44f9766aeef6a8c18a750ef9d94c1ca8c</id>
<content type='text'>
[ Upstream commit ef0579b64e93188710d48667cb5e014926af9f1b ]

The ahash API modifies the request's callback function in order
to clean up after itself in some corner cases (unaligned final
and missing finup).

When the request is complete ahash will restore the original
callback and everything is fine.  However, when the request gets
an EBUSY on a full queue, an EINPROGRESS callback is made while
the request is still ongoing.

In this case the ahash API will incorrectly call its own callback.

This patch fixes the problem by creating a temporary request
object on the stack which is used to relay EINPROGRESS back to
the original completion function.

This patch also adds code to preserve the original flags value.

Fixes: ab6bf4e5e5e4 ("crypto: hash - Fix the pointer voodoo in...")
Cc: &lt;stable@vger.kernel.org&gt;
Reported-by: Sabrina Dubroca &lt;sd@queasysnail.net&gt;
Tested-by: Sabrina Dubroca &lt;sd@queasysnail.net&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
</entry>
<entry>
<title>crypto: hash - Fix page length clamping in hash walk</title>
<updated>2016-05-17T17:42:59Z</updated>
<author>
<name>Herbert Xu</name>
</author>
<published>2016-05-04T09:52:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1669540814a1cf57ff50e037c5bf84f831ea4e09'/>
<id>urn:sha1:1669540814a1cf57ff50e037c5bf84f831ea4e09</id>
<content type='text'>
[ Upstream commit 13f4bb78cf6a312bbdec367ba3da044b09bf0e29 ]

The crypto hash walk code is broken when supplied with an offset
greater than or equal to PAGE_SIZE.  This patch fixes it by adjusting
walk-&gt;pg and walk-&gt;offset when this happens.

Cc: &lt;stable@vger.kernel.org&gt;
Reported-by: Steffen Klassert &lt;steffen.klassert@secunet.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>crypto: hash - Add crypto_ahash_has_setkey</title>
<updated>2016-02-03T21:23:18Z</updated>
<author>
<name>Herbert Xu</name>
</author>
<published>2016-01-08T13:28:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c409087e6db988257adffb614616764116c7337e'/>
<id>urn:sha1:c409087e6db988257adffb614616764116c7337e</id>
<content type='text'>
[ Upstream commit a5596d6332787fd383b3b5427b41f94254430827 ]

This patch adds a way for ahash users to determine whether a key
is required by a crypto_ahash transform.

Cc: stable@vger.kernel.org
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>crypto: ahash - ensure statesize is non-zero</title>
<updated>2015-10-27T00:51:53Z</updated>
<author>
<name>Russell King</name>
</author>
<published>2015-10-09T19:43:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3ae2c7951214fd5926101e817432feabb7f72feb'/>
<id>urn:sha1:3ae2c7951214fd5926101e817432feabb7f72feb</id>
<content type='text'>
commit 8996eafdcbad149ac0f772fb1649fbb75c482a6a upstream.

Unlike shash algorithms, ahash drivers must implement export
and import as their descriptors may contain hardware state and
cannot be exported as is.  Unfortunately some ahash drivers did
not provide them and end up causing crashes with algif_hash.

This patch adds a check to prevent these drivers from registering
ahash algorithms until they are fixed.

Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&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: replace scatterwalk_sg_next with sg_next</title>
<updated>2015-01-26T00:34:22Z</updated>
<author>
<name>Cristian Stoica</name>
</author>
<published>2015-01-20T08:06:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5be4d4c94b1f98b839344fda7a8752a4a09d0ef5'/>
<id>urn:sha1:5be4d4c94b1f98b839344fda7a8752a4a09d0ef5</id>
<content type='text'>
Modify crypto drivers to use the generic SG helper since
both of them are equivalent and the one from crypto is redundant.

See also:
  468577abe37ff7b453a9ac613e0ea155349203ae   reverted in
  b2ab4a57b018aafbba35bff088218f5cc3d2142e

Signed-off-by: Cristian Stoica &lt;cristian.stoica@freescale.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: ahash - fixed style error in ahash.c</title>
<updated>2014-12-22T12:02:36Z</updated>
<author>
<name>Joshua I. James</name>
</author>
<published>2014-12-05T05:44:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b516d514020f17c83267f76366691e4cc9b7bddf'/>
<id>urn:sha1:b516d514020f17c83267f76366691e4cc9b7bddf</id>
<content type='text'>
Fixed style error identified by checkpatch.

WARNING: Missing a blank line after declarations
+               unsigned int unaligned = alignmask + 1 - (offset &amp; alignmask);
+               if (nbytes &gt; unaligned)

Signed-off-by: Joshua I. James &lt;joshua@cybercrimetech.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: hash - initialize entry len for null input in crypto hash sg list walk</title>
<updated>2014-08-25T12:27:16Z</updated>
<author>
<name>Tim Chen</name>
</author>
<published>2014-07-10T23:18:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6d9529c586dbf0d356916d113f72f36397e71cdb'/>
<id>urn:sha1:6d9529c586dbf0d356916d113f72f36397e71cdb</id>
<content type='text'>
For the special case when we have a null input string, we want
to initialize the entry len to 0 for the hash/ahash walk, so
cyrpto_hash_walk_last will return the correct result indicating
that we have completed the scatter list walk.  Otherwise we may
keep walking the sg list and access bogus memory address.

Signed-off-by: Tim Chen &lt;tim.c.chen@linux.intel.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: hash - Add real ahash walk interface</title>
<updated>2014-05-21T12:56:12Z</updated>
<author>
<name>Herbert Xu</name>
</author>
<published>2014-05-21T12:56:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=75ecb231ff45b54afa9f4ec9137965c3c00868f4'/>
<id>urn:sha1:75ecb231ff45b54afa9f4ec9137965c3c00868f4</id>
<content type='text'>
Although the existing hash walk interface has already been used
by a number of ahash crypto drivers, it turns out that none of
them were really asynchronous.  They were all essentially polling
for completion.

That's why nobody has noticed until now that the walk interface
couldn't work with a real asynchronous driver since the memory
is mapped using kmap_atomic.

As we now have a use-case for a real ahash implementation on x86,
this patch creates a minimal ahash walk interface.  Basically it
just calls kmap instead of kmap_atomic and does away with the
crypto_yield call.  Real ahash crypto drivers don't need to yield
since by definition they won't be hogging the CPU.

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