From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6406 invoked by alias); 14 Apr 2008 19:31:20 -0000 Received: (qmail 6367 invoked by uid 22791); 14 Apr 2008 19:31:12 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 14 Apr 2008 19:30:52 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id C08E0983D9; Mon, 14 Apr 2008 19:30:50 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id AAADF98119; Mon, 14 Apr 2008 19:30:50 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1JlUOA-0007gb-0D; Mon, 14 Apr 2008 15:30:50 -0400 Date: Mon, 14 Apr 2008 19:56:00 -0000 From: Daniel Jacobowitz To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: 5/5 - handle glibc pointer mangling jmp_bufs (x86/x86_64) Message-ID: <20080414193049.GP1968@caradoc.them.org> Mail-Followup-To: Pedro Alves , gdb-patches@sourceware.org References: <200804070336.27192.pedro@codesourcery.com> <200804072325.50739.pedro@codesourcery.com> <20080414185843.GH1968@caradoc.them.org> <200804142020.07056.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200804142020.07056.pedro@codesourcery.com> User-Agent: Mutt/1.5.17 (2007-12-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-04/txt/msg00264.txt.bz2 On Mon, Apr 14, 2008 at 08:20:06PM +0100, Pedro Alves wrote: > The key is not enough. There's also a 'rotate right' involved. That > seems to have changed through time, as Jan's patch didn't handle the ror, > just the xor. Yes, that does seem to be new (2007-02-01). You could do this even more evilly. Do it by setting a breakpoint on setjmp, recording information before and after, and then deleting the breakpoint until we re-run. Yes, this is getting excessive. But there shouldn't ever be a call to longjmp without a call to setjmp first. > > Maybe that is good enough for now, and we can seek a better long-term > > solution separately. Also, the location of the guard does not > > definitively answer the question of whether it is used to mangle > > jmp_bufs. ARM and MIPS don't use it at all. > > True. I had thought that a solution based on detecting the > glibc version and demangling accordingly would be enough. > > Why isn't it so? Is it plain impossible to > extract glibc's version? There's no interface for it. It's there, but only in the unstripped symbol table like __pointer_chk_guard: (gdb) x/s &__libc_version 0x2aaaab8f8cd8 <__libc_version>: "2.7" That's not very fine-grained, either. And feature tests are more robust than version tests, since they'd detect an unsupported algorithm. I admit that the feature test is much harder... -- Daniel Jacobowitz CodeSourcery