Skip to contentSkip to conversation

kernel_devices.patch

refpolicy Daniel J Walsh 3 participants 8 messages Jun 2, 2010 – Jun 7, 2010

lore
Share & tools
lore
#1 lore raw
Quoted 7 lines · Daniel J Walsh

http://people.fedoraproject.org/~dwalsh/SELinux/F14/kernel_devices.patch

vhost_device_t added for libvirt/qemu

/dev/usbmon device added

Added default label for /sys so libvirt could relabel to it.

I don't understand this. There should be no files labeled sysfs_t, except for the entries created by the kernel on the fs itself, which get the right label already.

Quoted 1 line

lots of new interfaces.

Otherwise merged.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#2 lore raw
Quoted 9 lines · Christopher J. PeBenito
Quoted 7 lines · Daniel J Walsh

http://people.fedoraproject.org/~dwalsh/SELinux/F14/kernel_devices.patch

vhost_device_t added for libvirt/qemu

/dev/usbmon device added

Added default label for /sys so libvirt could relabel to it.

Quoted 8 lines

I don't understand this. There should be no files labeled sysfs_t, except for the entries created by the kernel on the fs itself, which get the right label already.

Quoted 1 line

lots of new interfaces.

Otherwise merged.

libvirt currently does the equivalent of

chcon svirt_t:MCS1 DEVICE
Run QEMU
restorecon DEVICE

If /sys is <<none>> then it does not have a label to change the context back to. And leaves the context with a label svirt_t:MCS1. If it later picks an svirt_t:MCS1 for a different image, this /sys device is vulnerable.

#3 lore raw
Quoted 12 lines · Daniel J Walsh
Quoted 9 lines · Christopher J. PeBenito
Quoted 3 lines · Daniel J Walsh

http://people.fedoraproject.org/~dwalsh/SELinux/F14/kernel_devices.patch

Added default label for /sys so libvirt could relabel to it.

I don't understand this. There should be no files labeled sysfs_t, except for the entries created by the kernel on the fs itself, which get the right label already.

libvirt currently does the equivalent of

Quoted 7 lines

chcon svirt_t:MCS1 DEVICE
Run QEMU
restorecon DEVICE

If /sys is <<none>> then it does not have a label to change the context back to. And leaves the context with a label svirt_t:MCS1. If it later picks an svirt_t:MCS1 for a different image, this /sys device is vulnerable.

I still don't understand. There are no device nodes in sysfs.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#4 lore raw
Quoted 17 lines · Christopher J. PeBenito
Quoted 16 lines · Daniel J Walsh
Quoted 9 lines · Christopher J. PeBenito
Quoted 3 lines · Daniel J Walsh

http://people.fedoraproject.org/~dwalsh/SELinux/F14/kernel_devices.patch

Added default label for /sys so libvirt could relabel to it.

I don't understand this. There should be no files labeled sysfs_t, except for the entries created by the kernel on the fs itself, which get the right label already.

libvirt currently does the equivalent of

chcon svirt_t:MCS1 DEVICE
Run QEMU
restorecon DEVICE

Quoted 6 lines
Quoted 3 lines

If /sys is<<none>> then it does not have a label to change the context back to. And leaves the context with a label svirt_t:MCS1. If it later picks an svirt_t:MCS1 for a different image, this /sys device is vulnerable.

I still don't understand. There are no device nodes in sysfs.

sysfs supports labeling now. Certain objects need to have a svirt_image_t:MCS label associated with them under /sys (Usb devices?) When libvirt needs to changes these labels back to the default it asks matchpathcon and it returns sysfs_t.

#5 lore raw
Quoted 22 lines · Daniel J Walsh
Quoted 21 lines · Christopher J. PeBenito
Quoted 19 lines · Daniel J Walsh
Quoted 9 lines · Christopher J. PeBenito
Quoted 3 lines · Daniel J Walsh

http://people.fedoraproject.org/~dwalsh/SELinux/F14/kernel_devices.patch

Added default label for /sys so libvirt could relabel to it.

I don't understand this. There should be no files labeled sysfs_t, except for the entries created by the kernel on the fs itself, which get the right label already.

libvirt currently does the equivalent of

chcon svirt_t:MCS1 DEVICE
Run QEMU
restorecon DEVICE

If /sys is<<none>> then it does not have a label to change the context back to. And leaves the context with a label svirt_t:MCS1. If it later picks an svirt_t:MCS1 for a different image, this /sys device is vulnerable.

Quoted 6 lines
Quoted 2 lines

I still don't understand. There are no device nodes in sysfs.

sysfs supports labeling now. Certain objects need to have a svirt_image_t:MCS label associated with them under /sys (Usb devices?) When libvirt needs to changes these labels back to the default it asks matchpathcon and it returns sysfs_t.

This is to support access to PCI device resources via sysfs. See Documentation/sysfs-pci.txt.

Signature · 2 lines
Stephen Smalley
National Security Agency
#6 lore raw
In reply to Daniel J Walsh
Quoted 22 lines · Daniel J Walsh
Quoted 21 lines · Christopher J. PeBenito
Quoted 19 lines · Daniel J Walsh
Quoted 9 lines · Christopher J. PeBenito
Quoted 3 lines · Daniel J Walsh

http://people.fedoraproject.org/~dwalsh/SELinux/F14/kernel_devices.patch

Added default label for /sys so libvirt could relabel to it.

I don't understand this. There should be no files labeled sysfs_t, except for the entries created by the kernel on the fs itself, which get the right label already.

libvirt currently does the equivalent of

chcon svirt_t:MCS1 DEVICE
Run QEMU
restorecon DEVICE

If /sys is<<none>> then it does not have a label to change the context back to. And leaves the context with a label svirt_t:MCS1. If it later picks an svirt_t:MCS1 for a different image, this /sys device is vulnerable.

Quoted 6 lines
Quoted 2 lines

I still don't understand. There are no device nodes in sysfs.

sysfs supports labeling now. Certain objects need to have a svirt_image_t:MCS label associated with them under /sys (Usb devices?) When libvirt needs to changes these labels back to the default it asks matchpathcon and it returns sysfs_t.

Why doesn't it save the previous label and then restore it? That is much more sane, in case the previous label was not sysfs_t. I don't know if thats likely to happen, but it seems safer too.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#7 lore raw
Quoted 25 lines · Christopher J. PeBenito
Quoted 24 lines · Daniel J Walsh
Quoted 23 lines · Christopher J. PeBenito
Quoted 12 lines · Daniel J Walsh
Quoted 9 lines · Christopher J. PeBenito
Quoted 3 lines · Daniel J Walsh

http://people.fedoraproject.org/~dwalsh/SELinux/F14/kernel_devices.patch

Added default label for /sys so libvirt could relabel to it.

I don't understand this. There should be no files labeled sysfs_t, except for the entries created by the kernel on the fs itself, which get the right label already.

libvirt currently does the equivalent of

Quoted 7 lines

chcon svirt_t:MCS1 DEVICE
Run QEMU
restorecon DEVICE

If /sys is<<none>> then it does not have a label to change the context back to. And leaves the context with a label svirt_t:MCS1. If it later picks an svirt_t:MCS1 for a different image, this /sys device is vulnerable.

I still don't understand. There are no device nodes in sysfs.

Quoted 8 lines
Quoted 4 lines

sysfs supports labeling now. Certain objects need to have a svirt_image_t:MCS label associated with them under /sys (Usb devices?) When libvirt needs to changes these labels back to the default it asks matchpathcon and it returns sysfs_t.

Why doesn't it save the previous label and then restore it? That is much more sane, in case the previous label was not sysfs_t. I don't know if thats likely to happen, but it seems safer too.

I suggested that as well, and they said the problem is tracking the state across libvirtd restarts, although they hope to migrate to that approach long term.

Signature · 2 lines
Stephen Smalley
National Security Agency