]> git.baikalelectronics.ru Git - kernel.git/commit
selinuxfs: unify policy load error reporting
authorOndrej Mosnacek <omosnace@redhat.com>
Thu, 18 Mar 2021 21:53:03 +0000 (22:53 +0100)
committerPaul Moore <paul@paul-moore.com>
Fri, 19 Mar 2021 03:26:59 +0000 (23:26 -0400)
commitfea7c50bd9bc47b7012f9f2b80c20d85e50560be
tree8838fb5084cd50ce46875f44e030807c13310f84
parentaac814fa5902a30d2049f4afb86dccc3d781fb8c
selinuxfs: unify policy load error reporting

Let's drop the pr_err()s from sel_make_policy_nodes() and just add one
pr_warn_ratelimited() call to the sel_make_policy_nodes() error path in
sel_write_load().

Changing from error to warning makes sense, since after 48840bdd243f
("selinux: move policy commit after updating selinuxfs"), this error
path no longer leads to a broken selinuxfs tree (it's just kept in the
original state and policy load is aborted).

I also added _ratelimited to be consistent with the other prtin in the
same function (it's probably not necessary, but can't really hurt...
there are likely more important error messages to be printed when
filesystem entry creation starts erroring out).

Suggested-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/selinuxfs.c