]> git.baikalelectronics.ru Git - kernel.git/commit
evm: check hash algorithm passed to init_desc()
authorRoberto Sassu <roberto.sassu@huawei.com>
Wed, 29 May 2019 13:30:33 +0000 (15:30 +0200)
committerMimi Zohar <zohar@linux.ibm.com>
Thu, 30 May 2019 03:18:25 +0000 (23:18 -0400)
commit8c26fd5c65e29752892398edf88683fd59a2fed7
tree18f8246e67943de8fc8f5d9ebe2fcb927b8ed391
parent249bc42eb5505975f3509c6a60816a0b9f5d70a0
evm: check hash algorithm passed to init_desc()

This patch prevents memory access beyond the evm_tfm array by checking the
validity of the index (hash algorithm) passed to init_desc(). The hash
algorithm can be arbitrarily set if the security.ima xattr type is not
EVM_XATTR_HMAC.

Fixes: 5b2c4fb02b802 ("evm: Allow non-SHA1 digital signatures")
Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Cc: stable@vger.kernel.org
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
security/integrity/evm/evm_crypto.c