]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
evm: Check size of security.evm before using it
authorRoberto Sassu <roberto.sassu@huawei.com>
Fri, 4 Sep 2020 09:23:30 +0000 (11:23 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 10 Dec 2020 11:02:33 +0000 (12:02 +0100)
commit8492c8e7f6597fa144c29cb621821ef74492a49f
treec91ce95aef6ecdc535a8e3e2d1ea61b3edfc95b0
parenta34056918ba1eeb367836dcbcc5b722be96a8b11
evm: Check size of security.evm before using it

BugLink: https://bugs.launchpad.net/bugs/1904445
commit 455b6c9112eff8d249e32ba165742085678a80a4 upstream.

This patch checks the size for the EVM_IMA_XATTR_DIGSIG and
EVM_XATTR_PORTABLE_DIGSIG types to ensure that the algorithm is read from
the buffer returned by vfs_getxattr_alloc().

Cc: stable@vger.kernel.org # 4.19.x
Fixes: 5feeb61183dde ("evm: Allow non-SHA1 digital signatures")
Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: William Breathitt Gray <william.gray@canonical.com>
security/integrity/evm/evm_main.c