Skip to content

Commit

Permalink
shellcraft.aarch64: Fix atexit SEGV in loader (#2294)
Browse files Browse the repository at this point in the history
Fixes #2289
  • Loading branch information
Arusekk authored Nov 1, 2023
1 parent 0c1121d commit 64d52b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,12 @@ The table below shows which release corresponds to each branch, and what date th
- [#2271][2271] FIX: Generated shebang with path to python invalid if path contains spaces
- [#2272][2272] Fix `tube.clean_and_log` not logging buffered data
- [#2281][2281] FIX: Getting right amount of data for search fix
- [#2294][2294] Fix atexit SEGV in aarch64 loader

[2271]: https://github.com/Gallopsled/pwntools/pull/2271
[2272]: https://github.com/Gallopsled/pwntools/pull/2272
[2281]: https://github.com/Gallopsled/pwntools/pull/2281
[2294]: https://github.com/Gallopsled/pwntools/pull/2294

## 4.11.0

Expand Down
8 changes: 4 additions & 4 deletions pwnlib/shellcraft/templates/aarch64/linux/loader.asm
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ PT_LOAD = 1
mov x3, sp
stp x2, x3, [sp, #-16]!

/* argc, argv[0], argv[1], envp */
/* argc, argv[0], argv[1], envp; x0 must be zero! */
/* ideally these could all be empty, but unfortunately
we have to keep the stack aligned. it's easier to
just push an extra argument than care... */
stp x0, x1, [sp, #-16]! /* argv[1] = NULL, envp = NULL */
mov x0, 1
mov x1, sp
stp x0, x1, [sp, #-16]! /* argc = 1, argv[0] = "" */
mov x2, 1
mov x3, sp
stp x2, x3, [sp, #-16]! /* argc = 1, argv[0] = "" */

br x8

Expand Down

0 comments on commit 64d52b0

Please sign in to comment.