Skip to content
This repository was archived by the owner on Jan 28, 2023. It is now read-only.

Commit 49eb94f

Browse files
committed
Fixed HAX_VCPU_IOCTL_SET_MSRS access type
Signed-off-by: Alexandro Sanchez Bach <[email protected]>
1 parent 548bd77 commit 49eb94f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

include/hax_interface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
#define HAX_VCPU_IOCTL_GET_MSRS \
158158
HAX_IOCTL(HAX_IOWR, 0x06, struct hax_msr_data)
159159
#define HAX_VCPU_IOCTL_SET_MSRS \
160-
HAX_IOCTL(HAX_IOW, 0x07, struct hax_msr_data)
160+
HAX_IOCTL(HAX_IOWR, 0x07, struct hax_msr_data)
161161
#define HAX_VCPU_IOCTL_INTERRUPT \
162162
HAX_IOCTL(HAX_IOW, 0x08, uint32_t)
163163
#define HAX_VCPU_IOCTL_DEBUG \

platforms/linux/components.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,10 @@ static long hax_vcpu_ioctl(struct file *filp, unsigned int cmd,
363363
}
364364
}
365365
msrs.done = i;
366+
if (copy_to_user(argp, &msrs, sizeof(msrs))) {
367+
ret = -EFAULT;
368+
break;
369+
}
366370
break;
367371
}
368372
case HAX_VCPU_IOCTL_GET_MSRS__LEGACY:

0 commit comments

Comments
 (0)