mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-08 02:31:33 +00:00
lxc_spawn: initialize netpipe
When rebooting an unprivileged container, netpipe starts out as not -1. If count_veths somehow changed this could lead to trying to send data over nonexistent pipe. (Ok can't *really* happen, as it currently stands, but it's an open end) Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
parent
21ca73b980
commit
2f2623ec2b
@ -786,6 +786,8 @@ static int lxc_spawn(struct lxc_handler *handler)
|
|||||||
int preserve_mask = 0, i;
|
int preserve_mask = 0, i;
|
||||||
int netpipepair[2], nveths;
|
int netpipepair[2], nveths;
|
||||||
|
|
||||||
|
netpipe = -1;
|
||||||
|
|
||||||
for (i = 0; i < LXC_NS_MAX; i++)
|
for (i = 0; i < LXC_NS_MAX; i++)
|
||||||
if (handler->conf->inherit_ns_fd[i] != -1)
|
if (handler->conf->inherit_ns_fd[i] != -1)
|
||||||
preserve_mask |= ns_info[i].clone_flag;
|
preserve_mask |= ns_info[i].clone_flag;
|
||||||
|
Loading…
Reference in New Issue
Block a user