Re: [PATCH v3 4/4] virt-aa-helper: store dynamically generated rules

2025-01-15 Thread Georgia Garcia
On Tue, 2025-01-14 at 12:13 -0600, Andrea Bolognani wrote: > On Wed, Jan 08, 2025 at 11:06:54AM -0700, Jim Fehlig wrote: > > On 1/8/25 06:50, Georgia Garcia wrote: > > > On Tue, 2025-01-07 at 17:29 -0700, Jim Fehlig wrote: > > > > On 1/7/25 08:23, Georgia Garcia w

Re: [PATCH v3 4/4] virt-aa-helper: store dynamically generated rules

2025-01-08 Thread Georgia Garcia
On Tue, 2025-01-07 at 17:29 -0700, Jim Fehlig wrote: > On 1/7/25 08:23, Georgia Garcia wrote: > > Some rules are generated dynamically during boot and added to the > > AppArmor policy. An example of that is macvtap devices that call the > > AppArmorSetFDLabel hook to add a ru

Re: [PATCH v3 3/4] apparmor: fix UUID specification

2025-01-08 Thread Georgia Garcia
On Tue, 2025-01-07 at 17:04 -0700, Jim Fehlig wrote: > On 1/7/25 08:23, Georgia Garcia wrote: > > There is a common misconception when writing AppArmor policy that > > [0-9]* applies * to the [0-9] class, but that's not the case. For this > > example, [0-9]* matches a si

[PATCH v3 0/4] fix AppArmor policy restore for runtime rules

2025-01-07 Thread Georgia Garcia
ncluded by libvirt-uuid.files that already exists. It also includes other fixes like memory leaks, adoption of the GLib API in the apparmor files and a fix on the AppArmor policy that incorrectly applies apparmor policy syntax. Georgia Garcia (4): security_apparmor: fix memleaks in AppArmorSetFDLabel

Re: [PATCH v2 3/4] apparmor: fix UUID specification

2025-01-07 Thread Georgia Garcia
On Mon, 2025-01-06 at 17:59 -0700, Jim Fehlig wrote: > On 11/13/24 07:28, Georgia Garcia wrote: > > There is a common misconception when writing AppArmor policy that > > [0-9]* applies * to the [0-9] class, but that's not the case. For this > > example, [0-9]* matches

[PATCH v3 4/4] virt-aa-helper: store dynamically generated rules

2025-01-07 Thread Georgia Garcia
labels, so that information is not removed from the set of rules while the domain is running. Closes: https://gitlab.com/libvirt/libvirt/-/issues/692 Signed-off-by: Georgia Garcia --- src/security/security_apparmor.c | 38 +++ src/security/virt-aa-h

[PATCH v3 3/4] apparmor: fix UUID specification

2025-01-07 Thread Georgia Garcia
-4-12. Signed-off-by: Georgia Garcia --- src/security/apparmor/usr.lib.libvirt.virt-aa-helper.in | 5 - src/security/apparmor/usr.sbin.libvirtd.in | 7 +-- src/security/apparmor/usr.sbin.virtqemud.in | 6 -- 3 files changed, 13 insertions(+), 5 deletions(-) diff --

[PATCH v3 2/4] security: replace uses of label and VIR_FREE by g_autofree

2025-01-07 Thread Georgia Garcia
Moving towards full adoption of GLib APIs in the AppArmor code. Signed-off-by: Georgia Garcia Reviewed-by: Jim Fehlig --- src/security/security_apparmor.c | 42 + src/security/virt-aa-helper.c| 100 ++- 2 files changed, 46 insertions(+), 96

[PATCH v3 1/4] security_apparmor: fix memleaks in AppArmorSetFDLabel

2025-01-07 Thread Georgia Garcia
proc and fd_path are allocated but never freed. Fix by using g_autofree instead. Fixes: b9757fea30785a92aa95ea675b9bc371e4fb2e8c Signed-off-by: Georgia Garcia Reviewed-by: Jim Fehlig --- src/security/security_apparmor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a

Re: [PATCH v2 0/4] fix AppArmor policy restore for runtime rules

2024-11-25 Thread Georgia Garcia
On Wed, 2024-11-13 at 11:28 -0300, Georgia Garcia wrote: > Some rules are generated dynamically during boot and added to the > AppArmor policy. An example of that is macvtap devices that call the > AppArmorSetFDLabel hook to add a rule for the tap device path. > > Since this

[PATCH v2 1/4] security_apparmor: fix memleaks in AppArmorSetFDLabel

2024-11-13 Thread Georgia Garcia
proc and fd_path are allocated but never freed. Fix by using g_autofree instead. Fixes: b9757fea30785a92aa95ea675b9bc371e4fb2e8c Signed-off-by: Georgia Garcia --- src/security/security_apparmor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/security

[PATCH v2 4/4] virt-aa-helper: store dynamically generated rules

2024-11-13 Thread Georgia Garcia
labels, so that information is not removed from the set of rules while the domain is running. Closes: https://gitlab.com/libvirt/libvirt/-/issues/692 Signed-off-by: Georgia Garcia --- src/security/security_apparmor.c | 38 +++ src/security/virt-aa-h

[PATCH v2 3/4] apparmor: fix UUID specification

2024-11-13 Thread Georgia Garcia
-4-12. Signed-off-by: Georgia Garcia --- src/security/apparmor/usr.lib.libvirt.virt-aa-helper.in | 5 - src/security/apparmor/usr.sbin.libvirtd.in | 7 +-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/security/apparmor/usr.lib.libvirt.virt-aa-helper.in

[PATCH v2 2/4] security: replace uses of label and VIR_FREE by g_autofree

2024-11-13 Thread Georgia Garcia
Moving towards full adoption of GLib APIs in the AppArmor code. Signed-off-by: Georgia Garcia --- src/security/security_apparmor.c | 41 - src/security/virt-aa-helper.c| 100 ++- 2 files changed, 45 insertions(+), 96 deletions(-) diff --git a/src

[PATCH v2 0/4] fix AppArmor policy restore for runtime rules

2024-11-13 Thread Georgia Garcia
ncluded by libvirt-uuid.files that already exists. It also includes other fixes like memory leaks, adoption of the GLib API in the apparmor files and a fix on the AppArmor policy that incorrectly applies apparmor policy syntax. Georgia Garcia (4): security_apparmor: fix memleaks in AppArmorSetFDLabel

Re: [PATCH] security_apparmor: store dynamically generated rules

2024-11-12 Thread Georgia Garcia
Hi Peter, On Mon, 2024-11-11 at 09:48 +0100, Peter Krempa wrote: > On Fri, Nov 08, 2024 at 15:58:35 -0300, Georgia Garcia wrote: > > Some rules are generated dynamically during boot and added to the > > AppArmor policy. An example of that is macvtap devices that call the > &g

[PATCH] security_apparmor: store dynamically generated rules

2024-11-08 Thread Georgia Garcia
peration. Note that there are no hooks for restoring FD labels, so that information is not removed from the set of rules while the domain is running. Closes: https://gitlab.com/libvirt/libvirt/-/issues/692 Signed-off-by: Georgia Garcia --- src/security/security_a

Re: [PATCH] virt-aa-helper: use 'include if exists' on .files

2024-06-10 Thread Georgia Garcia
On Mon, 2024-06-10 at 15:03 +0200, Michal Prívozník wrote: > On 6/4/24 19:34, Georgia Garcia wrote: > > Change the 'include' in the AppArmor policy to use 'include if exists' > > when including .files. Note that 'if exists' is only available > > a

[PATCH] virt-aa-helper: use 'include if exists' on .files

2024-06-04 Thread Georgia Garcia
ools like the following, since they expect the file to exist when using 'include': ERROR: Include file /etc/apparmor.d/libvirt/libvirt-8534a409-a460-4fab-a2dd-0e1dce4ff273.files not found Signed-off-by: Georgia Garcia --- src/security/virt-aa-helper.c | 7 ++- 1 file changed, 6