]> xenbits.xensource.com Git - libvirt.git/commit
qemu_cgroup: Handle device mapper targets properly
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 5 Apr 2018 07:34:25 +0000 (09:34 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 5 Apr 2018 14:52:55 +0000 (16:52 +0200)
commit6dd84f6850ca4379203d1e7b999430ed59041208
tree92eb455c13999f525a3f82b9db0ad67a4f6fbd80
parentfd9d1e686db64fa9481b9eab4dabafa46713e2cf
qemu_cgroup: Handle device mapper targets properly

https://bugzilla.redhat.com/show_bug.cgi?id=1557769

Problem with device mapper targets is that there can be several
other devices 'hidden' behind them. For instance, /dev/dm-1 can
consist of /dev/sda, /dev/sdb and /dev/sdc. Therefore, when
setting up devices CGroup and namespaces we have to take this
into account.

This bug was exposed after Linux kernel was fixed. Initially,
kernel used different functions for getting block device in
open() and ioctl(). While CGroup permissions were checked in the
former case, due to a bug in kernel they were not checked in the
latter case. This changed with the upstream commit of
519049afead4f7c3e6446028c41e99fde958cc04 (v4.16-rc5~11^2~4).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_cgroup.c