]> git.baikalelectronics.ru Git - kernel.git/commit
selinux: fix return value on error in policydb_read()
authorOndrej Mosnacek <omosnace@redhat.com>
Fri, 1 May 2020 19:51:11 +0000 (21:51 +0200)
committerPaul Moore <paul@paul-moore.com>
Fri, 1 May 2020 20:08:46 +0000 (16:08 -0400)
commitaef223a92d411e451e13531392a19c2354d326ec
tree4efa8c85fa18e599d353f1d2e2df7f9e88a44540
parentbc9c38b2ff2e0d461aa8ee97fa0199a1a6614a8e
selinux: fix return value on error in policydb_read()

The value of rc is still zero from the last assignment when the error
path is taken. Fix it by setting it to -ENOMEM before the
hashtab_create() call.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 73fc7664fa8e ("selinux: store role transitions in a hash table")
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/ss/policydb.c