Skip to content

BUG: arch: read the syscall ABIs from Makefile.syscalls; add memfd_secret to loongarch64 - #503

Open
kolyshkin wants to merge 1 commit into
seccomp:mainfrom
kolyshkin:loongarch-memfd-secret
Open

kolyshkin wants to merge 1 commit into
seccomp:mainfrom
kolyshkin:loongarch-memfd-secret

Conversation

@kolyshkin

@kolyshkin kolyshkin commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

memfd_secret was wired up for loongarch64 in Linux v7.0 (kernel commit abca6583a2aa, "LoongArch: Wire up memfd_secret system call"), by adding syscall_abis_64 += memfd_secret to arch/loongarch/kernel/Makefile.syscalls. arch-syscall-validate has the syscall ABIs hardcoded for each architecture using the generic syscall table, so it missed this, and memfd_secret is missing from the loongarch64 syscall table.

This PR:

  • makes arch-syscall-validate read the ABIs from Makefile.syscalls for aarch64, loongarch64 and riscv64, rather than hardcoding them, so this does not happen again;
  • regenerates syscalls.csv, using the same kernel version as before (v7.1-rc4), so the only change (besides the date) is the addition of memfd_secret to loongarch64.

I checked that the kernel syscall dump (arch-syscall-validate -s -a <arch>) is unchanged for aarch64 and riscv64 with Linux v6.10 (the pre-Makefile.syscalls code path), v6.11, v7.1-rc4 and v7.2, and that for loongarch64 the only addition is memfd_secret,447 (v7.1-rc4 and v7.2).

I found this while comparing syscalls.csv with the syscalls-table data in #502. The two PRs touch the same syscalls.csv line, so whichever is merged second needs a trivial rebase. After that, the loongarch64 kernel version for memfd_secret can be filled in with arch-update-syscalls-csv.py (it should be v7.0).

Since Linux v6.11, the syscalls of the architectures using the generic
syscall table are generated from a syscall.tbl file, and the syscall
ABIs (i.e. syscall.tbl tags) enabled for each architecture are listed
in its arch/<arch>/kernel/Makefile.syscalls file.

arch-syscall-validate had these ABIs hardcoded, and it missed the
memfd_secret ABI added for loongarch64 by kernel commit abca6583a2aa
("LoongArch: Wire up memfd_secret system call", Linux v7.0), so
memfd_secret is missing from the loongarch64 syscall table.

Read the ABIs from Makefile.syscalls for aarch64, loongarch64, and
riscv64. This only changes the loongarch64 output, which now includes
memfd_secret.

The syscalls table was updated by running:
$ ./arch-syscall-validate -c syscalls.csv <kernel_directory>

with the same kernel version as before (v7.1-rc4), so the only change
(besides the date) is the addition of memfd_secret to loongarch64.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin
kolyshkin force-pushed the loongarch-memfd-secret branch from 955ae9f to 1deb04a Compare October 13, 2026 00:21

@kolyshkin kolyshkin left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased; squashed the two commits for clarity

@kolyshkin kolyshkin changed the title arch: read the syscall ABIs from Makefile.syscalls; add memfd_secret to loongarch64 BUG: arch: read the syscall ABIs from Makefile.syscalls; add memfd_secret to loongarch64 Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant