]> git.baikalelectronics.ru Git - kernel.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)
committerPaul Moore <paul@paul-moore.com>
Wed, 31 Jul 2019 20:51:23 +0000 (16:51 -0400)
commitc866deb05d827906190e6e98f623990f147e3c69
tree65811d436422e22f71de033f255bf732fb19024b
parent90f0d2323b09aac58d53e01a2b5d9d6d576e060f
selinux: fix memory leak in policydb_init()

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>
security/selinux/ss/policydb.c