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] [day] [month] [year] [list]
Date:	Sun, 22 Mar 2015 15:15:08 +0100
From:	Denys Vlasenko <vda.linux@...glemail.com>
To:	Brian Gerst <brgerst@...il.com>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...nel.org>, Borislav Petkov <bp@...en8.de>,
	Will Drewry <wad@...omium.org>,
	Andy Lutomirski <luto@...capital.net>,
	Alexei Starovoitov <ast@...mgrid.com>,
	Oleg Nesterov <oleg@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>,
	Frédéric Weisbecker <fweisbec@...il.com>,
	Denys Vlasenko <dvlasenk@...hat.com>,
	Kees Cook <keescook@...omium.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	linux-tip-commits@...r.kernel.org
Subject: Re: [tip:x86/asm] x86/asm/entry/64: Always allocate a complete "
 struct pt_regs" on the kernel stack

>> @@ -492,7 +496,6 @@ GLOBAL(stub32_clone)
>>
>>         ALIGN
>>  ia32_ptregs_common:
>> -       popq %r11
>>         CFI_ENDPROC
>>         CFI_STARTPROC32 simple
>>         CFI_SIGNAL_FRAME
>> @@ -507,9 +510,9 @@ ia32_ptregs_common:
>>  /*     CFI_REL_OFFSET  rflags,EFLAGS-ARGOFFSET*/
>>         CFI_REL_OFFSET  rsp,RSP-ARGOFFSET
>>  /*     CFI_REL_OFFSET  ss,SS-ARGOFFSET*/
>> -       SAVE_REST
>> +       SAVE_EXTRA_REGS 8
>>         call *%rax
>> -       RESTORE_REST
>> -       jmp  ia32_sysret        /* misbalances the return cache */
>> +       RESTORE_EXTRA_REGS 8
>> +       ret
>>         CFI_ENDPROC
>>  END(ia32_ptregs_common)
>
> This change is causing Wine to fail when it's built to support both
> 32-bit and 64-bit code:
>
> [  523.657406] wineserver[1605]: segfault at 453a7c90 ip
> 00000000453a7c90 sp 00000000b3c6ad10 error 14 in
> ld-2.21.so[7fad453a7000+21000]
>
> It tries to exec the 64-bit wineserver from 32-bit code and faults
> because %rip is truncated.  This is because simply returning to the
> caller will exit via sysretl which doesn't change %cs to 64-bit mode.
> We need to set a thread flag to enter the slow path and return via
> iret instead.
>
> Patch coming to fix it.

Something like adding

    orl $_TIF_NOTIFY_RESUME,TI_flags+THREAD_INFO(%rsp,RIP)

in stub32_execve[at] will probably do it
Please add a comment why it is needed.
--
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