SELinuxProject/cil

evaluate_level_expression is called without checking if a userrole statement exists

Opened this issue · 0 comments

My custom policy which is missing a userrole statement, is falling through to code that is dereferencing a user. This causes a segfault in evaluate_level_expression when running ./secilc test.cil

See below:

(user system_u)
(sid kernel)
(sidorder (kernel))
(sidcontext kernel (system_u system_r kernel_t ((s0) high)))
(role system_r)
(type kernel_t)
(sensitivity s0)
(sensitivity s3)
(sensitivityorder (s0 s3))
(category c0)
(category c3)
(categoryorder (c0 c3))
(level high (s3 (range c0 c3)))
(filecon "/usr/bin/bbb" any (system_u system_r kernel_t ((s0 (c0)) high)))