ia64/xen-unstable

changeset 2256:821d32bd8ce0

bitkeeper revision 1.1159.34.2 (4120f82bRcTbpXEs-zb6q77ty9n_Ig)

Add debugging to the new mmap() failure path.
author kaf24@scramble.cl.cam.ac.uk
date Mon Aug 16 18:08:43 2004 +0000 (2004-08-16)
parents 107d8a9674c9
children bb91ba552d34
files linux-2.6.7-xen-sparse/arch/xen/i386/mm/mmap.c
line diff
     1.1 --- a/linux-2.6.7-xen-sparse/arch/xen/i386/mm/mmap.c	Mon Aug 16 18:08:07 2004 +0000
     1.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/mm/mmap.c	Mon Aug 16 18:08:43 2004 +0000
     1.3 @@ -27,7 +27,7 @@ arch_get_unmapped_area(struct file *filp
     1.4  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     1.5  	start_addr = addr = mm->free_area_cache;
     1.6  #else
     1.7 -	addr = PAGE_ALIGN(TASK_UNMAPPED_BASE);
     1.8 +	start_addr = addr = PAGE_ALIGN(TASK_UNMAPPED_BASE);
     1.9  #endif
    1.10  
    1.11  full_search:
    1.12 @@ -61,7 +61,10 @@ unsigned long
    1.13  arch_check_fixed_mapping(struct file *filp, unsigned long addr,
    1.14  		unsigned long len, unsigned long pgoff, unsigned long flags)
    1.15  {
    1.16 -	if ( addr < (FIRST_USER_PGD_NR<<PGDIR_SHIFT) )
    1.17 +	if (addr < (FIRST_USER_PGD_NR<<PGDIR_SHIFT)) {
    1.18 +		printk(KERN_ALERT "WARNING: Preventing a mmap() request by %s at 0x%08lx, len %08lx\n",
    1.19 +		current->comm, addr, len);
    1.20  		return -EINVAL;
    1.21 +	}
    1.22  	return 0;
    1.23  }