On Mon, 22 Jan 2024 11:38:52 +0100[...]
Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
On Wed, Jan 17, 2024 at 3:37 PM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx>
The dentries and inodes are created in the readdir for the sole purpose of
getting a consistent inode number. Linus stated that is unnecessary, and
that all inodes can have the same inode number. For a virtual file system
they are pretty meaningless.
Instead use a single unique inode number for all files and one for all
directories.
Link: https://lore.kernel.org/all/20240116133753.2808d45e@xxxxxxxxxxxxxxxxxx/
Yeah, Linus wanted me to try this first and see if there's any regressions.
Well, I guess you just answered that.
This confuses "find".
Running "find /sys/" now prints lots of error messages to stderr:
find: File system loop detected;
‘/sys/kernel/debug/tracing/events/initcall/initcall_finish’ is part of
the same file system loop as
‘/sys/kernel/debug/tracing/events/initcall’.
So at a minimum, the directories need to have unique inode numbers.
I'm using the eventfs_inode pointer to create a unique value for the inode.
But it's being salted, hashed and then truncated. As it is very easy to
read inodes (although by default, only root has access to read these
inodes), the inode numbers themselves shouldn't be able to leak kernel
addresses via the results of these inode numbers, would it?