Skip to content

syscalls: align argument names for m68k and i386 with canonical definitions - #47

Open
Yudis-bit wants to merge 1 commit into
google:masterfrom
Yudis-bit:fix/syscall-metadata-consistency
Open

Yudis-bit wants to merge 1 commit into
google:masterfrom
Yudis-bit:fix/syscall-metadata-consistency

Conversation

@Yudis-bit

@Yudis-bit Yudis-bit commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem

In Kafel, argument names are part of the policy syntax. Inconsistencies across architecture tables break cross-compilation of portable policies.

For example, the following valid policy compiles on amd64 and aarch64, but currently fails on i386 and m68k:

POLICY sample {
  ALLOW {
    statx { statxbuf != NULL },
    setxattrat { dfd == AT_FDCWD }
  }
}
  • On i386: fails with unknown argument statxbuf (table had buffer).
  • On m68k: fails with unknown argument dfd (table had dirfd).

Changes

Align i386 and m68k syscall argument definitions with generic Linux UAPI (asm-generic/unistd.h) and other architecture tables in src/syscalls/:

  1. i386 (src/syscalls/i386_syscalls.c)

    • statx: buffer -> statxbuf (ARG_4)
  2. m68k (src/syscalls/m68k_syscalls.c)

    • fsopen: _fs_name -> fs_name (ARG_0)
    • fsconfig: _key, _value -> key, value (ARG_2, ARG_3)
    • setxattrat, getxattrat, listxattrat, removexattrat, open_tree_attr, file_getattr, file_setattr: dirfd -> dfd (ARG_0)

Verification

  • Confirmed argument identifiers against Linux UAPI headers (include/uapi/asm-generic/unistd.h, include/uapi/linux/fs.h).
  • Verified build and test suite pass cleanly:
    make clean && make test

…itions

Align syscall argument names across architectures to ensure cross-platform policy portability:
- In src/syscalls/i386_syscalls.c: rename statx ARG_4 from 'buffer' to 'statxbuf' to match amd64, aarch64, riscv64, and m68k.
- In src/syscalls/m68k_syscalls.c:
  * Rename fsopen ARG_0 from '_fs_name' to 'fs_name'.
  * Rename fsconfig ARG_2 and ARG_3 from '_key' and '_value' to 'key' and 'value'.
  * Rename ARG_0 of setxattrat, getxattrat, listxattrat, removexattrat, open_tree_attr, file_getattr, and file_setattr from 'dirfd' to 'dfd' to match the generic Linux UAPI definitions and other architecture tables.

This branch has not been deployed

No deployments
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