[libvirt] [PATCH 03/12] apparmor, libvirt-qemu: Allow read access to sysfs system info

Christian Ehrhardt posted 12 patches 7 years, 4 months ago
[libvirt] [PATCH 03/12] apparmor, libvirt-qemu: Allow read access to sysfs system info
Posted by Christian Ehrhardt 7 years, 4 months ago
From: Jamie Strandboge <jamie@ubuntu.com>

Newer qemu wants to read
/sys/devices/system/node/
/sys/devices/system/cpu/
/sys/devices/system/node/node[0-9]*/meminfo

Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
---
 examples/apparmor/libvirt-qemu | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/examples/apparmor/libvirt-qemu b/examples/apparmor/libvirt-qemu
index 651d841..b9e45bd 100644
--- a/examples/apparmor/libvirt-qemu
+++ b/examples/apparmor/libvirt-qemu
@@ -34,6 +34,10 @@
   owner @{PROC}/@{pid}/task/@{tid}/comm rw,
   @{PROC}/sys/kernel/cap_last_cap r,
 
+  /sys/devices/system/node/ r,
+  /sys/devices/system/node/node[0-9]*/meminfo r,
+  /sys/devices/system/cpu/ r,
+
   # For hostdev access. The actual devices will be added dynamically
   /sys/bus/usb/devices/ r,
   /sys/devices/**/usb[0-9]*/** r,
-- 
2.7.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 03/12] apparmor, libvirt-qemu: Allow read access to sysfs system info
Posted by intrigeri 7 years, 4 months ago
Hi,

Christian Ehrhardt:
> diff --git a/examples/apparmor/libvirt-qemu b/examples/apparmor/libvirt-qemu
> index 651d841..b9e45bd 100644
> --- a/examples/apparmor/libvirt-qemu
> +++ b/examples/apparmor/libvirt-qemu
> @@ -34,6 +34,10 @@
>    owner @{PROC}/@{pid}/task/@{tid}/comm rw,
>    @{PROC}/sys/kernel/cap_last_cap r,

> +  /sys/devices/system/node/ r,
> +  /sys/devices/system/node/node[0-9]*/meminfo r,
> +  /sys/devices/system/cpu/ r,
> +
>    # For hostdev access. The actual devices will be added dynamically
>    /sys/bus/usb/devices/ r,
>    /sys/devices/**/usb[0-9]*/** r,

I think I've already upstream'ed this 4 months ago: commit
e7f5d627f93c1c71260d2a795a1227b16b0d3186.

Maybe rebase your patch series on top of the current upstream
master branch? :)

Cheers,
-- 
intrigeri

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 03/12] apparmor, libvirt-qemu: Allow read access to sysfs system info
Posted by Christian Ehrhardt 7 years, 4 months ago
On Wed, Dec 20, 2017 at 10:35 AM, intrigeri <intrigeri+libvirt@boum.org> wrote:
> Hi,
>
> Christian Ehrhardt:
>> diff --git a/examples/apparmor/libvirt-qemu b/examples/apparmor/libvirt-qemu
>> index 651d841..b9e45bd 100644
>> --- a/examples/apparmor/libvirt-qemu
>> +++ b/examples/apparmor/libvirt-qemu
>> @@ -34,6 +34,10 @@
>>    owner @{PROC}/@{pid}/task/@{tid}/comm rw,
>>    @{PROC}/sys/kernel/cap_last_cap r,
>
>> +  /sys/devices/system/node/ r,
>> +  /sys/devices/system/node/node[0-9]*/meminfo r,
>> +  /sys/devices/system/cpu/ r,
>> +
>>    # For hostdev access. The actual devices will be added dynamically
>>    /sys/bus/usb/devices/ r,
>>    /sys/devices/**/usb[0-9]*/** r,
>
> I think I've already upstream'ed this 4 months ago: commit
> e7f5d627f93c1c71260d2a795a1227b16b0d3186.

You did, thank you!

> Maybe rebase your patch series on top of the current upstream
> master branch? :)

I rebased my branch before submission, but since my change was at
another context it didn't break to make it obvious.
I checked for duplicates in an extra tree that was on an old state of
about 5 months ago :-/

TL;DR ignore this commit - already done

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 03/12] apparmor, libvirt-qemu: Allow read access to sysfs system info
Posted by Jamie Strandboge 7 years, 4 months ago
On Tue, 2017-12-19 at 16:03 +0100, Christian Ehrhardt wrote:
> From: Jamie Strandboge <jamie@ubuntu.com>
> 
> Newer qemu wants to read
> /sys/devices/system/node/
> /sys/devices/system/cpu/
> /sys/devices/system/node/node[0-9]*/meminfo
> 
> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
> ---
>  examples/apparmor/libvirt-qemu | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/examples/apparmor/libvirt-qemu
> b/examples/apparmor/libvirt-qemu
> index 651d841..b9e45bd 100644
> --- a/examples/apparmor/libvirt-qemu
> +++ b/examples/apparmor/libvirt-qemu
> @@ -34,6 +34,10 @@
>    owner @{PROC}/@{pid}/task/@{tid}/comm rw,
>    @{PROC}/sys/kernel/cap_last_cap r,
>  
> +  /sys/devices/system/node/ r,
> +  /sys/devices/system/node/node[0-9]*/meminfo r,
> +  /sys/devices/system/cpu/ r,
> +

These read accesses are fine. +1

-- 
Jamie Strandboge             | http://www.canonical.com--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list