You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey! This isn't something I ran into when using pwntools, more like something I noticed from the source code (hence the lack of debug output etc.)
As of writing this, the most recent version of pwntools define the offsets for amd64's SigreturnFrame as follows:
The __reserved field is actually an array of 8u64s, which is a total of 64 bytes, causing the sigmask field to be 56 bytes short of where it should be. You can also verify this by debugging the amd64 kernel:
While this isn't a massive issue, as most people wouldn't care about sigmask, I still felt like I might as well bring it up, and you can decide whether its worth fixing.
The text was updated successfully, but these errors were encountered:
Hey! This isn't something I ran into when using pwntools, more like something I noticed from the source code (hence the lack of debug output etc.)
As of writing this, the most recent version of pwntools define the offsets for amd64's SigreturnFrame as follows:
pwntools/pwnlib/rop/srop.py
Lines 182 to 188 in 405357c
Notably,
sigmask
is at offset240
, and__reserved
is defined as being 8 bytes big. However when you look at the linux kernel source code:https://elixir.bootlin.com/linux/v6.10/source/arch/x86/include/uapi/asm/sigcontext.h#L376
The
__reserved
field is actually an array of8
u64
s, which is a total of64
bytes, causing thesigmask
field to be56
bytes short of where it should be. You can also verify this by debugging the amd64 kernel:While this isn't a massive issue, as most people wouldn't care about
sigmask
, I still felt like I might as well bring it up, and you can decide whether its worth fixing.The text was updated successfully, but these errors were encountered: