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: <20141231194222.GB2897@blokker.redhat.com>
Date:	Wed, 31 Dec 2014 20:42:22 +0100
From:	Mark Wielaard <mjw@...hat.com>
To:	Namhyung Kim <namhyung@...nel.org>
Cc:	David Ahern <dsahern@...il.com>,
	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
	Arnaldo Carvalho de Melo <acme@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: perf-probe crash in dwarf_getcfi_elf

On Tue, Dec 30, 2014 at 06:05:33PM +0900, Namhyung Kim wrote:
> And I found a related commit (5704c8c4fa71 "getcfi_scn_eh_frame: Don't
> crash and burn when .eh_frame bits aren't there.") in elfutils that
> can lead to a unexpected crash like this.  To safely use the function,
> it needs to check the .eh_frame section is a PROGBITS type.

Sorry about that bug. It was fixed in elfutils 0.156, released July 2013.
Latest elfutils release is 0.161.

Checking .eh_frame is SHT_PROGBITS (and not SHT_NOBITS) looks like the
correct workaround if you have to deal with older elfutils releases.

Note that dwarf_getcfi_elf gets the CFI information from the .eh_frame
section associated with the ELF file underlying the Dwarf dbg and needs
to be released with a call to dwarf_cfi_end (). dwarf_getcfi () gets the
CFI information from the .debug_frame section data of the Dwarf dbg
and gets automatically releassed when dwarf_end () is called (you should
not call dwarf_cfi_end () on the result).

If the Dwarf dbg handle is associated with a separate debuginfo file,
then the .eh_frame section data will not be available (has SHT_NOBITS)
and you can get the .eh_frame section (and call dwarf_getcfi_elf ()) on
the original ELF file from which the Dwarf debuginfo file was split off.

In your patch you call dwarf_getcfi () as backup to get some CFI
information when you cannot call dwarf_getcfi_elf (). In general it
might make sense to also do this when dwarf_getcfi_elf fails. Or try
to get the CFI through both .eh_frame (from the executable ELF file)
with dwarf_getcfi_elf () and .debug_frame (from the Dwarf dbg file)
with dwarf_getcfi () and try to match an address in both tables
if one or the other fails.

Cheers,

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