<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/crypto/stm32, branch v5.9.12</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.9.12</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.9.12'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2020-10-29T09:11:08+00:00</updated>
<entry>
<title>crypto: stm32/crc32 - Avoid lock if hardware is already used</title>
<updated>2020-10-29T09:11:08+00:00</updated>
<author>
<name>Nicolas Toromanoff</name>
<email>nicolas.toromanoff@st.com</email>
</author>
<published>2020-09-16T06:33:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=112fafd236a686635dd627e1ea69939c207972a0'/>
<id>urn:sha1:112fafd236a686635dd627e1ea69939c207972a0</id>
<content type='text'>
[ Upstream commit bbf2cb1ea1e1428589d7f4d652bed15b265ce92d ]

If STM32 CRC device is already in use, calculate CRC by software.

This will release CPU constraint for a concurrent access to the
hardware, and avoid masking irqs during the whole block processing.

Fixes: 7795c0baf5ac ("crypto: stm32/crc32 - protect from concurrent accesses")

Signed-off-by: Nicolas Toromanoff &lt;nicolas.toromanoff@st.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>crypto: stm32/crc32 - protect from concurrent accesses</title>
<updated>2020-05-22T14:08:21+00:00</updated>
<author>
<name>Nicolas Toromanoff</name>
<email>nicolas.toromanoff@st.com</email>
</author>
<published>2020-05-12T14:11:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7795c0baf5ac25e104fec8677ad134066a8fb8d3'/>
<id>urn:sha1:7795c0baf5ac25e104fec8677ad134066a8fb8d3</id>
<content type='text'>
Protect STM32 CRC device from concurrent accesses.

As we create a spinlocked section that increase with buffer size,
we provide a module parameter to release the pressure by splitting
critical section in chunks.

Size of each chunk is defined in burst_size module parameter.
By default burst_size=0, i.e. don't split incoming buffer.

Signed-off-by: Nicolas Toromanoff &lt;nicolas.toromanoff@st.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: stm32/crc32 - don't sleep in runtime pm</title>
<updated>2020-05-22T14:08:21+00:00</updated>
<author>
<name>Nicolas Toromanoff</name>
<email>nicolas.toromanoff@st.com</email>
</author>
<published>2020-05-12T14:11:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=100f84beee4874234d04a1ea642b8c9738d7020d'/>
<id>urn:sha1:100f84beee4874234d04a1ea642b8c9738d7020d</id>
<content type='text'>
Ensure stm32_crc_update() and stm32_crc_init() can be called
in atomic context and can't sleep.

Add pm_runtime_irq_safe() to make pm_runtime_get_sync() atomic.
Change runtime pm to call clk_enable()/clk_disable() and change
system pm to unprepare/prepare the clock and force runtime pm
suspend/resume.

Signed-off-by: Nicolas Toromanoff &lt;nicolas.toromanoff@st.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: stm32/crc32 - fix multi-instance</title>
<updated>2020-05-22T14:08:20+00:00</updated>
<author>
<name>Nicolas Toromanoff</name>
<email>nicolas.toromanoff@st.com</email>
</author>
<published>2020-05-12T14:11:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=10b89c43a64eb0d236903b79a3bc9d8f6cbfd9c7'/>
<id>urn:sha1:10b89c43a64eb0d236903b79a3bc9d8f6cbfd9c7</id>
<content type='text'>
Ensure CRC algorithm is registered only once in crypto framework when
there are several instances of CRC devices.

Update the CRC device list management to avoid that only the first CRC
instance is used.

Fixes: b51dbe90912a ("crypto: stm32 - Support for STM32 CRC32 crypto module")

Signed-off-by: Nicolas Toromanoff &lt;nicolas.toromanoff@st.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: stm32/crc32 - fix run-time self test issue.</title>
<updated>2020-05-22T14:08:20+00:00</updated>
<author>
<name>Nicolas Toromanoff</name>
<email>nicolas.toromanoff@st.com</email>
</author>
<published>2020-05-12T14:11:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a8cc3128bf2c01c4d448fe17149e87132113b445'/>
<id>urn:sha1:a8cc3128bf2c01c4d448fe17149e87132113b445</id>
<content type='text'>
Fix wrong crc32 initialisation value:
"alg: shash: stm32_crc32 test failed (wrong result) on test vector 0,
cfg="init+update+final aligned buffer"
cra_name="crc32c" expects an init value of 0XFFFFFFFF,
cra_name="crc32" expects an init value of 0.

Fixes: b51dbe90912a ("crypto: stm32 - Support for STM32 CRC32 crypto module")

Signed-off-by: Nicolas Toromanoff &lt;nicolas.toromanoff@st.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: stm32/crc32 - fix ext4 chksum BUG_ON()</title>
<updated>2020-05-22T14:08:20+00:00</updated>
<author>
<name>Nicolas Toromanoff</name>
<email>nicolas.toromanoff@st.com</email>
</author>
<published>2020-05-12T14:11:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=49c2c082e00e0bc4f5cbb7c21c7f0f873b35ab09'/>
<id>urn:sha1:49c2c082e00e0bc4f5cbb7c21c7f0f873b35ab09</id>
<content type='text'>
Allow use of crc_update without prior call to crc_init.
And change (and fix) driver to use CRC device even on unaligned buffers.

Fixes: b51dbe90912a ("crypto: stm32 - Support for STM32 CRC32 crypto module")

Signed-off-by: Nicolas Toromanoff &lt;nicolas.toromanoff@st.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: stm32/hash - don't print error on probe deferral</title>
<updated>2020-05-08T05:30:39+00:00</updated>
<author>
<name>Lionel Debieve</name>
<email>lionel.debieve@st.com</email>
</author>
<published>2020-04-27T06:42:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=79cd691f609c3f5b9603063099502b70ab32ae87'/>
<id>urn:sha1:79cd691f609c3f5b9603063099502b70ab32ae87</id>
<content type='text'>
Change driver to not print an error message when the device
probe is deferred for a clock resource.

Signed-off-by: Lionel Debieve &lt;lionel.debieve@st.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: stm32/hash - defer probe for dma device</title>
<updated>2020-05-08T05:30:39+00:00</updated>
<author>
<name>Etienne Carriere</name>
<email>etienne.carriere@st.com</email>
</author>
<published>2020-04-27T06:42:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=45dafed6c5ecd01400766ce99a49b2d8ad351ce6'/>
<id>urn:sha1:45dafed6c5ecd01400766ce99a49b2d8ad351ce6</id>
<content type='text'>
Change stm32 HASH driver to defer its probe operation when
DMA channel device is registered but has not been probed yet.

Signed-off-by: Etienne Carriere &lt;etienne.carriere@st.com&gt;
Reviewed-by: Lionel DEBIEVE &lt;lionel.debieve@st.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: stm32/hash - defer probe for reset controller</title>
<updated>2020-05-08T05:30:39+00:00</updated>
<author>
<name>Etienne Carriere</name>
<email>etienne.carriere@st.com</email>
</author>
<published>2020-04-27T06:42:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=43b05ce76733164e1c1b33ab16eda14130646c96'/>
<id>urn:sha1:43b05ce76733164e1c1b33ab16eda14130646c96</id>
<content type='text'>
Change stm32 HASH driver to defer its probe operation when
reset controller device is registered but has not been probed yet.

Signed-off-by: Etienne Carriere &lt;etienne.carriere@st.com&gt;
Reviewed-by: Lionel DEBIEVE &lt;lionel.debieve@st.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN</title>
<updated>2020-01-09T03:30:53+00:00</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2019-12-31T03:19:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=674f368a952c48ede71784935a799a5205b92b6c'/>
<id>urn:sha1:674f368a952c48ede71784935a799a5205b92b6c</id>
<content type='text'>
The CRYPTO_TFM_RES_BAD_KEY_LEN flag was apparently meant as a way to
make the -&gt;setkey() functions provide more information about errors.

However, no one actually checks for this flag, which makes it pointless.

Also, many algorithms fail to set this flag when given a bad length key.
Reviewing just the generic implementations, this is the case for
aes-fixed-time, cbcmac, echainiv, nhpoly1305, pcrypt, rfc3686, rfc4309,
rfc7539, rfc7539esp, salsa20, seqiv, and xcbc.  But there are probably
many more in arch/*/crypto/ and drivers/crypto/.

Some algorithms can even set this flag when the key is the correct
length.  For example, authenc and authencesn set it when the key payload
is malformed in any way (not just a bad length), the atmel-sha and ccree
drivers can set it if a memory allocation fails, and the chelsio driver
sets it for bad auth tag lengths, not just bad key lengths.

So even if someone actually wanted to start checking this flag (which
seems unlikely, since it's been unused for a long time), there would be
a lot of work needed to get it working correctly.  But it would probably
be much better to go back to the drawing board and just define different
return values, like -EINVAL if the key is invalid for the algorithm vs.
-EKEYREJECTED if the key was rejected by a policy like "no weak keys".
That would be much simpler, less error-prone, and easier to test.

So just remove this flag.

Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Reviewed-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
</feed>
