Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c12dada5 authored by Vivek Goyal's avatar Vivek Goyal Committed by Greg Kroah-Hartman
Browse files

ovl: Copy up underlying inode's ->i_mode to overlay inode



commit 07a2daab49c549a37b5b744cbebb6e3f445f12bc upstream.

Right now when a new overlay inode is created, we initialize overlay
inode's ->i_mode from underlying inode ->i_mode but we retain only
file type bits (S_IFMT) and discard permission bits.

This patch changes it and retains permission bits too. This should allow
overlay to do permission checks on overlay inode itself in task context.

[SzM] It also fixes clearing suid/sgid bits on write.

Signed-off-by: default avatarVivek Goyal <vgoyal@redhat.com>
Reported-by: default avatarEryu Guan <eguan@redhat.com>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
Fixes: 4bacc9c9 ("overlayfs: Make f_path always point to the overlay and f_inode to the underlay")
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e9a2ce2a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment