EVM: prevent array underflow in evm_write_xattrs()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 29 May 2018 13:11:28 +0000 (16:11 +0300)
committerMimi Zohar <zohar@linux.vnet.ibm.com>
Thu, 31 May 2018 14:13:24 +0000 (10:13 -0400)
commita41d80acfa2764e9b1ce49aa303a263e609d91f7
tree245f661c84f72a7f4dcb787f798c771971ac79ea
parent72acd64df4561593d2ec3227b4aca9b0d7ded50e
EVM: prevent array underflow in evm_write_xattrs()

If the user sets xattr->name[0] to NUL then we would read one character
before the start of the array.  This bug seems harmless as far as I can
see but perhaps it would trigger a warning in KASAN.

Fixes: fa516b66a1bf ("EVM: Allow runtime modification of the set of verified xattrs")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
security/integrity/evm/evm_secfs.c