2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-28 12:58:07 +00:00

8146 Commits

Author SHA1 Message Date
Christian Boltz
ef25cb160f
remmina: add audit flag for writing autostart file
... as discussed in https://gitlab.com/apparmor/apparmor/-/merge_requests/1603
2025-04-05 14:22:22 +02:00
John Johansen
bc067f8a8f Merge fusermount3: drop obsolete comment
The comment was introduced in
https://gitlab.com/apparmor/apparmor/-/merge_requests/1562, but
aa-logprof now understands these mount rules (since
https://gitlab.com/apparmor/apparmor/-/merge_requests/1565)

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1613
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-04-05 09:41:55 +00:00
John Johansen
2df4bbd39b Merge parser: add special casing for detached move mounts
upsteam move_mount mediation now allows for a detached (disconnected)
mount to be move mounted into a namespace.

Add support for this by detecting 'detached' as a keyword for the
source/device and using it to create a null match. Because existing
mount encoding using a null separator between the mount terms null
match followed by the null seperator will separate detached mounts
within the existing encoding.

```
Eg.
  mount detached -> /destination,
  mount options=(ro) fstype=ext4 detached -> /destination,
```

This is functionally equivalent to using
```
  mount "" -> /destination,
```
However using ```""``` does not provide any context that about what the rule is allowing or why so the ```detached``` form is preferred.

This is not a perfect solution, but is what can be currently supported
by the kernel without more LSM hooks.

On kernels that don't support detached mount detection, rules using
the detached source conditional will be ignored (never matched).

This encoding also allows the existing

```
  mount,
  mount options=(move),
  mount options=(move) -> /destination,
```

to continue to work with both detached and regular mounts on kernels
that support the move_mount() syscall.

Signed-off-by: John Johansen <john.johansen@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1561
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-04-05 08:26:33 +00:00
John Johansen
2b9f2d2cb7 utils: tests: mark detached mount as tools wrong
The tools are wrong in parsing the detached mount test.

Until that can be fixed, mark the tools as wrong.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2025-04-05 00:19:09 -07:00
Ryan Lee
63857a7972 parser: add a detached mount equality test
Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2025-04-05 00:19:09 -07:00
Ryan Lee
315d999013 parser: add detached move mounts to simple tests
Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2025-04-05 00:19:09 -07:00
Ryan Lee
d4f75cec2b regression: uncomment the detached keyword mount tests
Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2025-04-05 00:19:09 -07:00
John Johansen
fa0746f2e2 parser: add special casing for detached move mounts
upsteam move_mount mediation now allows for a detached (disconnected)
mount to be move mounted into a namespace.

Add support for this by detecting 'detached' as a keyword for the
source/device and using it to create a null match. Because existing
mount encoding using a null separator between the mount terms null
match followed by the null seperator will separate detached mounts
within the existing encoding.

Eg.
  mount detached -> /destination,
  mount options=(ro) fstype=ext4 detached -> /destination,

This is functionally equivalent to using

  mount "" -> /destination,

However using "" does not provide any context that about what the rule is allowing or why so the 'detached' form is preferred.

This is not a perfect solution, but is what can be currently supported
by the kernel without more LSM hooks.

On kernels that don't support detached mount detection, rules using
the detached souce conditional will be ignored (never matched).

This encoding also allows the existing

  mount,
  mount options=(move),
  mount options=(move) -> /destination,

to continue to work with both detached and regular mounts on kernels
that support the move_mount() syscall.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2025-04-05 00:19:09 -07:00
John Johansen
e4943576d5 Merge tests: regression: mark disconnected-complain-mode tests as xpass
Without the kernel patches in
https://lists.ubuntu.com/archives/apparmor/2025-March/013533.html
these tests will fail. This means spread ci for the majority of
kernels will fail.

Indeed disconnected paths failing in complain mode was always expected
behavior until the above kernel patches were posted.

Instead mark these patches as xpass, so spread CI can pass. These
tests will need to be updated to make them detect if the kernel
supports complain mode with disconnected paths.

Fixes: 089539cbf Merge regression: test complain-mode operations on disconnected paths in mounts
Signed-off-by: John Johansen <john.johansen@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1614
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-04-05 07:15:37 +00:00
John Johansen
1aca4a1dcf tests: regression: mark disconnected-complain-mode tests as xpass
Without the kernel patches in
https://lists.ubuntu.com/archives/apparmor/2025-March/013533.html
these tests will fail. This means spread ci for the majority of
kernels will fail.

Indeed disconnected paths failing in complain mode was always expected
behavior until the above kernel patches were posted.

Instead mark these patches as xpass, so spread CI can pass. These
tests will need to be updated to make them detect if the kernel
supports complain mode with disconnected paths.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2025-04-04 23:42:41 -07:00
John Johansen
ddd9af1aec Merge Fix warnings and errors from Remmina profile
Signed-off-by: Paulo Flabiano Smorigo <pfsmorigo@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1603
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-04-04 21:54:24 +00:00
John Johansen
0d6e447d24 Merge usr.bin.passwd profile fixes
* passwd -e LOGIN was failing
* Allow execution of /usr/sbin/nscd
  See: bee77ffc29/lib/nscd.c (L23-L27)
* Allow pam_passwdqc to read /etc/passwdqc.conf and passwdqc filter
  files (see https://www.openwall.com/passwdqc/)
* Allow setuid & fsetid capabilities
* Allow locking with /etc/shadow.PID & /etc/shadow.lock
* Allow shadow backup /etc/shadow- and whatever /etc/shadow+ is used for

Example failures:

```
type=AVC msg=audit(1740926750.381:99876): apparmor="DENIED" operation="capable" profile="/usr/bin/passwd" pid=16139 comm="passwd" capability=4  capname="fsetid"
type=AVC msg=audit(1740926025.892:99797): apparmor="DENIED" operation="capable" profile="/usr/bin/passwd" pid=14443 comm="passwd" capability=7  capname="setuid"
type=AVC msg=audit(1740926673.852:99871): apparmor="DENIED" operation="link" profile="/usr/bin/passwd" name="/etc/shadow.lock" pid=15961 comm="passwd" requested_mask="r" denied_mask="r" fsuid=0 ouid=0 target="/etc/shadow.15961"FSUID="root" OUID="root"
type=AVC msg=audit(1740926025.892:99798): apparmor="DENIED" operation="mknod" profile="/usr/bin/passwd" name="/etc/shadow.14443" pid=14443 comm="passwd" requested_mask="c" denied_mask="c" fsuid=0 ouid=0FSUID="root" OUID="root"
type=AVC msg=audit(1740926502.637:99859): apparmor="DENIED" operation="open" profile="/usr/bin/passwd" name="/etc/shadow-" pid=15555 comm="passwd" requested_mask="wc" denied_mask="wc" fsuid=0 ouid=0FSUID="root" OUID="root"
type=AVC msg=audit(1740926820.608:99882): apparmor="DENIED" operation="rename_src" profile="/usr/bin/passwd" name="/etc/shadow+" pid=16275 comm="passwd" requested_mask="r" denied_mask="r" fsuid=0 ouid=0FSUID="root" OUID="root"
```

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1566
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-04-04 21:49:15 +00:00
John Johansen
3740f78c11 profiles: Fix remmina profile
Two fixes for the remmina profile so we can merge this
1. mknod is not currently an allowed permission. It has to be
   downgraded to w
   Do that with a note about how this needs to change in the future

2. The original fix adds direct references to peer=(label=unconfined)
   Fix this to use a variable. So it will be easier to refactor and
   update.
   While doing it for the PMR also fixup the other direct unconfined
   references.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2025-04-04 14:34:10 -07:00
John Johansen
089539cbfc Merge regression: test complain-mode operations on disconnected paths in mounts
Disconnected paths on lookups have caused actual permission denials, even
when the loaded profile is in complain mode. This is a test that causes
disconnections using mounts (both old and new API) and then verifies that
a complain mode profile doesn't prevent operations with disconnected fds.

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1568
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-04-04 21:13:04 +00:00
John Johansen
377753b5bf Merge Fixes for wpa_supplicant profile based on LP: #2098838
Representative log lines from the [LaunchPad bug](https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/2098838):

```
Feb 19 16:34:01 kernel: audit: type=1400 audit(1740000841.920:621): apparmor="DENIED" operation="create" class="net" profile="wpa_supplicant" pid=2211 comm="wpa_supplicant" family="netlink" sock_type="raw" protocol=0 requested="create" denied="create"
Feb 19 16:34:01 kernel: audit: type=1400 audit(1740000841.920:622): apparmor="DENIED" operation="open" class="file" profile="wpa_supplicant" name="/sys/devices/pci0000:00/0000:00:14.3/ieee80211/phy0/name" pid=2211 comm="wpa_supplicant" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
Feb 19 16:34:01 kernel: audit: type=1400 audit(1740000841.920:623): apparmor="DENIED" operation="create" class="net" profile="wpa_supplicant" pid=2211 comm="wpa_supplicant" family="inet" sock_type="dgram" protocol=0 requested="create" denied="create"
Feb 19 16:34:01 kernel: audit: type=1400 audit(1740000841.920:624): apparmor="DENIED" operation="open" class="file" profile="wpa_supplicant" name="/sys/devices/pci0000:00/0000:00:14.3/ieee80211/phy0/name" pid=2211 comm="wpa_supplicant" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
```

However, regression potential remains for other setups (e.g. USB WiFi dongles), and we should maybe open up a discussion about when we want to target profiles into `apparmor.d` as opposed to `extras`.

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1554
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-04-04 21:09:51 +00:00
Christian Boltz
4c8ae4760b
fusermount3: drop obsolete comment
The comment was introduced in
https://gitlab.com/apparmor/apparmor/-/merge_requests/1562, but
aa-logprof now understands these mount rules (since
https://gitlab.com/apparmor/apparmor/-/merge_requests/1565)
2025-04-04 21:15:55 +02:00
John Johansen
abe588cea4 Merge utils: skip user config reading in aa-notify when --configdir is given
--configdir is meant for testing and should override all other configs,
instead of being combined with them. Config combination causes aa-notify
test failures if e.g. the user-local config sets filtering options.

Also supply a notify.conf file for exclusive use during testing.

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1610
Approved-by: Georgia Garcia <georgia.garcia@canonical.com>
Merged-by: John Johansen <john@jjmx.net>
2025-04-03 21:36:48 +00:00
John Johansen
69355d41f7 Merge libapparmor: fix feature matching for aa_feature_supports
The feature matching done in aa_feature_supports calls walk_one to
traverse the features string. This function is supposed to match on
the feature and return, but it matches the feature based on the length
of the feature to check. If the feature to check shorter, then it
would return as if the feature was not present - which was the case
for the following example:

feature_file contains (shortened for example purposes):

```
network_v9 {af_unix {yes
}
}
network_v8 {af_inet {yes
}
}
network {af_unix {yes
}
}
```

if the feature to be checked was simply "network", then walk_one would
return that the feature was not present.

Fix this by restarting the matching if there was not a full match at
the end of the feaure to check.

Fixes: https://bugs.launchpad.net/apparmor/+bug/2105986

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1608
Approved-by: Ryan Lee <rlee287@yahoo.com>
Merged-by: John Johansen <john@jjmx.net>
2025-04-03 19:39:23 +00:00
John Johansen
65e2cfa4e3 Merge utils: add unprivileged_userns to aa-notify list of special profiles
Both the unconfined profile and unprivileged_userns are part of the
default notify.conf, so the default fallback when no configurations are
present should also match this default.

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1609
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-04-03 19:37:08 +00:00
Ryan Lee
e949653b1a utils: supply a notify.conf for aa-notify tests
Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2025-04-03 12:20:10 -07:00
Ryan Lee
096c8df52b utils: skip user config reading in aa-notify when --configdir is given
--configdir is meant for testing and should override all other configs,
instead of being combined with them. Config combination causes aa-notify
test failures if e.g. the user-local config sets filtering options.

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2025-04-03 12:17:25 -07:00
Ryan Lee
4623da695e utils: add unprivileged_userns to aa-notify list of special profiles
Both the unconfined profile and unprivileged_userns are part of the
default notify.conf, so the default fallback when no configurations are
present should also match this default.

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2025-04-02 16:48:01 -07:00
Georgia Garcia
7243029359 libapparmor: fix feature matching for aa_feature_supports
The feature matching done in aa_feature_supports calls walk_one to
traverse the features string. This function is supposed to match on
the feature and return, but it matches the feature based on the length
of the feature to check. If the feature to check shorter, then it
would return as if the feature was not present - which was the case
for the following example:

feature_file contains (shortened for example purposes):

network_v9 {af_unix {yes
}
}
network_v8 {af_inet {yes
}
}
network {af_unix {yes
}
}

if the feature to be checked was simply "network", then walk_one would
return that the feature was not present.

Fix this by restarting the matching if there was not a full match at
the end of the feaure to check.

Fixes: https://bugs.launchpad.net/apparmor/+bug/2105986

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2025-04-02 15:26:45 -03:00
John Johansen
3b3dada5d9 Merge util: enhance AARE file path validation
Fixes https://bugs.launchpad.net/apparmor/+bug/2106033

Improve the validation of AARE file paths by introducing a new regex
that supports paths starting with '{' (e.g. '{/,/org/freedesktop/DBus}').
These paths are notably used in snap.lxd.* profiles.

Signed-off-by: Maxime Bélair <maxime.belair@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1607
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-04-02 18:03:09 +00:00
John Johansen
0d1c694a66 Merge profiles: allow fusermount3 to mount in directories used by flatpak (LP: 2100295)
These are the default directory mounts used by Flatpak's system cache for mounting revokefs-fuse. Unfortunately, the new rules are quite broad, but we might not be able to do much better than that.

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1562
Approved-by: Georgia Garcia <georgia.garcia@canonical.com>
Merged-by: John Johansen <john@jjmx.net>
2025-04-02 17:54:13 +00:00
John Johansen
a54e4e2cf9 Merge parser: equality test fixups
The original location of the error count checks in the middle of the priority function helper was completely nonsensical. We can instead do this check just once after running all the tests.

In addition, some tests in the priority helper don't use the priority variables at all, and are moved out of the helper to avoid repeating the exact same sequence of tests 16 times.

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1604
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-04-02 17:53:15 +00:00
Ryan Lee
6da10ef98f parser: move equality tests not using priorities outside of priority helper
Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2025-04-02 10:10:03 -07:00
Ryan Lee
1f32c1175e parser: move error count print of equality tesets to run_tests end
The original location in the middle of the priority function helper was
completely nonsensical. We can instead do this check just once after
running all the tests.

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2025-04-02 10:10:03 -07:00
Maxime Bélair
dbf4c27154 util: enhance AARE file path validation
Fixes https://bugs.launchpad.net/apparmor/+bug/2106033

Improve the validation of AARE file paths by introducing a new regex
that supports paths starting with '{' (e.g. '{/,/org/freedesktop/DBus}').
These paths are notably used in snap.lxd.* profiles.

Signed-off-by: Maxime Bélair <maxime.belair@canonical.com>
2025-04-02 18:32:03 +02:00
Maxime Bélair
ca0b695c0c Merge Fix lsblk profile for disks over network
Fixes: https://bugs.launchpad.net/maas/+bug/2092232

In the lsblk profile, the rule responsible for allowing to read disks
over network was not generic enough to handle some cases, such as IBM
Power. The new rule, `@{sys}/devices/**/host@{int}/** r`, should support
all cases.

Signed-off-by: Maxime Bélair <maxime.belair@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1606
Approved-by: Georgia Garcia <georgia.garcia@canonical.com>
Approved-by: Alex <alexandre@pujol.io>
Merged-by: Maxime Bélair <maxime.belair@canonical.com>
2025-04-02 13:49:47 +00:00
Maxime Bélair
d1108183a7 Fix lsblk profile for disks over network
Fixes: https://bugs.launchpad.net/maas/+bug/2092232

In the lsblk profile, the rule responsible for allowing to read disks
over network was not generic enough to handle some cases, such as IBM
Power. The new rule, `@{sys}/devices/**/host@{int}/** r`, should support
all cases.

Signed-off-by: Maxime Bélair <maxime.belair@canonical.com>
2025-04-02 13:31:37 +02:00
John Johansen
305ef867fb Merge utils: fix cleanprof recursion error when child is defined out of parent
If the following scenario was present in a profile, cleanprof
would fail with a RecursionError exception (maximum recursion
depth exceeded)

/parent { }
/parent///child { }

This occured because in aa.py, in the write_piece function, the
wrong depth was being passed, along with a wrong hat. The
formatting of the spaces was also incorrect.

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1605
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2025-04-01 21:03:56 +00:00
John Johansen
60218409cc Merge logprof: add /usr prefixed kernel module path to config for /usr merge
Signed-off-by: Ryan Lee <ryan.lee@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1598
Approved-by: Christian Boltz <apparmor@cboltz.de>
Merged-by: John Johansen <john@jjmx.net>
2025-04-01 20:51:53 +00:00
Georgia Garcia
f0c96c0d68 utils: fix cleanprof recursion error when child is defined out of parent
If the following scenario was present in a profile, cleanprof
would fail with a RecursionError exception (maximum recursion
depth exceeded)

/parent { }
/parent///child { }

This occured because in aa.py, in the write_piece function, the
wrong depth was being passed, along with a wrong hat. The
formatting of the spaces was also incorrect.

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2025-04-01 16:48:24 -03:00
Georgia Garcia
f490480558 utils: add parent to external child profiles
Profiles that are defined like below did not have the parent attribute
set in profile storage:

/parent///child {}

The condition on which child profiles were written was also changed so
they are not removed from the profile if /parent does not exist.

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2025-04-01 16:46:16 -03:00
Paulo Flabiano Smorigo
ee3dfb4a5d
Fix warnings and errors from Remmina profile
Signed-off-by: Paulo Flabiano Smorigo <pfsmorigo@canonical.com>
2025-04-01 14:18:24 -03:00
Christian Boltz
c1dcc44201 Merge utils: fix cleanprof regression on header generation
Commit c9d41a3ebb introduced a regression on profile header
generation.

This commit removes the name parameter from the get_header function
since the ProfileStorage should already contain all the information
required to generate the header for profiles and hats. The tests
needed to be updated as well to make sure the ProfileStorage object
contained the information needed by the get_header method.

Fixes: c9d41a3ebb ("utils: fix profile and hat header generation")
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1602
Approved-by: Christian Boltz <apparmor@cboltz.de>
Merged-by: Christian Boltz <apparmor@cboltz.de>
2025-03-31 20:42:43 +00:00
Christian Boltz
4c3954f13d test-cleanprof: add tests for external child profiles 2025-03-31 15:50:15 -03:00
Georgia Garcia
699d7b5c83 utils: fix cleanprof regression on header generation
Commit c9d41a3ebb introduced a regression on profile header
generation.

This commit removes the name parameter from the get_header function
since the ProfileStorage should already contain all the information
required to generate the header for profiles and hats. The tests
needed to be updated as well to make sure the ProfileStorage object
contained the information needed by the get_header method.

Fixes: c9d41a3ebb ("utils: fix profile and hat header generation")
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2025-03-31 15:50:15 -03:00
Christian Boltz
fda4f8140f Merge Fix attach_disconnected typo in docs
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1599
Approved-by: Christian Boltz <apparmor@cboltz.de>
Merged-by: Christian Boltz <apparmor@cboltz.de>
2025-03-28 12:28:48 +00:00
Tim McCormack
b398ec61c9 Fix attach_disconnected typo in docs 2025-03-27 19:30:25 -04:00
Ryan Lee
372dcc8250 logprof: add /usr prefixed kernel module path to config for /usr merge
Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2025-03-27 09:50:11 -07:00
Georgia Garcia
eaec0aa9d2 Merge utils: fix profile header generation
Profile header was being generated incorrectly in 2 cases:
When the profile contained the parent profile in its name, as in

profile firefox//dash {

and in the unit tests, the child profile was being named as the parent
profile. This was not caught by the general case because the code has
not yet been fully adapted to handle multiple nested child profiles.

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/493

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>

Closes #493
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1592
Approved-by: Ryan Lee <rlee287@yahoo.com>
Approved-by: Christian Boltz <apparmor@cboltz.de>
Merged-by: Georgia Garcia <georgia.garcia@canonical.com>
2025-03-26 14:28:36 -03:00
Georgia Garcia
3516dcaa30 Merge ci: upgrade all packages in CI
We are seeing some test failures caused by the fact that a fixed kernel,
while available, is not installed the CI image. Since cloud-init does
not itself offer a way to express precise dependency on a package
version we may use a crude replacement of upgrading all the packages at
image construction time.

The next time this happens all we need is to touch the .image-garden.mk
file, so that it is more recent than the image kept in CI cache for the
re-generation to occur.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1595
Approved-by: Georgia Garcia <georgia.garcia@canonical.com>
Merged-by: Georgia Garcia <georgia.garcia@canonical.com>
2025-03-26 10:20:17 -03:00
Zygmunt Krynicki
f43221d945 ci: upgrade all packages in CI
We are seeing some test failures caused by the fact that a fixed kernel,
while available, is not installed the CI image. Since cloud-init does
not itself offer a way to express precise dependency on a package
version we may use a crude replacement of upgrading all the packages at
image construction time.

The next time this happens all we need is to touch the .image-garden.mk
file, so that it is more recent than the image kept in CI cache for the
re-generation to occur.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
2025-03-26 14:00:33 +01:00
Georgia Garcia
c9d41a3ebb utils: fix profile and hat header generation
The header was being generated incorrectly in 2 cases:
When the profile/hat contained the parent profile in its name, as in

profile firefox//dash {
hat ^firefox//dash {

and in the unit tests, the child profile or hat was being named as the
parent profile. This was not caught by the general case because the
code has not yet been fully adapted to handle multiple nested child
profiles.

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/493

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2025-03-26 09:53:08 -03:00
Georgia Garcia
ef2f6aa565 Merge profiles: allow fusermount3 to (u)mount nested subdirs of @{run}/user/@{uid}
This is needed to fix the gnome-remote-desktop daemon, which mounts in a
directory like /run/user/119/gnome-remote-desktop/cliprdr-ABm0Gd/.

Fixes: https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/2103889

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1591
Approved-by: Georgia Garcia <georgia.garcia@canonical.com>
Merged-by: Georgia Garcia <georgia.garcia@canonical.com>
2025-03-24 17:04:32 -03:00
Ryan Lee
04ff259668 regression: remove unneeded headers from move_mount.c
Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2025-03-24 12:58:00 -07:00
Ryan Lee
40e07b4561 regression: move new mount syscall defs to shared header and test for necessity
Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2025-03-24 12:58:00 -07:00
Ryan Lee
1f08b5125d regression: add disconnected_mount_complain to spread test yaml
The test is added as XFAIL for all images because the kernel patches
required for them to pass have not yet been upstreamed into any published
kernel.

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2025-03-24 12:57:40 -07:00