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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150408071826.GA32374@gmail.com>
Date:	Wed, 8 Apr 2015 09:18:26 +0200
From:	Ingo Molnar <mingo@...nel.org>
To:	Denys Vlasenko <dvlasenk@...hat.com>
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Borislav Petkov <bp@...en8.de>,
	"H. Peter Anvin" <hpa@...or.com>,
	Andy Lutomirski <luto@...capital.net>,
	Oleg Nesterov <oleg@...hat.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Alexei Starovoitov <ast@...mgrid.com>,
	Will Drewry <wad@...omium.org>,
	Kees Cook <keescook@...omium.org>, x86@...nel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/asm/entry/64: Add forgotten CFI annotation


* Denys Vlasenko <dvlasenk@...hat.com> wrote:

> Signed-off-by: Denys Vlasenko <dvlasenk@...hat.com>
> CC: Linus Torvalds <torvalds@...ux-foundation.org>
> CC: Steven Rostedt <rostedt@...dmis.org>
> CC: Ingo Molnar <mingo@...nel.org>
> CC: Borislav Petkov <bp@...en8.de>
> CC: "H. Peter Anvin" <hpa@...or.com>
> CC: Andy Lutomirski <luto@...capital.net>
> CC: Oleg Nesterov <oleg@...hat.com>
> CC: Frederic Weisbecker <fweisbec@...il.com>
> CC: Alexei Starovoitov <ast@...mgrid.com>
> CC: Will Drewry <wad@...omium.org>
> CC: Kees Cook <keescook@...omium.org>
> CC: x86@...nel.org
> CC: linux-kernel@...r.kernel.org
> ---
>  arch/x86/kernel/entry_64.S | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
> index 65485b3..15261ba 100644
> --- a/arch/x86/kernel/entry_64.S
> +++ b/arch/x86/kernel/entry_64.S
> @@ -429,6 +429,7 @@ return_from_execve:
>  1:
>  	/* must use IRET code path (pt_regs->cs may have changed) */
>  	addq	$8, %rsp
> +	CFI_ADJUST_CFA_OFFSET -8
>  	ZERO_EXTRA_REGS
>  	movq	%rax,RAX(%rsp)
>  	jmp	int_ret_from_sys_call

So given that this is a pretty common pattern:

triton:~/tip> git grep -A 1 'addq.*%rsp' arch/x86/kernel/entry_64.S
arch/x86/kernel/entry_64.S:     addq    $8, %rsp
arch/x86/kernel/entry_64.S-     CFI_ADJUST_CFA_OFFSET -8
--
arch/x86/kernel/entry_64.S:     addq $8, %rsp
arch/x86/kernel/entry_64.S-     DEFAULT_FRAME 0
--
arch/x86/kernel/entry_64.S:     addq $8, %rsp
arch/x86/kernel/entry_64.S-     DEFAULT_FRAME 0
--
arch/x86/kernel/entry_64.S:     addq $-0x80,(%rsp)              /* Adjust vector to [-256,-1] range */
arch/x86/kernel/entry_64.S-     interrupt do_IRQ
--
arch/x86/kernel/entry_64.S:     addq $0x30,%rsp
arch/x86/kernel/entry_64.S-     CFI_ADJUST_CFA_OFFSET -0x30
--
arch/x86/kernel/entry_64.S:     addq $0x30,%rsp
arch/x86/kernel/entry_64.S-     CFI_ADJUST_CFA_OFFSET -0x30
--
arch/x86/kernel/entry_64.S:     addq $(6*8), %rsp
arch/x86/kernel/entry_64.S-     CFI_ADJUST_CFA_OFFSET -6*8
--
arch/x86/kernel/entry_64.S:     addq $(10*8), %rsp
arch/x86/kernel/entry_64.S-     CFI_ADJUST_CFA_OFFSET -10*8


it might make sense to introduce addq_cfi, to further hide the dwarf 
uglies?

btw., doesn't:

arch/x86/kernel/entry_64.S:     addq $-0x80,(%rsp)              /* Adjust vector to [-256,-1] range */

before the do_IRQ() call need a CFI adjustment as well?

Thanks,

	Ingo
--
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