mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-01 23:05:11 +00:00
parser: Check for kernel support prior to processing dbus entries
When a parser that is aware of dbus rules is running under a kernel that is unaware of dbus rules, the parser should ignore the dbus rules instead of attempting to load them into the kernel. Otherwise, the kernel will reject the entire profile, leaving the application unconfined. Similar to what is done for mount rules, the features listed in apparmorfs should be checked to see if dbus is supported under the current kernel. Signed-off-by: Tyler Hicks <tyhicks@canonical.com> Acked-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
@@ -1157,14 +1157,18 @@ static int post_process_mnt_ents(Profile *prof)
|
||||
static int post_process_dbus_ents(Profile *prof)
|
||||
{
|
||||
int ret = TRUE;
|
||||
struct dbus_entry *entry;
|
||||
int count = 0;
|
||||
|
||||
list_for_each(prof->dbus_ents, entry) {
|
||||
if (!process_dbus_entry(prof->policy.rules, entry))
|
||||
ret = FALSE;
|
||||
count++;
|
||||
}
|
||||
if (prof->dbus_ents && kernel_supports_dbus) {
|
||||
struct dbus_entry *entry;
|
||||
|
||||
list_for_each(prof->dbus_ents, entry) {
|
||||
if (!process_dbus_entry(prof->policy.rules, entry))
|
||||
ret = FALSE;
|
||||
count++;
|
||||
}
|
||||
} else if (prof->dbus_ents && !kernel_supports_dbus)
|
||||
pwarn("profile %s dbus rules not enforced\n", prof->name);
|
||||
|
||||
prof->policy.count += count;
|
||||
return ret;
|
||||
|
Reference in New Issue
Block a user