lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080116073322.GE30950@elte.hu>
Date:	Wed, 16 Jan 2008 08:33:22 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	venkatesh.pallipadi@...el.com
Cc:	ak@....de, ebiederm@...ssion.com, rdreier@...co.com,
	torvalds@...ux-foundation.org, gregkh@...e.de, airlied@...net.ie,
	davej@...hat.com, tglx@...utronix.de, hpa@...or.com,
	akpm@...ux-foundation.org, arjan@...radead.org,
	jesse.barnes@...el.com, davem@...emloft.net,
	linux-kernel@...r.kernel.org,
	Suresh Siddha <suresh.b.siddha@...el.com>
Subject: Re: [patch 4/4] x86: PAT followup - use ioremap for devmem read of
	reserved regions


* venkatesh.pallipadi@...el.com <venkatesh.pallipadi@...el.com> wrote:

> --- linux-2.6.git.orig/drivers/char/mem.c	2008-01-15 10:05:13.000000000 -0800
> +++ linux-2.6.git/drivers/char/mem.c	2008-01-15 10:05:51.000000000 -0800
> @@ -127,9 +127,14 @@
>  		 * by the kernel or data corruption may occur
>  		 */
>  		ptr = xlate_dev_mem_ptr(p);
> +		if (!ptr)
> +			return -EFAULT;
>  
>  		if (copy_to_user(buf, ptr, sz))
>  			return -EFAULT;
> +
> +		unxlate_dev_mem_ptr(p, ptr);

sidenote: drivers/char/mem.c has no locking here, are you sure it's safe 
to create a possibly large number of aliases here? At least on 32-bit it 
could deplete the vmalloc area. (where all ioremaps go)

since /dev/mem access is strongly discouraged anyway (except perhaps for 
debugging purposes), wouldnt it be safer to stick a mutex around these 
areas?

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ