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]
Date:	Tue, 21 Feb 2012 15:43:56 +0100
From:	Mark Wielaard <mjw@...hat.com>
To:	Jan Beulich <JBeulich@...e.com>
Cc:	"Frederic Weisbecker (commit_signer:4/25=16%)" <fweisbec@...il.com>,
	"maintainer:X86 ARCHITECTURE..." <x86@...nel.org>,
	"Thomas Gleixner (maintainer:X86 ARCHITECTURE...)" 
	<tglx@...utronix.de>,
	"Andi Kleen (commit_signer:5/25=20%)" <ak@...ux.intel.com>,
	"commit_signer:11/25=44%) Ingo Molnar (maintainer:X86 ARCHITECTURE..." 
	<mingo@...hat.com>, linux-kernel@...r.kernel.org,
	"commit_signer:4/25=16%) H. Peter Anvin (maintainer:X86 "
	 "ARCHITECTURE..." <hpa@...or.com>
Subject: Re: [PATCH] x86-64: Fix CFI data for common_interrupt

On Tue, 2012-02-21 at 14:26 +0000, Jan Beulich wrote:
> >>> On 21.02.12 at 15:06, Mark Wielaard <mjw@...hat.com> wrote:
> > Commit eab9e6 "x86-64: Fix CFI data for interrupt frames" introduced
> > a DW_CFA_def_cfa_expression in the SAVE_ARGS_IRQ macro. To later define
> > the CFA using a simple register+offset rule both register and offset
> > need to be supplied. Just using CFI_DEF_CFA_REGISTER leaves the offset
> > undefined. So use CFI_DEF_CFA with reg+off explicitly at the end of
> > common_interrupt.
> 
> NAK, unless you can prove a path via which the offset will remain
> unset until hitting a CFI_DEF_CFA_REGISTER. And if you indeed
> found such a path, the entry point of the path is where the problem
> ought to be fixed.
> 
> Are you perhaps thinking that .cfi_def_cfa_register invalidates
> the offset in any way? That, to my knowledge, isn't the case, it
> just replaces the CFA register with the one specified, leaving the
> offset unchanged.

DW_CFA_def_cfa_expression invalidates the offset (and register). Used
through the interrupt macro for do_IRQ which uses the SAVE_ARGS_IRQ to
define common_interrupt. So after using DW_CFA_def_cfa_expression we get
a CFI_DEF_REGISTER and the CFI for common_interrupt looks like:

 [  6e30] FDE length=148 cie=[  6e18]
   CIE_pointer:              28184
   initial_location:         0xffffffff815e8d00 <common_interrupt>
   address_range:            0x1ba

   Program:
[...]
     advance_loc 1 to 0x69
     def_cfa_expression 6
          [   0] breg7 0
          [   2] deref
          [   3] const1u 136
          [   5] plus
     advance_loc 22 to 0x7f
     def_cfa_register r4 (rsi)
[...]

For DW_CFA_def_register DWARF4 explicitly says so: "This operation is
valid only if the current CFA rule is defined to use a register and
offset." So one needs to use CFI_DEF_CFA with both a register and an
offset here after the def_cfa_expression.

Thanks,

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