From: Vladimir Riabchun <vladimir.riabchun@virtuozzo.com>
To: vasileios.almpanis@virtuozzo.com, ptikhomirov@virtuozzo.com,
Konstantin Khorenko <khorenko@virtuozzo.com>
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.1 v7 4/6] ovl: Keep creator VE in overlayfs superblock
Date: Mon, 16 Nov 2026 18:18:54 +0100 [thread overview]
Message-ID: <20261116-ovl-use-orig-ve-v7-4-37daa56081ed@virtuozzo.com> (raw)
In-Reply-To: <20261116-ovl-use-orig-ve-v7-0-37daa56081ed@virtuozzo.com>
Overlayfs superblock stores creator creds in it, but these creds
should go together with the VE they were taken from.
Store the VE in the superblock. We can't use mount->owner_ve,
because several mounts can reference one superblock.
Feature: ve/overlayfs
https://virtuozzo.atlassian.net/browse/VSTOR-142405
Signed-off-by: Vladimir Riabchun <vladimir.riabchun@virtuozzo.com>
---
fs/overlayfs/ovl_entry.h | 1 +
fs/overlayfs/params.c | 3 +++
fs/overlayfs/super.c | 3 +++
3 files changed, 7 insertions(+)
diff --git a/fs/overlayfs/ovl_entry.h b/fs/overlayfs/ovl_entry.h
index ab78001635e7..a6ad8b8de48c 100644
--- a/fs/overlayfs/ovl_entry.h
+++ b/fs/overlayfs/ovl_entry.h
@@ -77,6 +77,7 @@ struct ovl_fs {
struct ovl_config config;
/* creds of process who forced instantiation of super block */
const struct cred *creator_cred;
+ struct ve_struct *creator_ve;
bool tmpfile;
bool noxattr;
bool nofh;
diff --git a/fs/overlayfs/params.c b/fs/overlayfs/params.c
index 72a522d5fa17..b394e30741f4 100644
--- a/fs/overlayfs/params.c
+++ b/fs/overlayfs/params.c
@@ -8,6 +8,7 @@
#include <linux/posix_acl_xattr.h>
#include <linux/seq_file.h>
#include <linux/xattr.h>
+#include <linux/ve.h>
#include "overlayfs.h"
#include "params.h"
@@ -758,6 +759,8 @@ void ovl_free_fs(struct ovl_fs *ofs)
kfree(ofs->config.workdir);
if (ofs->creator_cred)
put_cred(ofs->creator_cred);
+ if (ofs->creator_ve)
+ put_ve(ofs->creator_ve);
kfree(ofs);
}
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index 8153362caad1..beb08ef2f156 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -18,6 +18,7 @@
#include <linux/file.h>
#include <linux/fs_context.h>
#include <linux/fs_parser.h>
+#include <linux/ve.h>
#include "overlayfs.h"
#include "params.h"
@@ -1328,6 +1329,8 @@ int ovl_fill_super(struct super_block *sb, struct fs_context *fc)
sb->s_d_op = &ovl_dentry_operations;
+ ofs->creator_ve = get_ve(get_exec_env());
+
err = -ENOMEM;
ofs->creator_cred = cred = prepare_creds();
if (!cred)
--
2.52.0
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-11-16 17:20 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 17:18 [Devel] [PATCH hci-8.1 v7 0/6] Fix kernel crash in overlayfs Vladimir Riabchun
2026-11-16 17:18 ` [Devel] [PATCH hci-8.1 v7 1/6] ve: Remove STOPPED state Vladimir Riabchun
2026-11-16 17:23 ` no-reply
2026-11-16 17:35 ` Vladimir Riabchun
2026-11-16 17:18 ` [Devel] [PATCH hci-8.1 v7 2/6] ve: Introduce override_ve/revert_ve helpers Vladimir Riabchun
2026-11-16 17:25 ` no-reply
2026-11-16 17:18 ` [Devel] [PATCH hci-8.1 v7 3/6] ve: Defer ve creds drop until ve is completely destroyed Vladimir Riabchun
2026-11-16 17:26 ` no-reply
2026-11-16 17:18 ` Vladimir Riabchun [this message]
2026-11-16 17:27 ` [Devel] [PATCH hci-8.1 v7 4/6] ovl: Keep creator VE in overlayfs superblock no-reply
2026-11-16 17:18 ` [Devel] [PATCH hci-8.1 v7 5/6] ovl: Fix leaking fd references in ovl_copyfile Vladimir Riabchun
2026-11-16 17:27 ` no-reply
2026-11-16 17:18 ` [Devel] [PATCH hci-8.1 v7 6/6] ve/overlayfs: Override VE together with creds Vladimir Riabchun
2026-11-16 17:32 ` no-reply
2026-11-16 17:45 ` Vladimir Riabchun
2026-11-16 17:43 ` [Devel] [PATCH hci-8.1 v7 0/6] Fix kernel crash in overlayfs Konstantin Khorenko
2026-11-16 20:22 ` Vladimir Riabchun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261116-ovl-use-orig-ve-v7-4-37daa56081ed@virtuozzo.com \
--to=vladimir.riabchun@virtuozzo.com \
--cc=devel@openvz.org \
--cc=khorenko@virtuozzo.com \
--cc=ptikhomirov@virtuozzo.com \
--cc=vasileios.almpanis@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox