Skip to contentSkip to conversation

overlayfs: inode_owner_or_capable called during execv

PATCH RESEND New Mark Salyzyn 1 participant 1 message Oct 22, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND v18 4/4 overlayfs: inode_owner_or_capable called during execv

From: John Stultz <[email protected]>

Using old_creds as an indication that we are not overriding the credentials, bypass call to inode_owner_or_capable. This solves a problem with all execv calls being blocked when using the caller's credentials.

Fixes 05acefb4872da ("ovl: check permission to open real file")
Cc Stephen Smalley <[email protected]>

v18 - rebase

v17 - rebase

v16 - introduced fix over rebased series

---
 fs/overlayfs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/overlayfs/file.c +1 -1
index b1357bb067d9..9ab9663b02d8 100644
@@ -53,7 +53,7 @@ static struct file *ovl_open_realfile(const struct file *file,
 	err = inode_permission(realinode, MAY_OPEN | acc_mode);
 	if (err) {
 		realfile = ERR_PTR(err);
-	} else if (!inode_owner_or_capable(realinode)) {
+	} else if (old_cred && !inode_owner_or_capable(realinode)) {
 		realfile = ERR_PTR(-EPERM);
 	} else {
 		realfile = open_with_fake_path(&file->f_path, flags, realinode,
Signature · 1 line
2.29.0.rc1.297.gfa9743e501-goog