Skip to content

Commit 4b14752

Browse files
committed
selinux: skip bounded transition processing if the policy isn't loaded
We can't do anything reasonable in security_bounded_transition() if we don't have a policy loaded, and in fact we could run into problems with some of the code inside expecting a policy. Fix these problems like we do many others in security/selinux/ss/services.c by checking to see if the policy is loaded (ss_initialized) and returning quickly if it isn't. Reported-by: syzbot <[email protected]> Signed-off-by: Paul Moore <[email protected]> Acked-by: Stephen Smalley <[email protected]> Reviewed-by: James Morris <[email protected]>
1 parent ef28df5 commit 4b14752

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

security/selinux/ss/services.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,9 @@ int security_bounded_transition(u32 old_sid, u32 new_sid)
867867
int index;
868868
int rc;
869869

870+
if (!ss_initialized)
871+
return 0;
872+
870873
read_lock(&policy_rwlock);
871874

872875
rc = -EINVAL;

0 commit comments

Comments
 (0)