The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/3601

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Fixes: #3598
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
From 26ea5533c941baee14923dfc3edfb9c91666d245 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brau...@ubuntu.com>
Date: Mon, 14 Dec 2020 17:52:44 +0100
Subject: [PATCH] conf: fix block-device based rootfs mounting

Fixes: #3598
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
---
 src/lxc/conf.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 9f631e0c23..27f9706687 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -3135,6 +3135,10 @@ int lxc_setup_rootfs_prepare_root(struct lxc_conf *conf, 
const char *name,
                if (ret < 0)
                        return log_error(-1, "Failed to bind mount container / 
onto itself");
 
+               conf->rootfs.mntpt_fd = openat(-EBADF, path, O_RDONLY | 
O_CLOEXEC | O_DIRECTORY | O_PATH | O_NOCTTY);
+               if (conf->rootfs.mntpt_fd < 0)
+                       return log_error_errno(-errno, errno, "Failed to open 
file descriptor for container rootfs");
+
                return log_trace(0, "Bind mounted container / onto itself");
        }
 
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to