diff options
author | HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com> | 2013-10-16 16:47:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-10-17 00:35:53 -0400 |
commit | 2cbe3b0af82279f14cfb3195f2406651f28ee9b8 (patch) | |
tree | 98888ef9e9799eb9e174f45c008df43bc033960a /fs | |
parent | e3b6c655b91e01a1dade056cfa358581b47a5351 (diff) |
procfs: fix unintended truncation of returned mapped address
Currently, proc_reg_get_unmapped_area truncates upper 32-bit of the
mapped virtual address returned from get_unmapped_area method in
pde->proc_fops due to the variable rv of signed integer on x86_64. This
is too small to have vitual address of unsigned long on x86_64 since on
x86_64, signed integer is of 4 bytes while unsigned long is of 8 bytes.
To fix this issue, use unsigned long instead.
Fixes a regression added in commit c4fe24485729 ("sparc: fix PCI device
proc file mmap(2)").
Signed-off-by: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Tested-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/proc/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 9f8ef9b7674d..6c501c4d996d 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c | |||
@@ -288,7 +288,7 @@ static int proc_reg_mmap(struct file *file, struct vm_area_struct *vma) | |||
288 | static unsigned long proc_reg_get_unmapped_area(struct file *file, unsigned long orig_addr, unsigned long len, unsigned long pgoff, unsigned long flags) | 288 | static unsigned long proc_reg_get_unmapped_area(struct file *file, unsigned long orig_addr, unsigned long len, unsigned long pgoff, unsigned long flags) |
289 | { | 289 | { |
290 | struct proc_dir_entry *pde = PDE(file_inode(file)); | 290 | struct proc_dir_entry *pde = PDE(file_inode(file)); |
291 | int rv = -EIO; | 291 | unsigned long rv = -EIO; |
292 | unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); | 292 | unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); |
293 | if (use_pde(pde)) { | 293 | if (use_pde(pde)) { |
294 | get_unmapped_area = pde->proc_fops->get_unmapped_area; | 294 | get_unmapped_area = pde->proc_fops->get_unmapped_area; |