[PATCH] ovl: say that only the capability to use reserved space is dropped
From: Cláudio Fernando Pinto via B4 Relay
Date: Mon Oct 19 2026 - 19:32:52 EST
From: Cláudio Fernando Pinto <claudio@xxxxxxxxxxxxxx>
The comment above cap_lower(CAP_SYS_RESOURCE) in
ovl_fill_super_creds(), added by commit 51f8f3c4e225 ("ovl: drop
CAP_SYS_RESOURCE from saved mounter's credentials"), says overlayfs
never uses reserved space. Lowering the capability does not stop ext4
from granting its reserved blocks by fsuid: with the default reserve
owner and a root mounter, a write through overlayfs still spends them.
Say what the code does, without going further.
Link: https://lore.kernel.org/linux-unionfs/CAOQ4uxh0g1MtgCO7Q2f4yJP5vq5rLEiiXHbVfeCxwXB5ff4-VQ@xxxxxxxxxxxxxx/
Assisted-by: LLM
Signed-off-by: Cláudio Fernando Pinto <claudio@xxxxxxxxxxxxxx>
---
Follow-up to the reserve report after Amir's reply: comment only.
---
fs/overlayfs/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index bd0a3f9039..21d0cb8719 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -1508,7 +1508,7 @@ static int ovl_fill_super_creds(struct fs_context *fc, struct super_block *sb)
else if (!ofs->nofh)
sb->s_export_op = &ovl_export_fid_operations;
- /* Never override disk quota limits or use reserved space */
+ /* Never override disk quota limits or use reserved space by capability */
cap_lower(creator_cred->cap_effective, CAP_SYS_RESOURCE);
sb->s_magic = OVERLAYFS_SUPER_MAGIC;
---
base-commit: 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907
change-id: 20261019-ovl-comment-3584e63aae25
Best regards,
--
Cláudio Fernando Pinto <claudio@xxxxxxxxxxxxxx>