From: Mimi Zohar <zohar@linux.ibm.com>
To: Roberto Sassu <roberto.sassu@huaweicloud.com>,
dmitry.kasatkin@gmail.com, eric.snowberg@oracle.com,
paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com
Cc: linux-integrity@vger.kernel.org,
linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-cifs@vger.kernel.org, viro@zeniv.linux.org.uk,
pc@manguebit.com, christian@brauner.io,
Roberto Sassu <roberto.sassu@huawei.com>,
stable@vger.kernel.org, Steve French <smfrench@gmail.com>
Subject: Re: [PATCH 1/2] security: Handle dentries without inode in security_path_post_mknod()
Date: Fri, 29 Mar 2024 11:05:13 -0400 [thread overview]
Message-ID: <7b8162281b355b16e8dbdb93297a9a1cfb5bb6da.camel@linux.ibm.com> (raw)
In-Reply-To: <20240329105609.1566309-1-roberto.sassu@huaweicloud.com>
On Fri, 2024-03-29 at 11:56 +0100, Roberto Sassu wrote:
> From: Roberto Sassu <roberto.sassu@huawei.com>
>
> Commit 08abce60d63fi ("security: Introduce path_post_mknod hook")
> introduced security_path_post_mknod(), to replace the IMA-specific call to
> ima_post_path_mknod().
>
> For symmetry with security_path_mknod(), security_path_post_mknod() is
> called after a successful mknod operation, for any file type, rather than
> only for regular files at the time there was the IMA call.
>
> However, as reported by VFS maintainers, successful mknod operation does
> not mean that the dentry always has an inode attached to it (for example,
> not for FIFOs on a SAMBA mount).
>
> If that condition happens, the kernel crashes when
> security_path_post_mknod() attempts to verify if the inode associated to
> the dentry is private.
>
> Add an extra check to first verify if there is an inode attached to the
> dentry, before checking if the inode is private. Also add the same check to
> the current users of the path_post_mknod hook, ima_post_path_mknod() and
> evm_post_path_mknod().
>
> Finally, use the proper helper, d_backing_inode(), to retrieve the inode
> from the dentry in ima_post_path_mknod().
>
> Cc: stable@vger.kernel.org # 6.8.x
Huh? It doesn't need to be backported.
> Reported-by: Steve French <smfrench@gmail.com>
> Closes:
> https://lore.kernel.org/linux-kernel/CAH2r5msAVzxCUHHG8VKrMPUKQHmBpE6K9_vjhgDa1uAvwx4ppw@mail.gmail.com/
> Fixes: 08abce60d63fi ("security: Introduce path_post_mknod hook")
-> 08abce60d63f
> Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Acked-by: Mimi Zohar <zohar@linux.ibm.com>
next prev parent reply other threads:[~2024-03-29 15:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-29 10:56 [PATCH 1/2] security: Handle dentries without inode in security_path_post_mknod() Roberto Sassu
2024-03-29 10:56 ` [PATCH 2/2] ima: evm: Rename *_post_path_mknod() to *_path_post_mknod() Roberto Sassu
2024-03-29 15:16 ` Mimi Zohar
2024-03-29 15:45 ` Roberto Sassu
2024-03-29 19:12 ` Paul Moore
2024-03-29 19:27 ` Mimi Zohar
2024-03-29 19:56 ` Paul Moore
2024-03-29 15:05 ` Mimi Zohar [this message]
2024-03-29 15:42 ` [PATCH 1/2] security: Handle dentries without inode in security_path_post_mknod() Roberto Sassu
2024-03-29 19:06 ` Paul Moore
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=7b8162281b355b16e8dbdb93297a9a1cfb5bb6da.camel@linux.ibm.com \
--to=zohar@linux.ibm.com \
--cc=christian@brauner.io \
--cc=dmitry.kasatkin@gmail.com \
--cc=eric.snowberg@oracle.com \
--cc=jmorris@namei.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=pc@manguebit.com \
--cc=roberto.sassu@huawei.com \
--cc=roberto.sassu@huaweicloud.com \
--cc=serge@hallyn.com \
--cc=smfrench@gmail.com \
--cc=stable@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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