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

Linux has dropped __NR_open from AArch64 #896

Closed
zachriggle opened this issue Feb 13, 2017 · 1 comment
Closed

Linux has dropped __NR_open from AArch64 #896

zachriggle opened this issue Feb 13, 2017 · 1 comment
Assignees
Milestone

Comments

@zachriggle
Copy link
Member

zachriggle commented Feb 13, 2017

While working on #883, one of the failing tests is cat for aarch64, because __NR_open is not defined in MUSL's headers for aarch64.

At first this seemed like a bug, but our current syscalls for it are e.g.:

$ constgrep -c aarch64 __NR_open
#define __NR_openat            56
#define __NR_open_by_handle_at 265
#define __NR_open              1024

The 1024 seems suspect. In fact, QEMU does not support this syscall anymore as of qemu/qemu@13756fb0, which landed in v2.6.0. This makes the unsupported syscall 1024 that has been popping up make more sense.

I think the best way to handle it is to have aarch64/linux/open.asm which uses the SYS_openat syscall.

@zachriggle
Copy link
Member Author

zachriggle added a commit to zachriggle/pwntools that referenced this issue Feb 13, 2017
zachriggle added a commit that referenced this issue Feb 13, 2017
* Remove unavailable syscalls from AArch64

The Linux kernel has apparently stopped supporting these

* Rewrite shellcraft.aarch64.linux.cat, add open which uses openat

Fixes #896

* Fix doctests to use openat
@zachriggle zachriggle modified the milestones: 3.6.0, Someday Mar 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants