Skip to content

Commit 27df4b4

Browse files
Tetsuo HandaJames Morris
authored andcommitted
tomoyo: Change pathname calculation for read-only filesystems.
Commit 5625f2e ("TOMOYO: Change pathname for non-rename()able filesystems.") intended to be applied to filesystems where the content is not controllable from the userspace (e.g. proc, sysfs, securityfs), based on an assumption that such filesystems do not support rename() operation. But it turned out that read-only filesystems also do not support rename() operation despite the content is controllable from the userspace, and that commit is annoying TOMOYO users who want to use e.g. squashfs as the root filesystem due to use of local name which does not start with '/'. Therefore, based on an assumption that filesystems which require the device argument upon mount() request is an indication that the content is controllable from the userspace, do not use local name if a filesystem does not support rename() operation but requires the device argument upon mount() request. Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: James Morris <jamorris@linux.microsoft.com>
1 parent e6193f7 commit 27df4b4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎security/tomoyo/realpath.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ char *tomoyo_realpath_from_path(const struct path *path)
295295
* or dentry without vfsmount.
296296
*/
297297
if (!path->mnt ||
298-
(!inode->i_op->rename))
298+
(!inode->i_op->rename &&
299+
!(sb->s_type->fs_flags & FS_REQUIRES_DEV)))
299300
pos = tomoyo_get_local_path(path->dentry, buf,
300301
buf_len - 1);
301302
/* Get absolute name for the rest. */

0 commit comments

Comments
 (0)