The recent change to __ioremap()'s first parameter's type didn't yield
the intended effect as the first conditional inside the function would
still have filtered out any addresses with bits [63:32] set. Correct
last_addr's type and at once also add a check that the address range
doesn't extend into space hardware cannot support even theoretically.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: H. Peter Anvin <hpa@kernel.org>
Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
arch/x86/mm/ioremap.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- linux-2.6.25-rc8/arch/x86/mm/ioremap.c 2008-04-02 16:21:19.000000000 +0200
+++ 2.6.25-rc8-i386-ioremap-64bit/arch/x86/mm/ioremap.c 2008-04-02 15:21:42.000000000 +0200
@@ -109,13 +109,14 @@ static int ioremap_change_attr(unsigned
static void __iomem *__ioremap(resource_size_t phys_addr, unsigned long size,
enum ioremap_mode mode)
{
- unsigned long pfn, offset, last_addr, vaddr;
+ unsigned long pfn, offset, vaddr;
+ resource_size_t last_addr;
struct vm_struct *area;
pgprot_t prot;
/* Don't allow wraparound or zero size */
last_addr = phys_addr + size - 1;
- if (!size || last_addr < phys_addr)
+ if (!size || last_addr < phys_addr || last_addr > __PHYSICAL_MASK)
return NULL;
/*
--
| Karl Meyer | PROBLEM: 2.6.23-rc "NETDEV WATCHDOG: eth0: transmit timed out" |
| Justin Piszcz | Linux Software RAID 5 Performance Optimizations: 2.6.19.1: (211MB/s read & 195... |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
| David P. Quigley | [RFC v3] Security Label Support for NFSv4 |
| YOSHIFUJI Hideaki / | [GIT PULL] [IPV6] COMPAT: Fix SSM applications on 64bit kernels. |
| Krzysztof Halasa | Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC |
| Pavel Emelyanov | [PATCH][CAN]: Fix copy_from_user() results interpretation. |
| Roel Kluin | [PATCH 1] net: fix and typo's |
git: | |
| Peter Stahlir | Git as a filesystem |
| Miklos Vajna | [rfc] git submodules howto |
| Dan Zwell | $GIT_DIR usage |
| Wink Saville | Resolving conflicts |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| Xavier Mertens | newfs: cg 0: bad magic number |
| Laurent CARON | IPSEC VPN between OpenBSD and Linux (OpenSwan) |
| Didier Wiroth | win32-codecs, avi and amd64 question |
| Netfilter kernel module | 8 hours ago | Linux kernel |
| serial driver xmit problem | 11 hours ago | Linux kernel |
| Why Windows is better than Linux | 11 hours ago | Linux general |
| How can I see my kernel messages in vt12? | 18 hours ago | Linux kernel |
| Grub | 1 day ago | Linux general |
| vmalloc_fault handling in x86_64 | 1 day ago | Linux kernel |
| epoll_wait()ing on epoll FD | 1 day ago | Linux kernel |
| Framebuffer in x86_64 causes problems to multiseat | 1 day ago | Linux kernel |
| Difference between 2.4 and 2.6 regarding thread creation | 1 day ago | Linux general |
| Compiling gfs2 on kernel 2.6.27 | 2 days ago | Linux kernel |
