Bug 1312573 - virt-aa-helper allows read access to the VNC socket
virt-aa-helper allows read access to the VNC socket
Status: CLOSED UPSTREAM
Product: Virtualization Tools
Classification: Community
Component: libvirt (Show other bugs)
unspecified
All Linux
unspecified Severity low
: ---
: ---
Assigned To: Libvirt Maintainers
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-27 08:37 EST by Simon Arlott
Modified: 2016-04-20 10:01 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-04-20 10:01:01 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
bugzilla.redhat.simon: needinfo-


Attachments (Terms of Use)
Patch to remove read permission on VNC sockets (646 bytes, patch)
2016-02-27 08:37 EST, Simon Arlott
no flags Details | Diff

  None (edit)
Description Simon Arlott 2016-02-27 08:37:42 EST
Created attachment 1131085 [details]
Patch to remove read permission on VNC sockets

Description of problem: virt-aa-helper allows read access to the VNC socket

Version-Release number of selected component (if applicable): 1.2.16

How reproducible: Connect to the VNC socket using the VM's apparmor profile

Steps to Reproduce:
1. Identify the apparmor profile (libvirt-<uuid>) used by a running VM (<name>) that has a VNC socket enabled
2. As root, run and then ^C: socat UNIX-CLIENT:/var/lib/libvirt/qemu/<name>.vnc STDIO
3. As root, run and then ^C: aa-exec -p libvirt-<uuid> socat UNIX-CLIENT:/var/lib/libvirt/qemu/<name>.vnc STDIO

Actual results:
2. RFB 003.008
3. RFB 003.008

Expected results:
2. RFB 003.008
3. 2016/02/27 13:33:08 socat[1065] E connect(5, AF=1 "/var/lib/libvirt/qemu/<name>.vnc", 35): Permission denied

Additional info: The VM does not need read permission for its own VNC socket to create(), bind(), accept() connections or to receive(), send(), etc. on connections.
Comment 1 Cole Robinson 2016-03-21 18:25:31 EDT
Thanks for the patch. I don't think anyone who works on virt-aa-helper watches this tracker... please send the patch to libvir-list@redhat.com and CC cbosdonnat@suse.com and agx@sigxcpu.org , they can review and commit
Comment 2 Cole Robinson 2016-03-21 19:32:55 EDT
Also if you do send the patch upstream, and these patches have landed:

http://www.redhat.com/archives/libvir-list/2016-March/msg00979.html

Please adjust the spice socket permissions as well
Comment 3 Cole Robinson 2016-04-07 16:02:57 EDT
CCing guido and cedric who patch virt-aa-helper on occasion
Comment 4 Guido Günther 2016-04-08 03:30:44 EDT
Looks good to me.
Comment 5 Cole Robinson 2016-04-08 09:02:36 EDT
I sent the patch upstream, Guido if you ACK I'll push it

http://www.redhat.com/archives/libvir-list/2016-April/msg00363.html
Comment 6 Cole Robinson 2016-04-20 10:01:01 EDT
Pushed upstream now. Thanks for the patch!

commit ab9569e5460d1e4737fe8b625c67687dc2204665
Author: Simon Arlott <bugzilla.redhat.simon@arlott.org>
Date:   Fri Apr 8 09:01:33 2016 -0400

    virt-aa-helper: disallow VNC socket read permissions
    
    The VM does not need read permission for its own VNC socket to create(),
    bind(), accept() connections or to receive(), send(), etc. on connections.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1312573

Note You need to log in before you can comment on or make changes to this bug.