* [PATCH 1/2] dt-bindings: trivial-devices: add atmel,atecc608a
@ 2026-08-30 22:01 Thorsten Blum
2026-08-30 22:01 ` [PATCH 2/2] crypto: atmel-ecc - add support for atecc608a Thorsten Blum
2026-08-31 16:19 ` [PATCH 1/2] dt-bindings: trivial-devices: add atmel,atecc608a Conor Dooley
0 siblings, 2 replies; 4+ messages in thread
From: Thorsten Blum @ 2026-08-30 22:01 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Herbert Xu,
David S. Miller, Guenter Roeck, Wensheng Wang, Frank Li,
Cosmo Chou, Colin Huang, Nuno Sá, Antoni Pokusinski,
Eddie James, Dixit Parmar, Thorsten Blum
Cc: Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, devicetree,
linux-kernel, linux-crypto, linux-arm-kernel, Krzysztof Kozlowski,
Conor Dooley
Add an entry for ATECC608A.
Signed-off-by: Thorsten Blum <blum@kernel.org>
---
Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml
index 2de8eb09cb7d..3b7876c5a45d 100644
--- a/Documentation/devicetree/bindings/trivial-devices.yaml
+++ b/Documentation/devicetree/bindings/trivial-devices.yaml
@@ -69,6 +69,8 @@ properties:
- asteralabs,pt5161l
# ATECC508A - i2c h/w elliptic curve crypto module
- atmel,atecc508a
+ # ATECC608A - i2c h/w elliptic curve crypto module
+ - atmel,atecc608a
# ATECC608B - i2c h/w elliptic curve crypto module
- atmel,atecc608b
# ATSHA204 - i2c h/w symmetric crypto module
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] crypto: atmel-ecc - add support for atecc608a
2026-08-30 22:01 [PATCH 1/2] dt-bindings: trivial-devices: add atmel,atecc608a Thorsten Blum
@ 2026-08-30 22:01 ` Thorsten Blum
2026-08-30 22:10 ` sashiko-bot
2026-08-31 16:19 ` [PATCH 1/2] dt-bindings: trivial-devices: add atmel,atecc608a Conor Dooley
1 sibling, 1 reply; 4+ messages in thread
From: Thorsten Blum @ 2026-08-30 22:01 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Herbert Xu,
David S. Miller, Thorsten Blum, Nicolas Ferre, Alexandre Belloni,
Claudiu Beznea
Cc: Guenter Roeck, Wensheng Wang, Frank Li, Cosmo Chou, Colin Huang,
Nuno Sá, Dixit Parmar, Antoni Pokusinski, Eddie James,
devicetree, linux-kernel, linux-crypto, linux-arm-kernel
The driver already supports the ATECC508A and ATECC608B and uses only
commands shared by these devices.
Microchip documents the ATECC608B as a backwards-compatible, functional
drop-in replacement for the ATECC608A, with the same device structure
and command interface [1]. Therefore, add support for the ATECC608A.
ATECC608A hardware was not available for testing.
Signed-off-by: Thorsten Blum <blum@kernel.org>
Link: https://ww1.microchip.com/downloads/en/Appnotes/Migrating-from-the-ATECC608A-to-the-ATECC608B-DS40002237A.pdf [1]
---
drivers/crypto/atmel-ecc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/crypto/atmel-ecc.c b/drivers/crypto/atmel-ecc.c
index 075f38a67935..0904bb47fd0a 100644
--- a/drivers/crypto/atmel-ecc.c
+++ b/drivers/crypto/atmel-ecc.c
@@ -348,6 +348,7 @@ static void atmel_ecc_remove(struct i2c_client *client)
static const struct of_device_id atmel_ecc_dt_ids[] = {
{ .compatible = "atmel,atecc508a", },
+ { .compatible = "atmel,atecc608a", },
{ .compatible = "atmel,atecc608b", },
{ }
};
@@ -355,6 +356,7 @@ MODULE_DEVICE_TABLE(of, atmel_ecc_dt_ids);
static const struct i2c_device_id atmel_ecc_id[] = {
{ .name = "atecc508a" },
+ { .name = "atecc608a" },
{ .name = "atecc608b" },
{ }
};
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] crypto: atmel-ecc - add support for atecc608a
2026-08-30 22:01 ` [PATCH 2/2] crypto: atmel-ecc - add support for atecc608a Thorsten Blum
@ 2026-08-30 22:10 ` sashiko-bot
0 siblings, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-08-30 22:10 UTC (permalink / raw)
To: Thorsten Blum; +Cc: robh, conor+dt, devicetree
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Use-After-Free due to early return in `atmel_ecc_remove()` missing list deletion.
--
commit da00b1f7ab58791bf49d80087ba781e30c9433d0
Author: Thorsten Blum <blum@kernel.org>
crypto: atmel-ecc - add support for atecc608a
The driver already supports the ATECC508A and ATECC608B and uses only
commands shared by these devices.
Microchip documents the ATECC608B as a backwards-compatible, functional
drop-in replacement for the ATECC608A, with the same device structure
and command interface [1]. Therefore, add support for the ATECC608A.
ATECC608A hardware was not available for testing.
Link: https://ww1.microchip.com/downloads/en/Appnotes/Migrating-from-the-ATECC608A-to-the-ATECC608B-DS40002237A.pdf [1]
> diff --git a/drivers/crypto/atmel-ecc.c b/drivers/crypto/atmel-ecc.c
> index 075f38a67935c..0904bb47fd0a9 100644
> --- a/drivers/crypto/atmel-ecc.c
> +++ b/drivers/crypto/atmel-ecc.c
> @@ -348,6 +348,7 @@ static void atmel_ecc_remove(struct i2c_client *client)
[Severity: High]
This is a pre-existing issue, but can the early return in atmel_ecc_remove()
cause a use-after-free?
If a user unbinds the ATECC device via sysfs while a crypto operation is in
flight (tfm_count > 0):
drivers/crypto/atmel-ecc.c:atmel_ecc_remove() {
...
if (atomic_read(&i2c_priv->tfm_count)) {
dev_emerg(&client->dev, "Device is busy, expect memory corruption.\n");
return;
}
...
list_del(&i2c_priv->i2c_client_list_node);
...
}
The early return bypasses list_del(&i2c_priv->i2c_client_list_node). The
driver core then frees the devm_kmalloc-allocated i2c_priv, leaving a freed
node on the global driver_data.i2c_client_list.
The next time any crypto operation is requested, atmel_ecc_i2c_client_alloc()
will iterate over the list and access the freed i2c_priv node, causing a
use-after-free.
Does it make sense to always remove the node from the list before returning?
>
> static const struct of_device_id atmel_ecc_dt_ids[] = {
> { .compatible = "atmel,atecc508a", },
> + { .compatible = "atmel,atecc608a", },
> { .compatible = "atmel,atecc608b", },
> { }
> };
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260830220151.21469-3-blum@kernel.org?part=2
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] dt-bindings: trivial-devices: add atmel,atecc608a
2026-08-30 22:01 [PATCH 1/2] dt-bindings: trivial-devices: add atmel,atecc608a Thorsten Blum
2026-08-30 22:01 ` [PATCH 2/2] crypto: atmel-ecc - add support for atecc608a Thorsten Blum
@ 2026-08-31 16:19 ` Conor Dooley
1 sibling, 0 replies; 4+ messages in thread
From: Conor Dooley @ 2026-08-31 16:19 UTC (permalink / raw)
To: Thorsten Blum
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Herbert Xu,
David S. Miller, Guenter Roeck, Wensheng Wang, Frank Li,
Cosmo Chou, Colin Huang, Nuno Sá, Antoni Pokusinski,
Eddie James, Dixit Parmar, Nicolas Ferre, Alexandre Belloni,
Claudiu Beznea, devicetree, linux-kernel, linux-crypto,
linux-arm-kernel, Krzysztof Kozlowski, Conor Dooley
[-- Attachment #1: Type: text/plain, Size: 75 bytes --]
Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-08-31 16:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-30 22:01 [PATCH 1/2] dt-bindings: trivial-devices: add atmel,atecc608a Thorsten Blum
2026-08-30 22:01 ` [PATCH 2/2] crypto: atmel-ecc - add support for atecc608a Thorsten Blum
2026-08-30 22:10 ` sashiko-bot
2026-08-31 16:19 ` [PATCH 1/2] dt-bindings: trivial-devices: add atmel,atecc608a Conor Dooley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox