]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selinux: fix memory leak in policydb_init()
authorOndrej Mosnacek <omosnace@redhat.com>
Thu, 25 Jul 2019 10:52:43 +0000 (12:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 6 Aug 2019 16:28:28 +0000 (18:28 +0200)
commitb65cc16ce2a77793aab81b6fc29f6caf4ee3728a
tree5ca11bcd1bf4eb2a1e2bf046679cf531a722d149
parent1579cc8253b72f17fe56960c0f4a020c149870bd
selinux: fix memory leak in policydb_init()

commit 45385237f65aeee73641f1ef737d7273905a233f upstream.

Since roles_init() adds some entries to the role hash table, we need to
destroy also its keys/values on error, otherwise we get a memory leak in
the error path.

Cc: <stable@vger.kernel.org>
Reported-by: syzbot+fee3a14d4cdf92646287@syzkaller.appspotmail.com
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
security/selinux/ss/policydb.c