Skip to content
Unverified Commit cfd86ef7 authored by Christian Brauner's avatar Christian Brauner
Browse files

anon_inode: use a proper mode internally

This allows the VFS to not trip over anonymous inodes and we can add
asserts based on the mode into the vfs. When we report it to userspace
we can simply hide the mode to avoid regressions. I've audited all
direct callers of alloc_anon_inode() and only secretmen overrides i_mode
and i_op inode operations but it already uses a regular file.

Link: https://lore.kernel.org/20250407-work-anon_inode-v1-1-53a44c20d44e@kernel.org


Fixes: af153bb6 ("vfs: catch invalid modes in may_open()")
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
Cc: stable@vger.kernel.org # all LTS kernels
Reported-by: default avatar <syzbot+5d8e79d323a13aa0b248@syzkaller.appspotmail.com>
Closes: https://lore.kernel.org/all/67ed3fb3.050a0220.14623d.0009.GAE@google.com


Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 418556fa
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment