[v2,13/30] files: Add file_desc_ops::get_user_ns

Submitted by Kirill Tkhai on June 7, 2017, 11:28 a.m.

Details

Message ID 149683488407.4663.8541534559555843699.stgit@localhost.localdomain
State Accepted
Series "Support sockets leaked to child user_ns task"
Headers show

Commit Message

Kirill Tkhai June 7, 2017, 11:28 a.m.
Returns user_ns of file (currently it's not exported to userspace)
and minimal user_ns need for restore file (for example, socket
net_ns->user_ns, regulating setns() permittions).

This will be need to choose correct process as owner of file master.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 criu/include/files.h |    7 +++++++
 1 file changed, 7 insertions(+)

Patch hide | download patch | download mbox

diff --git a/criu/include/files.h b/criu/include/files.h
index 3fe3149f2..2351e41c6 100644
--- a/criu/include/files.h
+++ b/criu/include/files.h
@@ -20,6 +20,7 @@  struct file_desc;
 struct cr_imgset;
 struct rst_info;
 struct parasite_ctl;
+struct ns_id;
 
 struct fd_link {
 	union {
@@ -97,6 +98,12 @@  struct file_desc_ops {
 	 * so it shouldn't be saved for any post-actions.
 	 */
 	int			(*open)(struct file_desc *d, int *new_fd);
+	/*
+	 * Returns user_ns of file (currently it's not exported to userspace)
+	 * and minimal user_ns need for restore file (for example, socket
+	 * net_ns->user_ns, regulating setns() permittions).
+	 */
+	void			(*get_user_ns)(struct file_desc *, uint32_t *, struct ns_id **);
 	char *			(*name)(struct file_desc *, char *b, size_t s);
 };