lkml.org 
[lkml]   [2009]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [BUG] binfmt_elf: get_user() called in vma_dump_size() after set_fs(KERNEL_DS)
Date
The address in question comes from a user vma's vm_start, so by definition
it has to be in the user part of the address space. This code path is
excluded for VM_IO and the like by checks earlier in vma_dump_size.
So, is this problem purely theoretical? I guess not on machines where
set_fs actually changes the meaning of the lower address space.

I think get_user_pages would certainly be overkill for this. It's a check
to decide whether you need to pay the cost of get_user_pages, after all.

set_fs is quite cheap at least on most machines. So a pair of set_fs calls
around that get_user call doesn't seem so bad. OTOH, on the machines where
this actually matters at all (maybe just sparc, arm, s390?) it is
presumably (much?) more costly. But it seems like the best solution, and
certainly is straightforward.


Thanks,
Roland


\
 
 \ /
  Last update: 2009-02-06 23:09    [W:0.048 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site