Lines 26-31
Link Here
|
26 |
|
26 |
|
27 |
#include <linux/file.h> |
27 |
#include <linux/file.h> |
28 |
#include <linux/fs.h> |
28 |
#include <linux/fs.h> |
|
|
29 |
#include <linux/vmalloc.h> |
29 |
#include <linux/init.h> |
30 |
#include <linux/init.h> |
30 |
#if defined(__x86_64__) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12) |
31 |
#if defined(__x86_64__) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12) |
31 |
# include <linux/ioctl32.h> |
32 |
# include <linux/ioctl32.h> |
Lines 713-719
Link Here
|
713 |
|
714 |
|
714 |
case IOCTL_VMCI_INIT_CONTEXT: { |
715 |
case IOCTL_VMCI_INIT_CONTEXT: { |
715 |
VMCIInitBlock initBlock; |
716 |
VMCIInitBlock initBlock; |
716 |
VMCIHostUser user; |
717 |
uid_t user; |
717 |
|
718 |
|
718 |
retval = copy_from_user(&initBlock, (void *)ioarg, sizeof initBlock); |
719 |
retval = copy_from_user(&initBlock, (void *)ioarg, sizeof initBlock); |
719 |
if (retval != 0) { |
720 |
if (retval != 0) { |
Lines 736-742
Link Here
|
736 |
goto init_release; |
736 |
goto init_release; |
737 |
} |
737 |
} |
738 |
|
738 |
|
|
|
739 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) |
739 |
user = current_uid(); |
740 |
user = current_uid(); |
|
|
741 |
#else |
742 |
user = from_kuid(&init_user_ns, current_uid()); |
743 |
#endif |
740 |
retval = VMCIContext_InitContext(initBlock.cid, initBlock.flags, |
744 |
retval = VMCIContext_InitContext(initBlock.cid, initBlock.flags, |
741 |
0 /* Unused */, vmciLinux->userVersion, |
745 |
0 /* Unused */, vmciLinux->userVersion, |
742 |
&user, &vmciLinux->context); |
746 |
&user, &vmciLinux->context); |
Lines 1683-1689
Link Here
|
1683 |
/* This should be last to make sure we are done initializing. */ |
1684 |
/* This should be last to make sure we are done initializing. */ |
1684 |
retval = pci_register_driver(&vmci_driver); |
1685 |
retval = pci_register_driver(&vmci_driver); |
1685 |
if (retval < 0) { |
1686 |
if (retval < 0) { |
1686 |
vfree(data_buffer); |
1687 |
kvfree(data_buffer); |
1687 |
data_buffer = NULL; |
1688 |
data_buffer = NULL; |
1688 |
return retval; |
1689 |
return retval; |
1689 |
} |
1690 |
} |
Lines 2470-2476
Link Here
|
2470 |
|
2471 |
|
2471 |
if (guestDeviceInit) { |
2472 |
if (guestDeviceInit) { |
2472 |
pci_unregister_driver(&vmci_driver); |
2473 |
pci_unregister_driver(&vmci_driver); |
2473 |
vfree(data_buffer); |
2474 |
kvfree(data_buffer); |
2474 |
guestDeviceInit = FALSE; |
2475 |
guestDeviceInit = FALSE; |
2475 |
} |
2476 |
} |
2476 |
|
2477 |
|