selinux: fix a missing-check bug in selinux_sb_eat_lsm_opts()
authorGen Zhang <blackgod016574@gmail.com>
Wed, 12 Jun 2019 13:55:38 +0000 (21:55 +0800)
committerPaul Moore <paul@paul-moore.com>
Wed, 12 Jun 2019 16:27:26 +0000 (12:27 -0400)
commitfec6375320c6399c708fa9801f8cfbf950fee623
tree6e5c0b51a8054b81ed768fbd5973d85661f0625e
parente2e0e09758a6f7597de0f9b819647addfb71b6bd
selinux: fix a missing-check bug in selinux_sb_eat_lsm_opts()

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

Signed-off-by: Gen Zhang <blackgod016574@gmail.com>
Fixes: 99dbbb593fe6 ("selinux: rewrite selinux_sb_eat_lsm_opts()")
Cc: <stable@vger.kernel.org>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/hooks.c