mcctrl_getrusage: validate os input
Change-Id: I97908069f8bc4703b99f9ffca94f3dd33eb64cc4
This commit is contained in:
committed by
Masamichi Takagi
parent
550c6cc5fb
commit
fe5d8fc71f
@ -2481,6 +2481,10 @@ long mcctrl_getrusage(ihk_os_t ihk_os, struct mcctrl_ioctl_getrusage_desc *__use
|
|||||||
unsigned long ut;
|
unsigned long ut;
|
||||||
unsigned long st;
|
unsigned long st;
|
||||||
|
|
||||||
|
if (!ihk_os || ihk_host_validate_os(ihk_os)) {
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
ret = copy_from_user(&desc, _desc, sizeof(struct mcctrl_ioctl_getrusage_desc));
|
ret = copy_from_user(&desc, _desc, sizeof(struct mcctrl_ioctl_getrusage_desc));
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
printk("%s: copy_from_user failed\n", __FUNCTION__);
|
printk("%s: copy_from_user failed\n", __FUNCTION__);
|
||||||
|
|||||||
Reference in New Issue
Block a user