2019-06-01 10:08:55 +02:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-15 16:49:28 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:13 -08:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2017-07-18 23:18:33 -07:00
|
|
|
|
2017-05-26 01:57:09 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:15 -08:00
|
|
|
|
2017-01-16 00:42:16 -08:00
|
|
|
|
2017-01-16 00:42:15 -08:00
|
|
|
|
2017-01-16 00:42:50 -08:00
|
|
|
|
2023-08-09 00:26:36 -07:00
|
|
|
|
2017-01-16 00:42:50 -08:00
|
|
|
|
2013-07-10 21:13:43 -07:00
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2013-02-18 16:01:34 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2013-02-18 16:01:34 -08:00
|
|
|
|
|
|
|
|
|
2019-12-17 15:40:41 -08:00
|
|
|
|
|
|
|
|
|
2013-02-18 16:01:34 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2022-03-26 01:46:18 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2013-07-10 21:07:43 -07:00
|
|
|
|
2013-07-10 21:06:43 -07:00
|
|
|
|
|
|
|
|
|
2023-07-23 02:30:33 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:12:43 -07:00
|
|
|
|
2019-12-17 15:40:41 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-04-01 15:51:41 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-16 07:07:53 -08:00
|
|
|
|
2025-04-01 15:51:41 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-16 07:07:53 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-04-28 05:32:52 -07:00
|
|
|
|
2012-02-16 07:07:53 -08:00
|
|
|
|
2022-08-26 08:53:42 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-16 03:33:43 -07:00
|
|
|
|
2025-04-01 15:51:41 -07:00
|
|
|
|
2022-01-17 13:43:49 -08:00
|
|
|
|
2012-02-16 07:07:53 -08:00
|
|
|
|
|
|
|
|
|
2023-04-28 05:32:52 -07:00
|
|
|
|
2020-11-19 10:37:48 -08:00
|
|
|
|
2025-04-01 15:51:41 -07:00
|
|
|
|
2023-04-28 05:32:52 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-19 10:37:48 -08:00
|
|
|
|
|
|
|
|
|
2023-07-23 02:30:33 -07:00
|
|
|
|
2022-07-16 01:53:46 -07:00
|
|
|
|
2022-01-17 13:43:49 -08:00
|
|
|
|
2022-07-16 01:53:46 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-15 16:49:28 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-29 17:17:31 -07:00
|
|
|
|
2022-09-05 20:47:36 -07:00
|
|
|
|
2022-07-29 17:17:31 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-04-28 05:32:52 -07:00
|
|
|
|
|
|
|
|
|
2022-07-29 17:17:31 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-02-17 01:46:37 -08:00
|
|
|
|
2022-07-29 17:17:31 -07:00
|
|
|
|
2022-09-05 20:47:36 -07:00
|
|
|
|
2022-07-29 17:17:31 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-04-28 05:32:52 -07:00
|
|
|
|
2022-07-29 17:17:31 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:07:43 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-29 17:17:31 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-02-16 03:40:52 -08:00
|
|
|
|
2017-05-22 03:06:52 -07:00
|
|
|
|
2022-07-29 17:17:31 -07:00
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2025-02-16 03:40:52 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:13:43 -07:00
|
|
|
|
|
|
|
|
|
2025-02-16 03:40:52 -08:00
|
|
|
|
2017-01-15 16:49:28 -08:00
|
|
|
|
2025-02-16 03:40:52 -08:00
|
|
|
|
2025-02-17 01:46:37 -08:00
|
|
|
|
2013-07-10 21:13:43 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:06:43 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-01-16 00:42:16 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:12:43 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2023-08-21 16:54:58 -07:00
|
|
|
|
2017-05-22 03:06:52 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2022-07-29 17:17:31 -07:00
|
|
|
|
2018-05-24 13:27:46 -07:00
|
|
|
|
2017-01-16 00:42:55 -08:00
|
|
|
|
2013-08-14 11:27:36 -07:00
|
|
|
|
2013-07-10 21:13:43 -07:00
|
|
|
|
|
|
|
|
|
2017-01-15 16:49:28 -08:00
|
|
|
|
2025-02-16 03:40:52 -08:00
|
|
|
|
2025-02-17 01:46:37 -08:00
|
|
|
|
2025-02-16 03:40:52 -08:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-26 01:45:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:15 -08:00
|
|
|
|
2022-09-05 20:47:36 -07:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
|
|
|
|
|
2022-10-03 02:48:24 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:11:43 -07:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-01-16 00:42:21 -08:00
|
|
|
|
|
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2017-01-16 00:42:24 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
2017-05-26 01:45:08 -07:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
|
|
|
|
|
2017-01-16 00:42:15 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2017-06-09 08:14:28 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
2022-07-29 17:17:31 -07:00
|
|
|
|
|
|
|
|
|
2019-05-26 06:42:23 -07:00
|
|
|
|
|
|
|
|
|
2023-04-28 05:32:52 -07:00
|
|
|
|
2019-05-26 06:42:23 -07:00
|
|
|
|
2023-04-28 05:32:52 -07:00
|
|
|
|
|
|
|
|
|
2019-05-26 06:42:23 -07:00
|
|
|
|
|
|
|
|
|
2024-10-12 04:43:34 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
apparmor: add fine grained af_unix mediation
Extend af_unix mediation to support fine grained controls based on
the type (abstract, anonymous, fs), the address, and the labeling
on the socket.
This allows for using socket addresses to label and the socket and
control which subjects can communicate.
The unix rule format follows standard apparmor rules except that fs
based unix sockets can be mediated by existing file rules. None fs
unix sockets can be mediated by a unix socket rule. Where The address
of an abstract unix domain socket begins with the @ character, similar
to how they are reported (as paths) by netstat -x. The address then
follows and may contain pattern matching and any characters including
the null character. In apparmor null characters must be specified by
using an escape sequence \000 or \x00. The pattern matching is the
same as is used by file path matching so * will not match / even
though it has no special meaning with in an abstract socket name. Eg.
allow unix addr=@*,
Autobound unix domain sockets have a unix sun_path assigned to them by
the kernel, as such specifying a policy based address is not possible.
The autobinding of sockets can be controlled by specifying the special
auto keyword. Eg.
allow unix addr=auto,
To indicate that the rule only applies to auto binding of unix domain
sockets. It is important to note this only applies to the bind
permission as once the socket is bound to an address it is
indistinguishable from a socket that have an addr bound with a
specified name. When the auto keyword is used with other permissions
or as part of a peer addr it will be replaced with a pattern that can
match an autobound socket. Eg. For some kernels
allow unix rw addr=auto,
It is important to note, this pattern may match abstract sockets that
were not autobound but have an addr that fits what is generated by the
kernel when autobinding a socket.
Anonymous unix domain sockets have no sun_path associated with the
socket address, however it can be specified with the special none
keyword to indicate the rule only applies to anonymous unix domain
sockets. Eg.
allow unix addr=none,
If the address component of a rule is not specified then the rule
applies to autobind, abstract and anonymous sockets.
The label on the socket can be compared using the standard label=
rule conditional. Eg.
allow unix addr=@foo peer=(label=bar),
see man apparmor.d for full syntax description.
Signed-off-by: John Johansen <john.johansen@canonical.com>
2022-09-07 12:46:30 -07:00
|
|
|
|
2022-07-29 17:17:31 -07:00
|
|
|
|
2024-10-12 04:43:34 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-18 23:18:33 -07:00
|
|
|
|
|
|
|
|
|
2024-10-12 04:43:34 -07:00
|
|
|
|
2023-10-27 10:31:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-03-01 16:10:51 -08:00
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:06:43 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-03-01 16:10:51 -08:00
|
|
|
|
2013-07-10 21:06:43 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-03-01 16:10:51 -08:00
|
|
|
|
2013-07-10 21:06:43 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-10 21:10:43 -07:00
|
|
|
|
2026-03-01 16:10:51 -08:00
|
|
|
|
2013-07-10 21:08:43 -07:00
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-19 20:48:48 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
apparmor: fix unprivileged local user can do privileged policy management
An unprivileged local user can load, replace, and remove profiles by
opening the apparmorfs interfaces, via a confused deputy attack, by
passing the opened fd to a privileged process, and getting the
privileged process to write to the interface.
This does require a privileged target that can be manipulated to do
the write for the unprivileged process, but once such access is
achieved full policy management is possible and all the possible
implications that implies: removing confinement, DoS of system or
target applications by denying all execution, by-passing the
unprivileged user namespace restriction, to exploiting kernel bugs for
a local privilege escalation.
The policy management interface can not have its permissions simply
changed from 0666 to 0600 because non-root processes need to be able
to load policy to different policy namespaces.
Instead ensure the task writing the interface has privileges that
are a subset of the task that opened the interface. This is already
done via policy for confined processes, but unconfined can delegate
access to the opened fd, by-passing the usual policy check.
Fixes: b7fd2c0340eac ("apparmor: add per policy ns .load, .replace, .remove interface files")
Reported-by: Qualys Security Advisory <qsa@qualys.com>
Tested-by: Salvatore Bonaccorso <carnil@debian.org>
Reviewed-by: Georgia Garcia <georgia.garcia@canonical.com>
Reviewed-by: Cengiz Can <cengiz.can@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
2025-11-07 08:36:04 -08:00
|
|
|
|
2020-06-30 17:00:11 -07:00
|
|
|
|
|
|
|
|
|
2010-07-29 14:48:00 -07:00
|
|
|
|
|
|
|
|
|