lkml.org 
[lkml]   [2010]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [GIT PULL] x86/asm changes for v2.6.37
On 10/21/2010 01:16 PM, Linus Torvalds wrote:
> On Thu, Oct 21, 2010 at 6:21 AM, Ingo Molnar <mingo@elte.hu> wrote:
>>
>> Jan Beulich (1):
>> i386: Make kernel_execve() suitable for stack unwinding
>>
>> long __res;
>> - asm volatile ("push %%ebx ; movl %2,%%ebx ; int $0x80 ; pop %%ebx"
>> + asm volatile ("int $0x80"
>> : "=a" (__res)
>> - : "0" (__NR_execve), "ri" (filename), "c" (argv), "d" (envp) : "memory");
>> + : "0" (__NR_execve), "b" (filename), "c" (argv), "d" (envp) : "memory");
>> return __res;
>> }
>
> I pulled this, but there's a reason we used to do it that way - gcc
> has had bugs with inline asm changing %ebx due to some bad interaction
> with using it as the GOT base register for position-independent code
> or something.
>
> So I hope those are all solved, and I guess we use -fPIC only for some
> early boot code. But in case this is ever used in some environment
> that is PIC (the vsyscall page?) we need to worry about gcc
> interactions.
>

We used to allow these macros to be used from user space; we don't
anymore. The vsyscall page is PIC, but we wouldn't be calling
kernel_execve() from there.

The good part is that gcc will fail to compile if we ever violate the
assumptions; we won't see quiet failures.

-hpa


\
 
 \ /
  Last update: 2010-10-21 22:25    [W:0.094 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site