openwrt/target/linux
Kenneth Kasilag 1c590ed4b7 crypto: inside-secure/eip93: fix hmac setkey algo selection
eip93_hmac_setkey() allocates a temporary ahash transform for
computing HMAC ipad/opad key material. The allocation uses the
driver-specific cra_driver_name (e.g. "sha256-eip93") but passes
CRYPTO_ALG_ASYNC as the mask, which excludes async algorithms.

Since the EIP93 hash algorithms are the only ones registered
under those driver names and they are inherently async, the
lookup is self-contradictory and always fails with -ENOENT.

When called from the AEAD setkey path, this failure leaves the
SA record partially initialized with zeroed digest fields. A
subsequent crypto operation then dereferences a NULL pointer in
the request context, resulting in a kernel panic:

```
  pc : eip93_aead_handle_result+0xc8c/0x1240 [crypto_hw_eip93]
  lr : eip93_aead_handle_result+0xbec/0x1240 [crypto_hw_eip93]
  sp : ffffffc082feb820
  x29: ffffffc082feb820 x28: ffffff8011043980 x27: 0000000000000000
  x26: 0000000000000000 x25: ffffffc078da0bc8 x24: 0000000091043980
  x23: ffffff8004d59e50 x22: ffffff8004d59410 x21: ffffff8004d593c0
  x20: ffffff8004d593c0 x19: ffffff8004d4f300 x18: 0000000000000000
  x17: 0000000000000000 x16: 0000000000000000 x15: 0000007fda7aa498
  x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000
  x11: 0000000000000000 x10: fffffffff8127a80 x9 : 0000000000000000
  x8 : ffffff8004d4f380 x7 : 0000000000000000 x6 : 000000000000003f
  x5 : 0000000000000040 x4 : 0000000000000008 x3 : 0000000000000009
  x2 : 0000000000000008 x1 : 0000000028000003 x0 : ffffff8004d388c0
  Code: 910142b6 f94012e0 f9002aa0 f90006d3 (f9400740)
```

The reported symbol eip93_aead_handle_result+0xc8c is a
resolution artifact from static functions being merged under
the nearest exported symbol. Decoding the faulting sequence:

```
  910142b6  ADD  X22, X21, #0x50
  f94012e0  LDR  X0, [X23, #0x20]
  f9002aa0  STR  X0, [X21, #0x50]
  f90006d3  STR  X19, [X22, #0x8]
  f9400740  LDR  X0, [X26, #0x8]
```

The faulting LDR at [X26, #0x8] is loading ctx->flags
(offset 8 in eip93_hash_ctx), where ctx has been resolved
to NULL from a partially initialized or unreachable
transform context following the failed setkey.

Fix this by dropping the CRYPTO_ALG_ASYNC mask from the
crypto_alloc_ahash() call. The code already handles async
completion correctly via crypto_wait_req(), so there is no
requirement to restrict the lookup to synchronous algorithms.

Note that hashing a single 64-byte block through the hardware
is likely slower than doing it in software due to the DMA
round-trip overhead, but offloading it may still spare CPU
cycles on the slower embedded cores where this IP is found.

Fixes: 9739f5f93b78 ("crypto: eip93 - Add Inside Secure SafeXcel EIP-93 crypto engine support")
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
[Detailed investigation report of this bug]
Signed-off-by: Kenneth Kasilag <kenneth@kasilag.me>
Link: https://github.com/openwrt/openwrt/pull/22886
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-04-14 11:47:10 +02:00
..
airoha airoha: an7581: update partition table for EVB DTS 2026-04-09 11:51:48 +02:00
apm821xx kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
armsr kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
at91 kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
ath79 ath79: define wifi for pci168c,0027 2026-04-13 01:14:12 +02:00
bcm27xx kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
bcm47xx kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
bcm53xx bcm53xx: use libdeflate-gzip for images 2026-04-14 10:00:47 +02:00
bcm4908 kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
bmips kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
d1 kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
econet kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
gemini gemini: add 6.18 testing kernel 2026-04-13 10:13:08 +02:00
generic crypto: inside-secure/eip93: fix hmac setkey algo selection 2026-04-14 11:47:10 +02:00
imx kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
ipq40xx ipq40xx: avoid randomized MAC address on boot 2026-04-11 12:16:02 +02:00
ipq806x kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
ixp4xx kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
kirkwood treewide: use -n for fw_[saveprint]env 2026-04-07 09:51:10 +02:00
lantiq lantiq: dts: add missing gpio.h header for falcon.dtsi 2026-04-13 18:41:10 +02:00
layerscape kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
loongarch64 kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
malta malta: restore CONFIG_PAGE_BLOCK_MAX_ORDER=10 for 6.18 2026-04-11 18:11:03 +02:00
mediatek mediatek: don't let devfreq power-off the CPU 2026-04-14 00:54:37 +01:00
microchipsw kernel: 6.18: move CONFIG_CRYPTO_LIB_SHA256 to generic 2026-04-06 01:38:41 +02:00
mpc85xx mpc85xx: switch to libdeflate-gzip 2026-04-10 18:32:46 +02:00
mvebu mvebu: fix kmod for switch on clearfog base/pro 2026-04-14 09:58:44 +02:00
mxs kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
octeon kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
omap kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
pistachio kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
qoriq kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
qualcommax qualcommax: constify CPR match data 2026-04-13 12:22:09 +02:00
qualcommbe kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
ramips ramips: add support for I-O DATA WN-AX2033GR2 2026-04-13 02:14:26 +02:00
realtek realtek: rtl931x: psx28: specify POE MCU reset GPIO 2026-04-14 10:38:28 +02:00
rockchip kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
sifiveu kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
siflower kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
starfive treewide: use of_device_get_match_data 2026-04-12 18:18:28 +02:00
stm32 kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
sunxi kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
tegra kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
uml kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
x86 x86: enable Intel MID serial for Denverton SoCs 2026-04-07 02:04:55 +02:00
zynq kernel: 6.12: move CONFIG_CRYPTO_LIB_SHA1 to generic 2026-04-06 01:38:41 +02:00
Makefile linux: fix missing default packages in profiles.json 2024-11-17 19:29:06 +01:00