ia64/xen-unstable

changeset 11292:12daa88262c5

[LINUX] Remove hypercall permission checks from privcmd driver.

This will allow the tools management to be revised independently
of dom0 kernel interfaces. Currently tools cannot be 'smarter'
than the kernel in terms of hypercalls they know about, because
the kernel disallows access to any hypercalls it does not know
about.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Thu Aug 24 17:58:28 2006 +0100 (2006-08-24)
parents 54a905c6c84d
children 23a0a408edb9
files linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c	Thu Aug 24 17:24:54 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c	Thu Aug 24 17:58:28 2006 +0100
     1.3 @@ -35,9 +35,6 @@
     1.4  static struct proc_dir_entry *privcmd_intf;
     1.5  static struct proc_dir_entry *capabilities_intf;
     1.6  
     1.7 -#define NR_HYPERCALLS 64
     1.8 -static DECLARE_BITMAP(hypercall_permission_map, NR_HYPERCALLS);
     1.9 -
    1.10  static int privcmd_ioctl(struct inode *inode, struct file *file,
    1.11  			 unsigned int cmd, unsigned long data)
    1.12  {
    1.13 @@ -51,12 +48,6 @@ static int privcmd_ioctl(struct inode *i
    1.14  		if (copy_from_user(&hypercall, udata, sizeof(hypercall)))
    1.15  			return -EFAULT;
    1.16  
    1.17 -		/* Check hypercall number for validity. */
    1.18 -		if (hypercall.op >= NR_HYPERCALLS)
    1.19 -			return -EINVAL;
    1.20 -		if (!test_bit(hypercall.op, hypercall_permission_map))
    1.21 -			return -EINVAL;
    1.22 -
    1.23  #if defined(__i386__)
    1.24  		__asm__ __volatile__ (
    1.25  			"pushl %%ebx; pushl %%ecx; pushl %%edx; "
    1.26 @@ -262,20 +253,6 @@ static int __init privcmd_init(void)
    1.27  	if (!is_running_on_xen())
    1.28  		return -ENODEV;
    1.29  
    1.30 -	/* Set of hypercalls that privileged applications may execute. */
    1.31 -	set_bit(__HYPERVISOR_acm_op,           hypercall_permission_map);
    1.32 -	set_bit(__HYPERVISOR_dom0_op,          hypercall_permission_map);
    1.33 -	set_bit(__HYPERVISOR_event_channel_op, hypercall_permission_map);
    1.34 -	set_bit(__HYPERVISOR_memory_op,        hypercall_permission_map);
    1.35 -	set_bit(__HYPERVISOR_mmu_update,       hypercall_permission_map);
    1.36 -	set_bit(__HYPERVISOR_mmuext_op,        hypercall_permission_map);
    1.37 -	set_bit(__HYPERVISOR_xen_version,      hypercall_permission_map);
    1.38 -	set_bit(__HYPERVISOR_sched_op,         hypercall_permission_map);
    1.39 -	set_bit(__HYPERVISOR_sched_op_compat,  hypercall_permission_map);
    1.40 -	set_bit(__HYPERVISOR_event_channel_op_compat,
    1.41 -		hypercall_permission_map);
    1.42 -	set_bit(__HYPERVISOR_hvm_op,           hypercall_permission_map);
    1.43 -
    1.44  	privcmd_intf = create_xen_proc_entry("privcmd", 0400);
    1.45  	if (privcmd_intf != NULL)
    1.46  		privcmd_intf->proc_fops = &privcmd_file_ops;