Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 266795
Collapse All | Expand All

(-)source-OLD/vmblock-only/Makefile (-1 / +1 lines)
Lines 122-128 Link Here
122
122
123
vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
123
vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
124
	$(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) \
124
	$(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) \
125
	$(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \
125
	$(EXTRA_CFLAGS) -I$(HEADER_DIR) -Iinclude2/asm/mach-default \
126
	-DKBUILD_BASENAME=\"$(DRIVER)\" \
126
	-DKBUILD_BASENAME=\"$(DRIVER)\" \
127
	-Werror -S -o /dev/null -xc $(1) \
127
	-Werror -S -o /dev/null -xc $(1) \
128
	> /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
128
	> /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
(-)source-OLD/vmci-only/Makefile (-1 / +1 lines)
Lines 122-128 Link Here
122
122
123
vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
123
vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
124
	$(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) \
124
	$(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) \
125
	$(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \
125
	$(EXTRA_CFLAGS) -I$(HEADER_DIR) -Iinclude2/asm/mach-default \
126
	-DKBUILD_BASENAME=\"$(DRIVER)\" \
126
	-DKBUILD_BASENAME=\"$(DRIVER)\" \
127
	-Werror -S -o /dev/null -xc $(1) \
127
	-Werror -S -o /dev/null -xc $(1) \
128
	> /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
128
	> /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
(-)source-OLD/vmmon-only/include/x86apic.h (+4 lines)
Lines 94-99 Link Here
94
#define APIC_LVT_DELVMODE(_lvt) (_lvt & 0x700)
94
#define APIC_LVT_DELVMODE(_lvt) (_lvt & 0x700)
95
#define APIC_LVT_RESET_VALUE  0x00010000
95
#define APIC_LVT_RESET_VALUE  0x00010000
96
96
97
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
98
#define APIC_BASE_MSR         0x1b
99
#endif
100
97
#define APIC_MSR_BASEMASK     QWORD(0x0000000f,0xfffff000)
101
#define APIC_MSR_BASEMASK     QWORD(0x0000000f,0xfffff000)
98
#define APIC_MSR_ENABLED      0x00000800
102
#define APIC_MSR_ENABLED      0x00000800
99
#define APIC_MSR_BSP          0x00000100
103
#define APIC_MSR_BSP          0x00000100
(-)source-OLD/vmmon-only/linux/driver.c (+7 lines)
Lines 1984-1993 Link Here
1984
   }
1984
   }
1985
1985
1986
   case IOCTL_VMX86_ALLOW_CORE_DUMP:
1986
   case IOCTL_VMX86_ALLOW_CORE_DUMP:
1987
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
1987
      if (current->euid == current->uid &&
1988
      if (current->euid == current->uid &&
1988
	  current->fsuid == current->uid &&
1989
	  current->fsuid == current->uid &&
1989
          current->egid == current->gid &&
1990
          current->egid == current->gid &&
1990
	  current->fsgid == current->gid) {
1991
	  current->fsgid == current->gid) {
1992
#else
1993
      if (current_euid() == current_uid() &&
1994
	  current_fsuid() == current_uid() &&
1995
          current_egid() == current_gid() &&
1996
	  current_fsgid() == current_gid()) {
1997
#endif
1991
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) || defined(MMF_DUMPABLE)
1998
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) || defined(MMF_DUMPABLE)
1992
         /* Dump core, readable by user. */
1999
         /* Dump core, readable by user. */
1993
         set_bit(MMF_DUMPABLE, &current->mm->flags);
2000
         set_bit(MMF_DUMPABLE, &current->mm->flags);
(-)source-OLD/vmmon-only/linux/hostif.c (-7 / +89 lines)
Lines 3424-3429 Link Here
3424
}
3424
}
3425
3425
3426
3426
3427
/* krellan: Linux 2.6.29 compatibility functions for capabilities */
3428
/* Errors are logged but otherwise ignored */
3429
3430
void compat_cap_raise(int cap)
3431
{
3432
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
3433
  cap_raise(current->cap_effective, cap);
3434
#else
3435
  struct cred *new_cred;
3436
  
3437
  new_cred = prepare_creds();
3438
  if (new_cred != NULL)
3439
  {
3440
    cap_raise(new_cred->cap_effective, cap);
3441
    commit_creds(new_cred);
3442
  }
3443
  else
3444
  {
3445
    Log("compat_cap_raise(%d) prepare_creds(): Out of memory\n", cap);
3446
  }
3447
#endif
3448
}
3449
3450
void compat_cap_lower(int cap)
3451
{
3452
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
3453
  cap_lower(current->cap_effective, cap);
3454
#else
3455
  struct cred *new_cred;
3456
  
3457
  new_cred = prepare_creds();
3458
  if (new_cred != NULL)
3459
  {
3460
    cap_lower(new_cred->cap_effective, cap);
3461
    commit_creds(new_cred);
3462
  }
3463
  else
3464
  {
3465
    Log("compat_cap_lower(%d) prepare_creds(): Out of memory\n", cap);
3466
  }
3467
#endif
3468
}
3469
3470
int compat_cap_raised(int cap)
3471
{
3472
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
3473
  return cap_raised(current->cap_effective, cap);
3474
#else
3475
  return cap_raised(current_cap(), cap);
3476
#endif
3477
}
3478
3479
int compat_get_fsuid(void)
3480
{
3481
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
3482
  return current->fsuid;
3483
#else
3484
  return current_fsuid();
3485
#endif
3486
}
3487
3488
void compat_set_fsuid(int fsuid)
3489
{
3490
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
3491
  current->fsuid = fsuid;
3492
#else
3493
  struct cred *new_cred;
3494
  
3495
  new_cred = prepare_creds();
3496
  if (new_cred != NULL)
3497
  {
3498
    new_cred->fsuid = fsuid;
3499
    commit_creds(new_cred);
3500
  }
3501
  else
3502
  {
3503
    Log("compat_set_fsuid(%d) prepare_creds(): Out of memory\n", fsuid);
3504
  }
3505
#endif
3506
}
3507
3508
3427
/*
3509
/*
3428
 *----------------------------------------------------------------------
3510
 *----------------------------------------------------------------------
3429
 *
3511
 *
Lines 3456-3462 Link Here
3456
   oldFS = get_fs();
3538
   oldFS = get_fs();
3457
   set_fs(KERNEL_DS);
3539
   set_fs(KERNEL_DS);
3458
   compat_allow_signal(SIGKILL);
3540
   compat_allow_signal(SIGKILL);
3459
   cap_raise(current->cap_effective, CAP_SYS_RESOURCE);
3541
   compat_cap_raise(CAP_SYS_RESOURCE);
3460
   compat_set_user_nice(current, linuxState.fastClockPriority);
3542
   compat_set_user_nice(current, linuxState.fastClockPriority);
3461
3543
3462
   while (linuxState.fastClockRate > HZ + HZ/16) {
3544
   while (linuxState.fastClockRate > HZ + HZ/16) {
Lines 3580-3598 Link Here
3580
         Bool cap;
3662
         Bool cap;
3581
         long pid;
3663
         long pid;
3582
3664
3583
         fsuid = current->fsuid;
3665
         fsuid = compat_get_fsuid();
3584
         current->fsuid = 0;
3666
         compat_set_fsuid(0);
3585
         filp = filp_open("/dev/rtc", O_RDONLY, 0);
3667
         filp = filp_open("/dev/rtc", O_RDONLY, 0);
3586
         current->fsuid = fsuid;
3668
         compat_set_fsuid(fsuid);
3587
         if (IS_ERR(filp)) {
3669
         if (IS_ERR(filp)) {
3588
            Warning("/dev/rtc open failed: %d\n", (int)(VA)filp);
3670
            Warning("/dev/rtc open failed: %d\n", (int)(VA)filp);
3589
            return -(int)(VA)filp;
3671
            return -(int)(VA)filp;
3590
         }
3672
         }
3591
         cap = cap_raised(current->cap_effective, CAP_SYS_RESOURCE);
3673
         cap = compat_cap_raised(CAP_SYS_RESOURCE);
3592
         cap_raise(current->cap_effective, CAP_SYS_RESOURCE);
3674
         compat_cap_raise(CAP_SYS_RESOURCE);
3593
         res = HostIFDoIoctl(filp, RTC_PIE_ON, 0);
3675
         res = HostIFDoIoctl(filp, RTC_PIE_ON, 0);
3594
         if (!cap) {
3676
         if (!cap) {
3595
            cap_lower(current->cap_effective, CAP_SYS_RESOURCE);            
3677
            compat_cap_lower(CAP_SYS_RESOURCE);
3596
         }
3678
         }
3597
         if (res < 0) {
3679
         if (res < 0) {
3598
            Warning("/dev/rtc enable interrupt failed: %d\n", res);
3680
            Warning("/dev/rtc enable interrupt failed: %d\n", res);
(-)source-OLD/vmmon-only/Makefile (-1 / +1 lines)
Lines 122-128 Link Here
122
122
123
vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
123
vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
124
	$(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) \
124
	$(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) \
125
	$(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \
125
	$(EXTRA_CFLAGS) -I$(HEADER_DIR) -Iinclude2/asm/mach-default \
126
	-DKBUILD_BASENAME=\"$(DRIVER)\" \
126
	-DKBUILD_BASENAME=\"$(DRIVER)\" \
127
	-Werror -S -o /dev/null -xc $(1) \
127
	-Werror -S -o /dev/null -xc $(1) \
128
	> /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
128
	> /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
(-)source-OLD/vmnet-only/Makefile (-1 / +1 lines)
Lines 122-128 Link Here
122
122
123
vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
123
vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
124
	$(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) \
124
	$(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) \
125
	$(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \
125
	$(EXTRA_CFLAGS) -I$(HEADER_DIR) -Iinclude2/asm/mach-default \
126
	-DKBUILD_BASENAME=\"$(DRIVER)\" \
126
	-DKBUILD_BASENAME=\"$(DRIVER)\" \
127
	-Werror -S -o /dev/null -xc $(1) \
127
	-Werror -S -o /dev/null -xc $(1) \
128
	> /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
128
	> /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
(-)source-OLD/vmnet-only/netif.c (+16 lines)
Lines 324-330 Link Here
324
      goto out;
324
      goto out;
325
   }
325
   }
326
326
327
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
327
   dev->priv = netIf;
328
   dev->priv = netIf;
329
#else
330
   dev->ml_priv = netIf;
331
#endif
328
   netIf->dev = dev;
332
   netIf->dev = dev;
329
   
333
   
330
   memcpy(dev->dev_addr, netIf->port.paddr, sizeof netIf->port.paddr);
334
   memcpy(dev->dev_addr, netIf->port.paddr, sizeof netIf->port.paddr);
Lines 566-572 Link Here
566
VNetNetifStartXmit(struct sk_buff    *skb, // IN:
570
VNetNetifStartXmit(struct sk_buff    *skb, // IN:
567
                   struct net_device *dev) // IN:
571
                   struct net_device *dev) // IN:
568
{
572
{
573
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
569
   VNetNetIF *netIf = (VNetNetIF*)dev->priv;
574
   VNetNetIF *netIf = (VNetNetIF*)dev->priv;
575
#else
576
   VNetNetIF *netIf = (VNetNetIF*)dev->ml_priv;
577
#endif
570
578
571
   if(skb == NULL) {
579
   if(skb == NULL) {
572
      return 0;
580
      return 0;
Lines 618-624 Link Here
618
VNetNetifSetMAC(struct net_device *dev, // IN:
626
VNetNetifSetMAC(struct net_device *dev, // IN:
619
                void *p)                // IN:
627
                void *p)                // IN:
620
{
628
{
629
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
621
   VNetNetIF *netIf = (VNetNetIF*)dev->priv;
630
   VNetNetIF *netIf = (VNetNetIF*)dev->priv;
631
#else
632
   VNetNetIF *netIf = (VNetNetIF*)dev->ml_priv;
633
#endif
622
   struct sockaddr const *addr = p;
634
   struct sockaddr const *addr = p;
623
   if (!VMX86_IS_STATIC_MAC(addr->sa_data)) {
635
   if (!VMX86_IS_STATIC_MAC(addr->sa_data)) {
624
      return -EINVAL;
636
      return -EINVAL;
Lines 675-681 Link Here
675
struct net_device_stats *
687
struct net_device_stats *
676
VNetNetifGetStats(struct net_device *dev) // IN:
688
VNetNetifGetStats(struct net_device *dev) // IN:
677
{
689
{
690
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
678
   VNetNetIF *netIf = (VNetNetIF*)dev->priv;
691
   VNetNetIF *netIf = (VNetNetIF*)dev->priv;
692
#else
693
   VNetNetIF *netIf = (VNetNetIF*)dev->ml_priv;
694
#endif
679
   return &(netIf->stats);
695
   return &(netIf->stats);
680
}
696
}
681
697
(-)source-OLD/vsock-only/Makefile (-1 / +1 lines)
Lines 122-128 Link Here
122
122
123
vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
123
vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
124
	$(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) \
124
	$(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) \
125
	$(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \
125
	$(EXTRA_CFLAGS) -I$(HEADER_DIR) -Iinclude2/asm/mach-default \
126
	-DKBUILD_BASENAME=\"$(DRIVER)\" \
126
	-DKBUILD_BASENAME=\"$(DRIVER)\" \
127
	-Werror -S -o /dev/null -xc $(1) \
127
	-Werror -S -o /dev/null -xc $(1) \
128
	> /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
128
	> /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)

Return to bug 266795