Skip to content

Commit 900f83c

Browse files
tweksteenpcmoore
authored andcommitted
selinux: ignore unknown extended permissions
When evaluating extended permissions, ignore unknown permissions instead of calling BUG(). This commit ensures that future permissions can be added without interfering with older kernels. Cc: [email protected] Fixes: fa1aa14 ("selinux: extended permissions for ioctls") Signed-off-by: Thiébaud Weksteen <[email protected]> Signed-off-by: Paul Moore <[email protected]>
1 parent 40384c8 commit 900f83c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

security/selinux/ss/services.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,10 @@ void services_compute_xperms_decision(struct extended_perms_decision *xpermd,
979979
return;
980980
break;
981981
default:
982-
BUG();
982+
pr_warn_once(
983+
"SELinux: unknown extended permission (%u) will be ignored\n",
984+
node->datum.u.xperms->specified);
985+
return;
983986
}
984987

985988
if (node->key.specified == AVTAB_XPERMS_ALLOWED) {
@@ -998,7 +1001,8 @@ void services_compute_xperms_decision(struct extended_perms_decision *xpermd,
9981001
&node->datum.u.xperms->perms,
9991002
xpermd->dontaudit);
10001003
} else {
1001-
BUG();
1004+
pr_warn_once("SELinux: unknown specified key (%u)\n",
1005+
node->key.specified);
10021006
}
10031007
}
10041008

0 commit comments

Comments
 (0)