Skip to content

RFE: Update syscalls.csv to kernel version v7.0-rc7#485

Open
drakenclimber wants to merge 6 commits intoseccomp:mainfrom
drakenclimber:v7.0-rc7
Open

RFE: Update syscalls.csv to kernel version v7.0-rc7#485
drakenclimber wants to merge 6 commits intoseccomp:mainfrom
drakenclimber:v7.0-rc7

Conversation

@drakenclimber
Copy link
Copy Markdown
Member

In this patchset:

  • Update syscalls.csv to the latest kernel version, v7.0-rc7
  • Document the process to update syscalls.csv
  • Various minor improvements to the tools to build syscalls.csv
  • Remove 32-bit s390 since it's no longer supported

For the libseccomp v2.6.x releases, I think we won't want to backport the s390-removal patch.

Here's a comparison of the HEAD syscalls.csv (with the s390 columns removed) and the proposed syscalls.csv.
https://www.textcompare.org/csv/?id=69dead128329b015e57a0320

Add enumerations for kernels 6.18, 6.19, and 7.0

Signed-off-by: Tom Hromatka (Oracle) <tom.hromatka@gmail.com>
A few minor improvements to the script that builds the kernel version
tables:
* Improve the copy logic from the syscalls-table tool so that the
  the syscall tables are copied directly to target directory and not
  to a child directory
* Convert relative paths to absolute path.  The syscalls-table tool
  does not support relative paths
* Add the latest kernel version numbers to the built-in list.  (This
  isn't strictly required as the tool can handle arbitrary input from
  the user, but it's an easy update while we're already modifying the
  script.)

Signed-off-by: Tom Hromatka (Oracle) <tom.hromatka@gmail.com>
A few minor improvements to the script that updates the
syscalls.csv file:
* Remove file_getattr() and file_setattr() from the ignored
  syscalls list
* Properly initialize a new row (when a syscall is added) with
  PNR,SCMP_KV_UNDEF,... rather than PNR,PNR,...
* Add support for release candidate kernels
* Convert relative paths to absolute paths

Signed-off-by: Tom Hromatka (Oracle) <tom.hromatka@gmail.com>
Signed-off-by: Tom Hromatka (Oracle) <tom.hromatka@gmail.com>
32-bit s390 support was removed from the Linux kernel in commit
8e0b986c59c6 ("s390: Remove compat support").  The syscalls-table tool
removed s390 support in commit cec0b6e6d36d ("S/390 32-bit is no longer
in Linux kernel").

Based on these commits, remove s390 from libseccomp.  Note that s390x
support continues in the kernel, the syscalls-table tool, and in
libseccomp.

Signed-off-by: Tom Hromatka (Oracle) <tom.hromatka@gmail.com>
Add documentation on how to update syscalls.csv.

Here are the exact steps and results for updating syscalls.csv to
kernels v6.14 through v7.0-rc7

$ apt install libc6-dev-x32

$ git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
$ git clone https://github.com/hrw/syscalls-table.git
$ git clone git@github.com:<yourrepo>/libseccomp.git

$ cd libseccomp

$ vim include/seccomp-kvers.h
  --> add new syscall enumerations

$ time ./src/arch-build-kver-tables.py -d ../syscalls-table -k ../linux -V 6.14,6.15,6.16,6.17,6.18,6.19,7.0-rc7
Building version table for kernel 6.14
Building version table for kernel 6.15
Building version table for kernel 6.16
Building version table for kernel 6.17
Building version table for kernel 6.18
Building version table for kernel 6.19
Building version table for kernel 7.0-rc7

real    2m47.672s
user    1m22.094s
sys     1m23.954s

$ time ./src/arch-update-syscalls-csv.py -a -d ./ -k ../linux -c
src/syscalls.csv -V 6.14,6.15,6.16,6.17,6.18,6.19,7.0-rc7
Updating src/syscalls.csv version table for kernel 6.14
Updating src/syscalls.csv version table for kernel 6.15
Updating src/syscalls.csv version table for kernel 6.16
Updating src/syscalls.csv version table for kernel 6.17
Updating src/syscalls.csv version table for kernel 6.18
Updating src/syscalls.csv version table for kernel 6.19
Updating src/syscalls.csv version table for kernel 7.0-rc7

real    0m30.112s
user    0m20.716s
sys     0m9.547s

$ vim include-seccomp-syscalls.h
  --> add new syscall __SNR and __PNR entries as appropriate

$ ./src/arch-syscall-check
  --> Make changes as recommended by this script
  --> Re-run this script until there are no more changes to be made

$ cd src
$ ./arch-syscall-validate -c syscalls-prev.csv ../../linux/
$ git diff HEAD syscalls.csv
$ diff syscalls-prev.csv with syscalls.csv

Signed-off-by: Tom Hromatka (Oracle) <tom.hromatka@gmail.com>
@drakenclimber
Copy link
Copy Markdown
Member Author

Fixes: #480

@drakenclimber
Copy link
Copy Markdown
Member Author

Before we merge this patchset, we should probably also add this patch that sets the kernel versions for all existing syscalls.

031024a

I'll add it to this patchset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant