Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synthesize fault_addr on amd64 if it is zero. #1031

Merged
merged 3 commits into from
Sep 22, 2017

Conversation

zachriggle
Copy link
Member

Fixes Gallopsled/pwntool#1018

Fixes Gallopsled/pwntool#1018
@zachriggle zachriggle merged commit 630c465 into Gallopsled:dev Sep 22, 2017
@zachriggle
Copy link
Member Author

Yep, works fine.

[*] '/home/pwntools/ctf-solutions/csaw/2017/quals/pilot/core.1467'
    Arch:      amd64-64-little
    RIP:       0x400b35
    RSP:       0x7ffc747f3968
    Exe:       '/home/pwntools/ctf-solutions/csaw/2017/quals/pilot/pilot' (0x400000)
    Fault:     0x6161616c6161616b
[!] cyclic_find() expects 4-byte subsequences by default, you gave 'kaaalaaa'
    Unless you specified cyclic(..., n=8), you probably just want the first 4 bytes.
    Truncating the data at 4 bytes.  Specify cyclic_find(..., n=8) to override this.
[*] Offset: 0x28

@TethysSvensson TethysSvensson added this to the 3.11.0 milestone Oct 5, 2017
>>> io = elf.process()
>>> io.wait()
>>> io.corefile.fault_addr
1234
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a good test if I understand the issue correctly. From my tests, it seems that fault_addr was only null before this patch if it would've been >= 2**47. This is because on 64 bit, that's where kernel memory is mapped so we get "protection fault" instead of "segfault". A protection fault does not have the same siginfo as a normal segfault: si_code will be SI_KERNEL = 0x80 and there won't be a fault_addr (see http://elixir.free-electrons.com/linux/v4.14-rc8/source/kernel/signal.c#L1052)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #1031

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Err Fixed in #1066

@zachriggle zachriggle deleted the corefile-amd64 branch November 10, 2017 21:52
@zachriggle zachriggle restored the corefile-amd64 branch March 21, 2019 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants