From: sashiko-bot@kernel.org
Cc: linux-security-module@vger.kernel.org
Subject: Re: [PATCH] ovl: put the copy-up credentials when the copy_up hook fails
Date: Thu, 03 Dec 2026 10:41:07 +0000 [thread overview]
Message-ID: <sashiko-outbox-247596@kernel.org> (raw)
In-Reply-To: <20261203104244.1015716-1-a.s.protopopov@gmail.com>
> The security_inode_copy_up() function calls the inode_copy_up hook of
> every LSM in turn and stops at the first error. SELinux and Smack
> allocate new credentials with prepare_creds() and return them in
> *new. If an LSM which runs after them fails the hook, for example a
> BPF LSM program which denies the copy-up, ovl_prepare_copy_up_creds()
> returns the error and the credentials leak. Nobody puts them: the
> cleanup of the copy_up_creds class skips error pointers.
>
> Put the credentials before returning the error. put_cred() accepts
> NULL, so this is also right when no LSM allocated them.
>
> Fixes: d8ad8b496184 ("security, overlayfs: provide copy up security hook for unioned files")
> Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261203104244.1015716-1-a.s.protopopov@gmail.com?part=1
prev parent reply other threads:[~2026-12-03 10:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 10:42 [PATCH] ovl: put the copy-up credentials when the copy_up hook fails Anton Protopopov
2026-12-03 10:41 ` sashiko-bot [this message]
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-247596@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox