xguest installation failed on Red Hat Enterprise Linux 6
Environment
- Red Hat Enterprise Linux 6
Issue
- The following error is output on installing xguest package.
Error in PREIN scriptlet in rpm package xguest-1.0.9-2.el6.noarch
error: %pre(xguest-1.0.9-2.el6.noarch) scriptlet failed, exit status 1
error: install: %pre scriptlet failed (2), skipping xguest-1.0.9-2.el6
- This doesn't occur in many other systems.
Resolution
- Find the module using much vmalloc memory and remove it.
Root Cause
- Selinux module is placed in vmalloc'ed memory area in kernel. When the system does not have enough vmalloc memory, it can fail with no memory.
Diagnostic Steps
3997 01:48:36.393904 execve("/sbin/load_policy", ["/sbin/load_policy"], [/* 0 vars */]) = 0
... snip ...
3997 01:48:36.412245 open("/etc/selinux/targeted/policy/policy.24", O_RDONLY|O_LARGEFILE) = 3 <0.000082>
3997 01:48:36.412366 fstat64(3, {st_mode=S_IFREG|0644, st_size=6337067, ...}) = 0 <0.000011>
3997 01:48:36.412432 mmap2(NULL, 6337067, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7156000 <0.000014>
3997 01:48:36.412475 open("/selinux/load", O_RDWR|O_LARGEFILE) = 4 <0.000013>
3997 01:48:36.412521 write(4, "\214\377|\371\10\0\0\0SE Linux\30\0\0\0\5\0\0\0\10\0\0\0\7\0\0\0"..., 6337067) = -1 ENOMEM (Cannot allocate memory) <0.000102>
3997 01:48:36.412677 close(4) = 0 <0.000010>
3997 01:48:36.412728 write(2, "SELinux: Could not load policy "..., 101) = 101 <0.000017>
- Writing into /selinux/load on a execution of "/sbin/load_policy" returned -ENOMEM.
- The write hander in kernel for /selinux/load is sel_write_load().
static ssize_t sel_write_load(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
...
if ((count > 64 * 1024 * 1024)
|| (data = vmalloc(count)) == NULL) {
length = -ENOMEM; <<====================
goto out;
}
- Count should be a size of file policy.24 and, from sosreport:
VmallocTotal: 122880 kB
VmallocUsed: 101840 kB
VmallocChunk: 5076 kB
- There is no enough memory for vmalloc.
# grep nouv vmallocinfo
0xf8480000-0xf8c81000 8392704 nouveau_load+0x88/0x900 [nouveau] phys=f0000000 ioremap
0xf8d00000-0xfcd01000 67112960 nouveau_load+0x4fe/0x900 [nouveau] phys=d0000000 ioremap
0xfcef6000-0xfcef8000 8192 nv50_evo_channel_new+0x141/0x220 [nouveau] phys=f0640000 ioremap
0xfcefe000-0xfcf00000 8192 nv50_evo_channel_new+0x141/0x220 [nouveau] phys=f0641000 ioremap
0xfcf0a000-0xfcf0c000 8192 nv50_evo_channel_new+0x141/0x220 [nouveau] phys=f0642000 ioremap
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
