lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrVBAjNq-=AjOdx_Y=pkr-1qnRQS7zJ=i0SrnakX2m3Omw@mail.gmail.com>
Date:	Thu, 3 Sep 2015 10:22:38 -0700
From:	Andy Lutomirski <luto@...capital.net>
To:	Brian Gerst <brgerst@...il.com>
Cc:	Andy Lutomirski <luto@...nel.org>,
	"the arch/x86 maintainers" <x86@...nel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Denys Vlasenko <dvlasenk@...hat.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Borislav Petkov <bp@...en8.de>
Subject: Re: [RFC 24/30] x86/entry/32: Switch INT80 to the new C syscall path

On Thu, Sep 3, 2015 at 9:45 AM, Brian Gerst <brgerst@...il.com> wrote:
> On Tue, Sep 1, 2015 at 6:41 PM, Andy Lutomirski <luto@...nel.org> wrote:
>> Signed-off-by: Andy Lutomirski <luto@...nel.org>
>> ---
>>  arch/x86/entry/entry_32.S | 34 +++++++++++++---------------------
>>  1 file changed, 13 insertions(+), 21 deletions(-)
>>
>> diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S
>> index 36b6beb181f6..02881e528945 100644
>> --- a/arch/x86/entry/entry_32.S
>> +++ b/arch/x86/entry/entry_32.S
>> @@ -153,13 +153,13 @@
>>
>>  #endif /* CONFIG_X86_32_LAZY_GS */
>>
>> -.macro SAVE_ALL
>> +.macro SAVE_ALL pt_regs_ax=%eax
>>         cld
>>         PUSH_GS
>>         pushl   %fs
>>         pushl   %es
>>         pushl   %ds
>> -       pushl   %eax
>> +       pushl   \pt_regs_ax
>>         pushl   %ebp
>>         pushl   %edi
>>         pushl   %esi
>> @@ -370,20 +370,17 @@ ENDPROC(entry_SYSENTER_32)
>>         # system call handler stub
>>  ENTRY(entry_INT80_32)
>>         ASM_CLAC
>> -       pushl   %eax                            # save orig_eax
>> -       SAVE_ALL
>> -       GET_THREAD_INFO(%ebp)
>> -                                               # system call tracing in operation / emulation
>> -       testl   $_TIF_WORK_SYSCALL_ENTRY, TI_flags(%ebp)
>> -       jnz     syscall_trace_entry
>> -       cmpl    $(NR_syscalls), %eax
>> -       jae     syscall_badsys
>> -syscall_call:
>> -       call    *sys_call_table(, %eax, 4)
>> -syscall_after_call:
>> -       movl    %eax, PT_EAX(%esp)              # store the return value
>> -syscall_exit:
>> -       jmp     syscall_exit_work
>> +       pushl   %eax                    /* pt_regs->orig_ax */
>> +       SAVE_ALL pt_regs_ax=$-ENOSYS    /* save rest, load -ENOSYS into ax */
>> +
>> +       /*
>> +        * User mode is traced as though IRQs are on, and the interrupt gate
>> +        * turned them off.
>> +        */
>> +       TRACE_IRQS_OFF
>> +
>> +       movl    %esp, %eax
>> +       call    do_int80_syscall_32
>>
>>  restore_all:
>>         TRACE_IRQS_IRET
>> @@ -491,11 +488,6 @@ syscall_fault:
>>         jmp     resume_userspace
>>  END(syscall_fault)
>>
>> -syscall_badsys:
>> -       movl    $-ENOSYS, %eax
>> -       jmp     syscall_after_call
>> -END(syscall_badsys)
>> -
>>  sysenter_badsys:
>>         movl    $-ENOSYS, %eax
>>         jmp     sysenter_after_call
>> --
>> 2.4.3
>>
>
> While bisecting a boot failure on the 32-bit native kernel I came
> across this build error:
> arch/x86/built-in.o: In function `syscall_trace_entry':
> /home/bgerst/kernel/linux/arch/x86/entry/entry_32.S:468: undefined
> reference to `syscall_call'
> /home/bgerst/kernel/linux/arch/x86/entry/entry_32.S:469: undefined
> reference to `syscall_exit'
>

Whoops!  I'll fix that up for v2.

--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ