Message ID | 4f91be7b-a983-de6c-1f79-5266dcf5157e@users.sourceforge.net (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/security/integrity/ima/ima_fs.c b/security/integrity/ima/ima_fs.c index c1c8d34d111d..98304411915d 100644 --- a/security/integrity/ima/ima_fs.c +++ b/security/integrity/ima/ima_fs.c @@ -315,15 +315,14 @@ static ssize_t ima_write_policy(struct file *file, const char __user *buf, char *data; ssize_t result; - if (datalen >= PAGE_SIZE) - datalen = PAGE_SIZE - 1; - /* No partial writes. */ result = -EINVAL; if (*ppos != 0) goto reset_validity; result = -ENOMEM; + if (datalen >= PAGE_SIZE) + datalen = PAGE_SIZE - 1; data = kmalloc(datalen + 1, GFP_KERNEL); if (!data) goto reset_validity;