security/integrity: Harden against malformed xattrs
In general the handling of IMA/EVM xattrs is good, but I found a few locations where either the xattr size or the value of the type field in the xattr are not checked. Add a few simple checks to these locations to prevent malformed or malicious xattrs from causing problems. Signed-off-by: Seth Forshee <seth.forshee@canonical.com> Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
This commit is contained in:
@@ -51,7 +51,7 @@ static bool init_keyring __initdata;
|
||||
int integrity_digsig_verify(const unsigned int id, const char *sig, int siglen,
|
||||
const char *digest, int digestlen)
|
||||
{
|
||||
if (id >= INTEGRITY_KEYRING_MAX)
|
||||
if (id >= INTEGRITY_KEYRING_MAX || siglen < 2)
|
||||
return -EINVAL;
|
||||
|
||||
if (!keyring[id]) {
|
||||
|
Reference in New Issue
Block a user