Skip to content

Commit

Permalink
fix executable stack on aarch64 kernels older than v5.8-rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
cyanpencil committed Nov 30, 2023
1 parent c31896e commit ef4e541
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions librw_arm64/rw.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@ def dump(self):
# we need one fake section just to represent the copy of the base address of the binary
fd.write(f".section .fake.elf_header, \"a\", @progbits" + "\n")

# this makes sure the stack is not executable in kernels older than v5.8-rc1
fd.write(f".section .note.GNU-stack, \"\", @progbits" + "\n")

# add weak symbols
for symbol in self.container.symbols:
if "@@" in symbol.name: continue
Expand Down

0 comments on commit ef4e541

Please sign in to comment.