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

Handle the new pt_regs syscall convention #80

Closed
woodruffw opened this issue Dec 24, 2019 · 0 comments · Fixed by #83 or fengjixuchui/krf#2
Closed

Handle the new pt_regs syscall convention #80

woodruffw opened this issue Dec 24, 2019 · 0 comments · Fixed by #83 or fengjixuchui/krf#2

Comments

@woodruffw
Copy link
Member

As of Linux 4.17, x86_64 kernels built with CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y no longer use the userspace parameter list for syscalls, but instead use a single pt_regs* argument which they unpack internally.

As part of these changes, the sys_* prototypes are no longer exposed directly on x86_64 via linux/syscalls.h. This requires us to make some codegen changes:

"#{ASMLINKAGE} #{TYPEOF}(sys_#{call}) krf_sys_#{call};"

and similar should become something like:

"#{ASMLINKAGE} #{SYSCALL_RET_TYPE} (*krf_sys_#{call})(pt_regs*);"

We should be able to handle this difference conditionally by checking the running kernel config, e.g. via /lib/modules/$(uname -r)/build/.config. This requires additional codegen cruft, which indicates that it's maybe finally time to split FreeBSD's codegen out from Linux's.

@woodruffw woodruffw self-assigned this Dec 24, 2019
woodruffw added a commit that referenced this issue Dec 24, 2019
See #80: Ubuntu 18.04 on GitHub Actions appears to use
the HWE kernel, which uses a new syscall parameter convention
that we don't support yet.
woodruffw added a commit that referenced this issue Dec 26, 2019
Handles pt_regs-based syscalls.

Closes #80.
woodruffw added a commit that referenced this issue Dec 26, 2019
* module: Syscall wrapper codegen

Handles pt_regs-based syscalls.

Closes #80.

* ci: Enable ubuntu-latest builds

These should work now.

* module/codegen: Minimize special-casing

The pt_regs handling is a superset of the original
handling, so just use it everywhere.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant