]> git.ipfire.org Git - people/arne_f/kernel.git/commit
selinux: fix a missing-check bug in selinux_add_mnt_opt( )
authorGen Zhang <blackgod016574@gmail.com>
Wed, 12 Jun 2019 13:28:21 +0000 (21:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Jun 2019 06:00:01 +0000 (08:00 +0200)
commitea9a004020c96178f1307019c689d5f588414850
treea4370c8f720d9c4bf24b6dc51ec564195c89d49e
parentbc690120360b8e56a056dc031b2d29f713910686
selinux: fix a missing-check bug in selinux_add_mnt_opt( )

commit e2e0e09758a6f7597de0f9b819647addfb71b6bd upstream.

In selinux_add_mnt_opt(), 'val' is allocated by kmemdup_nul(). It returns
NULL when fails. So 'val' should be checked. And 'mnt_opts' should be
freed when error.

Signed-off-by: Gen Zhang <blackgod016574@gmail.com>
Fixes: 757cbe597fe8 ("LSM: new method: ->sb_add_mnt_opt()")
Cc: <stable@vger.kernel.org>
[PM: fixed some indenting problems]
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
security/selinux/hooks.c