Skip to content

[BUG] The syscall argument registers are misleading in syscalls part one #855

@k4lizen

Description

@k4lizen

In part two (https://0xax.gitbooks.io/linux-insides/content/SysCall/linux-syscall-2.html section "Preparation before system call handler will be called") its clear that for example ECX is not used as an argument register since RIP is stored in it. However in part 1 of the syscall series:
image
This is the order used when calling functions yes, but not when calling syscalls. Also I think syscalls don't take arguments from the stack. This is a useful reference: https://elixir.bootlin.com/linux/v6.10.10/source/arch/x86/entry/entry_64.S#L69

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions