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: <458ADEDD.8010903@goop.org>
Date:	Thu, 21 Dec 2006 11:22:05 -0800
From:	Jeremy Fitzhardinge <jeremy@...p.org>
To:	Frederik Deweerdt <deweerdt@...e.fr>
CC:	Andrew Morton <akpm@...l.org>, linux-kernel@...r.kernel.org
Subject: Re: [-mm patch] ptrace: make {put,get}reg work again for gs and fs

Frederik Deweerdt wrote:
> Following the i386 pda patches, it's not possible to set gs or fs value
> from gdb anymore. The following patch restores the old behaviour of
> getting and setting thread.gs of thread.fs respectively.
> Here's a gdb session *before* the patch:
> (gdb) info reg
> [...]
> fs             0x33     51
> gs             0x33     51
> (gdb) set $fs=0xffff
> (gdb) info reg
> [...]
> fs             0x33     51
> gs             0x33     51
> (gdb) set $gs=0xffffffff
> (gdb) info reg
> [...]
> fs             0xffff   65535
> gs             0x33     51
>
> Another one *after* the patch:
> (gdb) info reg
> [...]
> fs             0xd8     216
>   

This doesn't look right.  This is the kernel's %fs, not usermode's
(which should be 0).

> gs             0x33     51
> (gdb) set $fs=0xffff
> (gdb) info reg
> [...]
> fs             0xffff   65535
> gs             0x33     51
> (gdb) set $gs=0xffff
> (gdb) info reg
> [...]
> fs             0xffff   65535
> gs             0xffff   65535
>   
Hm.  This shouldn't be possible since this is a bad selector, but I
guess ptrace/gdb doesn't really know that.  If you run the target (even
single step it), these should revert to 0.

> Andrew, this goes on top of ptrace-fix-efl_offset-value-according-to-i386-pda-changes.patch
> sent by Jeremy yesterday.
>   

Don't think this is quite right yet.  Assuming the %gs->%fs patch has
been applied, then the target %fs should be on its stack, and target %gs
will be in thread.gs.  I'm not sure that thread.fs has any use, but I'd
want to double check vm86 to be sure.

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