libvirt reporting incorrect value of 4k (small) pages
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Won't Fix
|
High
|
Stephen Finucane |
Bug Description
libvirt < 4.3.0 had an issue whereby assigning more than 4 GB of huge pages would result in an incorrect value for the number of 4k (small) pages. This was tracked and fixed via rhbz#1569678 and the fixes appear to have been backported to the libvirt versions for RHEL 7.4+. However, this is still an issue with the versions of libvirt available on Ubuntu 16.04, 18.04 and who knows what else. We should either alert the user that the bug exists or, better again, work around the issue using the rest of the (correct) values for different page sizes.
# Incorrect value (Ubuntu 16.04, libvirt 4.0.0)
$ virsh capabilities | xmllint --xpath /capabilities/
<cell id="0">
<memory unit="KiB"
<pages unit="KiB" size="4"
<pages unit="KiB" size="2048"
<pages unit="KiB" size="1048576"
...
</cell>
(3075208 * 4) + (4000 * 2048) != 16298528
# Correct values (Fedora ??, libvirt 4.10)
$ virsh capabilities | xmllint --xpath /capabilities/
<cell id='0'>
<memory unit='KiB'
<pages unit='KiB' size='4'
<pages unit='KiB' size='2048'
<pages unit='KiB' size='1048576'
...
</cell>
(8038777 * 4) + (100 * 2048) == 32359908
description: | updated |
Changed in nova: | |
assignee: | nobody → Stephen Finucane (stephenfinucane) |
status: | New → In Progress |
Changed in nova: | |
status: | Confirmed → In Progress |
Changed in nova: | |
status: | In Progress → Won't Fix |
setting this to high as while people generally dont use expcit small pages this was
considerd sevear enough to include in a redhat security update for libvirt.
https:/ /www.redhat. com/archives/ rhsa-announce/ 2018-June/ msg00038. html
there is no cve related to this to my knoladge and the issue has been public on the
libivrt side for some time so i dont think this should be treated as an openstack seurity bug
since we also already have patches available for public review and have been discussing this as
part of code review for another bug.
i have confirmed this locally on ubuntu 18.04 and stephen has reported it on 16.04
i have also seen this on centos 7 in the past but it is now fixed.
<memory unit='KiB' >8388060< /memory> >1329015< /pages> >1500</ pages>
<pages unit='KiB' size='4'
<pages unit='KiB' size='2048'
(8388060- (1500*2048) )/4=1329015
once you allocate more then 4G of hugepages we would expect to triger the >8388060< /memory> >1021815< /pages> >2100</ pages> >0</pages>
overfow.
<memory unit='KiB'
<pages unit='KiB' size='4'
<pages unit='KiB' size='2048'
<pages unit='KiB' size='1048576'
on centos7 with libvirt 3.9.0-14.el7_5.8 this does not happen but on ubunu the overflow is observed.
even with that backport however there could still be unpatch centos 7 systems
and it is not clear that suse or oracle linux would have simlarly backported this so i
think this should be "fixed" in nova even though the root case is a libvirt bug.