lkml.org 
[lkml]   [2009]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [BUG] binfmt_elf: get_user() called in vma_dump_size() after set_fs(KERNEL_DS)


On Fri, 6 Feb 2009, Roland McGrath wrote:
>
> 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.

Yes, I suspect just surrounding the load with set_fs(USER_DS) and then
set_fs(KERNEL_DS) to put it back is likely the right thing to do.

The address is "safe" in that it does come from the vma, but we obviously
do play games with things like the call gate mappings etc. Should we also
perhaps do this only if the vma is marked readable and executable? That
way we could avoid taking unnecessary faults there.

Probably doesn't really matter.

Linus


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