From: sashiko-bot@kernel.org
Cc: linux-security-module@vger.kernel.org
Subject: Re: [PATCH v5 1/4] ima: skip algorithm availability check until initramfs unpacking is finished
Date: Sat, 31 Oct 2026 21:10:29 +0000 [thread overview]
Message-ID: <sashiko-outbox-192150@kernel.org> (raw)
In-Reply-To: <20261030210944.2143778-2-dannyhu@arista.com>
> With CONFIG_IMA_APPRAISE=y, restoring xattrs during initramfs unpacking
> can deadlock the kernel if the xattr being restored is signed with a hash
> that the kernel does not already have available. This occurs when the
> ima_inode_setxattr() hook calls crypto_has_alg(). crypto_has_alg() may
> synchronously request a module leading to a circular dependency where the
> userspace helper waits for initramfs unpacking to complete while initramfs
> unpacking waits for the userspace helper.
>
> Guard this crypto availability check in validate_hash_algo() until
> initramfs unpacking is complete. This prevents the kernel from requesting
> a module during unpacking and allows security.ima xattrs to be restored
> even if the hash algorithm is unavailable in the running kernel.
> Essentially, this flag distinguishes restoration of existing metadata
> during initial population from setting/changing an xattr during runtime.
>
> A benefit of this approach is that once unpacking is complete, all
> subsequent xattr updates go through the same codepath as before which
> preserves the existing behavior during normal userspace operation.
>
> Signed-off-by: Danny Hu <dannyhu@arista.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261030210944.2143778-1-dannyhu@arista.com?part=1
next prev parent reply other threads:[~2026-10-31 21:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-30 21:09 [PATCH v5 0/4] initramfs: add support for xattrs in the initial ram disk Danny Hu
2026-10-30 21:09 ` [PATCH v5 1/4] ima: skip algorithm availability check until initramfs unpacking is finished Danny Hu
2026-10-31 21:10 ` sashiko-bot [this message]
2026-10-30 21:09 ` [PATCH v5 2/4] initramfs: add file metadata Danny Hu
2026-10-31 21:10 ` sashiko-bot
2026-10-30 21:09 ` [PATCH v5 3/4] initramfs: read metadata from special file METADATA!!! Danny Hu
2026-10-31 21:10 ` sashiko-bot
2026-10-30 21:09 ` [PATCH v5 4/4] gen_init_cpio: add support for file metadata Danny Hu
2026-10-31 21:10 ` sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-192150@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.