]> git.proxmox.com Git - mirror_lxc.git/commit - src/lxc/conf.c
Fix mount_entry_on_generic()
authorChristian Brauner <christian.brauner@mailbox.org>
Tue, 2 Feb 2016 21:13:07 +0000 (22:13 +0100)
committerChristian Brauner <christian.brauner@mailbox.org>
Tue, 2 Feb 2016 23:29:58 +0000 (00:29 +0100)
commitec50007fc2c90016a725b0a0ef329c039ad98265
tree395b701b33220418746211532a44c86f3219acc6
parent5e75dea27b483b82da615bd5d0bb5b802da95176
Fix mount_entry_on_generic()

In mount_entry_on_generic() we dereferenced a NULL pointer whenever a container
without a rootfs was created. (Since mount_entry_on_systemfs() passes them with
NULL.) We have mount_entry_on_generic() check whether rootfs != NULL.

We also check whether rootfs != NULL in the functions ovl_mkdir() and
mount_entry_create_aufs_dirs() and bail immediately. Rationale: For overlay and
aufs lxc.mount.entry entries users give us absolute paths to e.g. workdir and
upperdir which we create for them. We currently use rootfs->path and the
lxcpath for the container to check that users give us a sane path to create
those directories under and refuse if they do not. If we want to allow overlay
mounts for containers without a rootfs they can easily be reworked.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
src/lxc/bdev/lxcoverlay.c
src/lxc/conf.c