security: check for kstrdup() failure in lsm_append()
authorEric Biggers <ebiggers@google.com>
Tue, 17 Jul 2018 17:36:04 +0000 (10:36 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Sep 2018 06:38:09 +0000 (08:38 +0200)
commit55bdb77aa991c2dfd107c4805e334ad571f73a4f
tree6cd831a3a93499f84b12db1d1b868b211a7d030d
parentbdf948eaa5593f82bb3345e0432a5671091f487d
security: check for kstrdup() failure in lsm_append()

[ Upstream commit 87ea58433208d17295e200d56be5e2a4fe4ce7d6 ]

lsm_append() should return -ENOMEM if memory allocation failed.

Fixes: d69dece5f5b6 ("LSM: Add /sys/kernel/security/lsm")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: James Morris <james.morris@microsoft.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
security/security.c