This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: Longjmp vs LD_POINTER_GUARD revisited


On Sun, Nov 15, 2009 at 10:29:33AM -0800, Paul Pluzhnikov wrote:
> On Sun, Nov 15, 2009 at 9:34 AM, Daniel Jacobowitz <drow@false.org> wrote:
> 
> > * Where the jmp_buf contents are obfuscated, as done by glibc, which
> > "encrypts" them using a canary stored in the thread TCB.
> 
> FWIW, I never understood the point of this obfuscation: the program
> (and any rogue code injected into it) can trivially discover the value
> of canary:
> 
>   call sigsetjmp
> a_label:
>   ... canary =  sigjmp_buf.__jmpbuf[JB_PC] - &a_label
> 
> I think GDB could also perform such discovery, and that would allow it
> work with non-debug glibc (debug glibc (I believe) is exception rather
> the rule outside of {gdb,glibc,gcc} developers).

There's a rotate and an xor involved; I don't believe this would work
as written... sure, we could "discover" it from disassembling key
functions automatically...

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]