Re: [PATCH] KEYS: trusted: caam: propagate protected key option parsing errors

From
sashiko-bot@kernel.org
Date
2026-11-24 16:04:27
Reply to
Keisuke Tsukuda, 2026-11-24
From: Keisuke Tsukuda <redacted>

get_pkey_options() returns -EINVAL for invalid protected key options,
such as "key_enc_algo=GG". trusted_caam_seal() and trusted_caam_unseal()
ignore this error and return 0. The trusted key core then instantiates
a key without a blob for "new", or with a zero-length key for "load".

On an i.MX6Q running a 7.4.0-rc2-based kernel, adding a key with
"new 32 pk key_enc_algo=GG" succeeds, but KEYCTL_READ returns zero
bytes because no blob was created. The key cannot be saved and
reloaded.

Return the parsing error from both paths. On the patched kernel,
"new" and "load" with "key_enc_algo=GG" both fail with -EINVAL, while
valid requests succeed.

Fixes: a703a4c2a328 ("KEYS: trusted: caam based protected key")
Signed-off-by: Keisuke Tsukuda <redacted>
Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261124155310.32044-1-tkdkei@outlook.jp?part=1
Thread (4 messages) 4 messages, 4 authors, last reply 19h ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help