diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-06-28 13:01:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-28 13:01:01 +0200 |
commit | aaec2216602ce3a26b7bca30eaf28e525ef5e762 (patch) | |
tree | 711e55658813a396801efacf4a5203129b7c76d1 | |
parent | github: add more components to RFE issue template (diff) | |
parent | gpt: add PARISC UUIDs (diff) | |
download | systemd-aaec2216602ce3a26b7bca30eaf28e525ef5e762.tar.xz systemd-aaec2216602ce3a26b7bca30eaf28e525ef5e762.zip |
Merge pull request #23181 from thesamesam/parisc-seccomp
Add seccomp support for PARISC (HPPA)
-rw-r--r-- | docs/DISCOVERABLE_PARTITIONS.md | 6 | ||||
-rw-r--r-- | src/basic/meson.build | 1 | ||||
-rw-r--r-- | src/basic/missing_syscall_def.h | 35 | ||||
-rw-r--r-- | src/basic/missing_syscalls.py | 2 | ||||
-rw-r--r-- | src/basic/syscalls-loongarch64.txt | 4 | ||||
-rw-r--r-- | src/basic/syscalls-parisc.txt | 601 | ||||
-rw-r--r-- | src/basic/syscalls-riscv32.txt | 2 | ||||
-rw-r--r-- | src/basic/syscalls-riscv64.txt | 2 | ||||
-rw-r--r-- | src/shared/gpt.c | 1 | ||||
-rw-r--r-- | src/shared/gpt.h | 6 | ||||
-rw-r--r-- | src/shared/seccomp-util.c | 35 | ||||
-rw-r--r-- | src/test/test-seccomp.c | 2 |
12 files changed, 691 insertions, 6 deletions
diff --git a/docs/DISCOVERABLE_PARTITIONS.md b/docs/DISCOVERABLE_PARTITIONS.md index 544387ce04..122cc06953 100644 --- a/docs/DISCOVERABLE_PARTITIONS.md +++ b/docs/DISCOVERABLE_PARTITIONS.md @@ -49,6 +49,7 @@ boot loader communicates this information to the OS, by implementing the | _Root Partition (LoongArch 64-bit)_ | `77055800-792c-4f94-b39a-98c91b762bb6` | ditto | ditto | | _Root Partition (32-bit MIPS LittleEndian (mipsel))_ | `37c58c8a-d913-4156-a25f-48b1b64e07f0` | ditto | ditto | | _Root Partition (64-bit MIPS LittleEndian (mips64el))_ | `700bda43-7a34-4507-b179-eeb93d7a7ca3` | ditto | ditto | +| _Root Partition (HPPA/PARISC)_ | `1aacdb3b-5444-4138-bd9e-e5c2239b2346` | ditto | ditto | | _Root Partition (32-bit PowerPC)_ | `1de3f1ef-fa98-47b5-8dcd-4a860a654d78` | ditto | ditto | | _Root Partition (64-bit PowerPC BigEndian)_ | `912ade1d-a839-4913-8964-a10eee08fbd2` | ditto | ditto | | _Root Partition (64-bit PowerPC LittleEndian)_ | `c31c45e6-3f39-412e-80fb-4809c4980599` | ditto | ditto | @@ -67,6 +68,7 @@ boot loader communicates this information to the OS, by implementing the | _`/usr/` Partition (LoongArch 64-bit)_ | `e611c702-575c-4cbe-9a46-434fa0bf7e3f` | ditto | ditto | | _`/usr/` Partition (32-bit MIPS LittleEndian (mipsel))_ | `0f4868e9-9952-4706-979f-3ed3a473e947` | ditto | ditto | | _`/usr/` Partition (64-bit MIPS LittleEndian (mips64el))_ | `c97c1f32-ba06-40b4-9f22-236061b08aa8` | ditto | ditto | +| _`/usr/` Partition (HPPA/PARISC)_ | `dc4a4480-6917-4262-a4ec-db9384949f25` | ditto | ditto | | _`/usr/` Partition (32-bit PowerPC)_ | `7d14fec5-cc71-415d-9d6c-06bf0b3c3eaf` | ditto | ditto | | _`/usr/` Partition (64-bit PowerPC BigEndian)_ | `2c9739e2-f068-46b3-9fd0-01c5a9afbcca` | ditto | ditto | | _`/usr/` Partition (64-bit PowerPC LittleEndian)_ | `15bb03af-77e7-4d4a-b12b-c0d084f7491c` | ditto | ditto | @@ -85,6 +87,7 @@ boot loader communicates this information to the OS, by implementing the | _Root Verity Partition (LoongArch 64-bit)_ | `f3393b22-e9af-4613-a948-9d3bfbd0c535` | ditto | ditto | | _Root Verity Partition (32-bit MIPS LittleEndian (mipsel))_ | `d7d150d2-2a04-4a33-8f12-16651205ff7b` | ditto | ditto | | _Root Verity Partition (64-bit MIPS LittleEndian (mips64el))_ | `16b417f8-3e06-4f57-8dd2-9b5232f41aa6` | ditto | ditto | +| _Root Verity Partition (HPPA/PARISC)_ | `d212a430-fbc5-49f9-a983-a7feef2b8d0e` | ditto | ditto | | _Root Verity Partition (64-bit PowerPC LittleEndian)_ | `906bd944-4589-4aae-a4e4-dd983917446a` | ditto | ditto | | _Root Verity Partition (64-bit PowerPC BigEndian)_ | `9225a9a3-3c19-4d89-b4f6-eeff88f17631` | ditto | ditto | | _Root Verity Partition (32-bit PowerPC)_ | `98cfe649-1588-46dc-b2f0-add147424925` | ditto | ditto | @@ -103,6 +106,7 @@ boot loader communicates this information to the OS, by implementing the | _`/usr/` Verity Partition (LoongArch 64-bit)_ | `f46b2c26-59ae-48f0-9106-c50ed47f673d` | ditto | ditto | | _`/usr/` Verity Partition (32-bit MIPS LittleEndian (mipsel))_ | `46b98d8d-b55c-4e8f-aab3-37fca7f80752` | ditto | ditto | | _`/usr/` Verity Partition (64-bit MIPS LittleEndian (mips64el))_ | `3c3d61fe-b5f3-414d-bb71-8739a694a4ef` | ditto | ditto | +| _`/usr/` Verity Partition (HPPA/PARISC)_ | `5843d618-ec37-48d7-9f12-cea8e08768b2` | ditto | ditto | | _`/usr/` Verity Partition (64-bit PowerPC LittleEndian)_ | `ee2b9983-21e8-4153-86d9-b6901a54d1ce` | ditto | ditto | | _`/usr/` Verity Partition (64-bit PowerPC BigEndian)_ | `bdb528a5-a259-475f-a87d-da53fa736a07` | ditto | ditto | | _`/usr/` Verity Partition (32-bit PowerPC)_ | `df765d00-270e-49e5-bc75-f47bb2118b09` | ditto | ditto | @@ -121,6 +125,7 @@ boot loader communicates this information to the OS, by implementing the | _Root Verity Signature Partition (LoongArch 64-bit)_ | `5afb67eb-ecc8-4f85-ae8e-ac1e7c50e7d0` | ditto | ditto | | _Root Verity Signature Partition (32-bit MIPS LittleEndian (mipsel))_ | `c919cc1f-4456-4eff-918c-f75e94525ca5` | ditto | ditto | | _Root Verity Signature Partition (64-bit MIPS LittleEndian (mips64el))_ | `904e58ef-5c65-4a31-9c57-6af5fc7c5de7` | ditto | ditto | +| _Root Verity Signature Partition (HPPA/PARISC)_ | `15de6170-65d3-431c-916e-b0dcd8393f25` | ditto | ditto | | _Root Verity Signature Partition (64-bit PowerPC LittleEndian)_ | `d4a236e7-e873-4c07-bf1d-bf6cf7f1c3c6` | ditto | ditto | | _Root Verity Signature Partition (64-bit PowerPC BigEndian)_ | `f5e2c20c-45b2-4ffa-bce9-2a60737e1aaf` | ditto | ditto | | _Root Verity Signature Partition (32-bit PowerPC)_ | `1b31b5aa-add9-463a-b2ed-bd467fc857e7` | ditto | ditto | @@ -137,6 +142,7 @@ boot loader communicates this information to the OS, by implementing the | _`/usr/` Verity Signature Partition (64-bit ARM/AArch64)_ | `c23ce4ff-44bd-4b00-b2d4-b41b3419e02a` | ditto | ditto | | _`/usr/` Verity Signature Partition (Itanium/IA-64)_ | `8de58bc2-2a43-460d-b14e-a76e4a17b47f` | ditto | ditto | | _`/usr/` Verity Signature Partition (LoongArch 64-bit)_ | `b024f315-d330-444c-8461-44bbde524e99` | ditto | ditto | +| _`/usr/` Verity Signature Partition (HPPA/PARISC)_ | `450dd7d1-3224-45ec-9cf2-a43a346d71ee` | ditto | ditto | | _`/usr/` Verity Signature Partition (32-bit MIPS LittleEndian (mipsel))_ | `3e23ca0b-a4bc-4b4e-8087-5ab6a26aa8a9` | ditto | ditto | | _`/usr/` Verity Signature Partition (64-bit MIPS LittleEndian (mips64el))_ | `f2c2c7ee-adcc-4351-b5c6-ee9816b66e16` | ditto | ditto | | _`/usr/` Verity Signature Partition (64-bit PowerPC LittleEndian)_ | `c8bfbd1e-268e-4521-8bba-bf314c399557` | ditto | ditto | diff --git a/src/basic/meson.build b/src/basic/meson.build index 7b5a6f9cfe..cc4d948abd 100644 --- a/src/basic/meson.build +++ b/src/basic/meson.build @@ -348,6 +348,7 @@ arch_list = [ 'mips64', 'mips64n32', 'mipso32', + 'parisc', 'powerpc', 'powerpc64', 'riscv32', diff --git a/src/basic/missing_syscall_def.h b/src/basic/missing_syscall_def.h index 88df92db61..67cae7098d 100644 --- a/src/basic/missing_syscall_def.h +++ b/src/basic/missing_syscall_def.h @@ -23,6 +23,7 @@ # else # error "Unknown MIPS ABI" # endif +# elif defined(__hppa__) # elif defined(__powerpc__) # elif defined(__riscv) # if __riscv_xlen == 32 @@ -68,6 +69,8 @@ # else # error "Unknown MIPS ABI" # endif +# elif defined(__hppa__) +# define systemd_NR_bpf 341 # elif defined(__powerpc__) # define systemd_NR_bpf 361 # elif defined(__riscv) @@ -134,6 +137,8 @@ assert_cc(__NR_bpf == systemd_NR_bpf); # else # error "Unknown MIPS ABI" # endif +# elif defined(__hppa__) +# define systemd_NR_close_range 436 # elif defined(__powerpc__) # define systemd_NR_close_range 436 # elif defined(__riscv) @@ -200,6 +205,8 @@ assert_cc(__NR_close_range == systemd_NR_close_range); # else # error "Unknown MIPS ABI" # endif +# elif defined(__hppa__) +# define systemd_NR_copy_file_range 346 # elif defined(__powerpc__) # define systemd_NR_copy_file_range 379 # elif defined(__riscv) @@ -266,6 +273,8 @@ assert_cc(__NR_copy_file_range == systemd_NR_copy_file_range); # else # error "Unknown MIPS ABI" # endif +# elif defined(__hppa__) +# define systemd_NR_epoll_pwait2 441 # elif defined(__powerpc__) # define systemd_NR_epoll_pwait2 441 # elif defined(__riscv) @@ -332,6 +341,8 @@ assert_cc(__NR_epoll_pwait2 == systemd_NR_epoll_pwait2); # else # error "Unknown MIPS ABI" # endif +# elif defined(__hppa__) +# define systemd_NR_getrandom 339 # elif defined(__powerpc__) # define systemd_NR_getrandom 359 # elif defined(__riscv) @@ -398,6 +409,8 @@ assert_cc(__NR_getrandom == systemd_NR_getrandom); # else # error "Unknown MIPS ABI" # endif +# elif defined(__hppa__) +# define systemd_NR_memfd_create 340 # elif defined(__powerpc__) # define systemd_NR_memfd_create 360 # elif defined(__riscv) @@ -464,6 +477,8 @@ assert_cc(__NR_memfd_create == systemd_NR_memfd_create); # else # error "Unknown MIPS ABI" # endif +# elif defined(__hppa__) +# define systemd_NR_mount_setattr 442 # elif defined(__powerpc__) # define systemd_NR_mount_setattr 442 # elif defined(__riscv) @@ -530,6 +545,8 @@ assert_cc(__NR_mount_setattr == systemd_NR_mount_setattr); # else # error "Unknown MIPS ABI" # endif +# elif defined(__hppa__) +# define systemd_NR_move_mount 429 # elif defined(__powerpc__) # define systemd_NR_move_mount 429 # elif defined(__riscv) @@ -596,6 +613,8 @@ assert_cc(__NR_move_mount == systemd_NR_move_mount); # else # error "Unknown MIPS ABI" # endif +# elif defined(__hppa__) +# define systemd_NR_name_to_handle_at 325 # elif defined(__powerpc__) # define systemd_NR_name_to_handle_at 345 # elif defined(__riscv) @@ -662,6 +681,8 @@ assert_cc(__NR_name_to_handle_at == systemd_NR_name_to_handle_at); # else # error "Unknown MIPS ABI" # endif +# elif defined(__hppa__) +# define systemd_NR_open_tree 428 # elif defined(__powerpc__) # define systemd_NR_open_tree 428 # elif defined(__riscv) @@ -728,6 +749,8 @@ assert_cc(__NR_open_tree == systemd_NR_open_tree); # else # error "Unknown MIPS ABI" # endif +# elif defined(__hppa__) +# define systemd_NR_openat2 437 # elif defined(__powerpc__) # define systemd_NR_openat2 437 # elif defined(__riscv) @@ -794,6 +817,8 @@ assert_cc(__NR_openat2 == systemd_NR_openat2); # else # error "Unknown MIPS ABI" # endif +# elif defined(__hppa__) +# define systemd_NR_pidfd_open 434 # elif defined(__powerpc__) # define systemd_NR_pidfd_open 434 # elif defined(__riscv) @@ -860,6 +885,8 @@ assert_cc(__NR_pidfd_open == systemd_NR_pidfd_open); # else # error "Unknown MIPS ABI" # endif +# elif defined(__hppa__) +# define systemd_NR_pidfd_send_signal 424 # elif defined(__powerpc__) # define systemd_NR_pidfd_send_signal 424 # elif defined(__riscv) @@ -926,6 +953,8 @@ assert_cc(__NR_pidfd_send_signal == systemd_NR_pidfd_send_signal); # else # error "Unknown MIPS ABI" # endif +# elif defined(__hppa__) +# define systemd_NR_pkey_mprotect 351 # elif defined(__powerpc__) # define systemd_NR_pkey_mprotect 386 # elif defined(__riscv) @@ -992,6 +1021,8 @@ assert_cc(__NR_pkey_mprotect == systemd_NR_pkey_mprotect); # else # error "Unknown MIPS ABI" # endif +# elif defined(__hppa__) +# define systemd_NR_renameat2 337 # elif defined(__powerpc__) # define systemd_NR_renameat2 357 # elif defined(__riscv) @@ -1058,6 +1089,8 @@ assert_cc(__NR_renameat2 == systemd_NR_renameat2); # else # error "Unknown MIPS ABI" # endif +# elif defined(__hppa__) +# define systemd_NR_setns 328 # elif defined(__powerpc__) # define systemd_NR_setns 350 # elif defined(__riscv) @@ -1124,6 +1157,8 @@ assert_cc(__NR_setns == systemd_NR_setns); # else # error "Unknown MIPS ABI" # endif +# elif defined(__hppa__) +# define systemd_NR_statx 349 # elif defined(__powerpc__) # define systemd_NR_statx 383 # elif defined(__riscv) diff --git a/src/basic/missing_syscalls.py b/src/basic/missing_syscalls.py index 83199bb1d7..642d4d985d 100644 --- a/src/basic/missing_syscalls.py +++ b/src/basic/missing_syscalls.py @@ -74,6 +74,8 @@ DEF_TEMPLATE_B = '''\ # else # error "Unknown MIPS ABI" # endif +# elif defined(__hppa__) +# define systemd_NR_{syscall} {nr_parisc} # elif defined(__powerpc__) # define systemd_NR_{syscall} {nr_powerpc} # elif defined(__riscv) diff --git a/src/basic/syscalls-loongarch64.txt b/src/basic/syscalls-loongarch64.txt index 848e9e90aa..a6a0bca93a 100644 --- a/src/basic/syscalls-loongarch64.txt +++ b/src/basic/syscalls-loongarch64.txt @@ -96,7 +96,7 @@ fsetxattr 7 fsmount 432 fsopen 430 fspick 433 -fstat 80 +fstat fstat64 fstatat64 fstatfs 44 @@ -243,7 +243,7 @@ munlockall 231 munmap 215 name_to_handle_at 264 nanosleep 101 -newfstatat 79 +newfstatat nfsservctl 42 nice old_adjtimex diff --git a/src/basic/syscalls-parisc.txt b/src/basic/syscalls-parisc.txt new file mode 100644 index 0000000000..905729f819 --- /dev/null +++ b/src/basic/syscalls-parisc.txt @@ -0,0 +1,601 @@ +_llseek 140 +_newselect 142 +_sysctl 149 +accept 35 +accept4 320 +access 33 +acct 51 +add_key 264 +adjtimex 124 +alarm 27 +arc_gettls +arc_settls +arc_usr_cmpxchg +arch_prctl +arm_fadvise64_64 +atomic_barrier +atomic_cmpxchg_32 +bdflush 134 +bind 22 +bpf 341 +brk 45 +cachectl +cacheflush +capget 106 +capset 107 +chdir 12 +chmod 15 +chown 180 +chown32 +chroot 61 +clock_adjtime 324 +clock_adjtime64 405 +clock_getres 257 +clock_getres_time64 406 +clock_gettime 256 +clock_gettime64 403 +clock_nanosleep 258 +clock_nanosleep_time64 407 +clock_settime 255 +clock_settime64 404 +clone 120 +clone2 +clone3 435 +close 6 +close_range 436 +connect 31 +copy_file_range 346 +creat 8 +create_module +delete_module 129 +dipc +dup 41 +dup2 63 +dup3 312 +epoll_create 224 +epoll_create1 311 +epoll_ctl 225 +epoll_ctl_old +epoll_pwait 297 +epoll_pwait2 441 +epoll_wait 226 +epoll_wait_old +eventfd 304 +eventfd2 310 +exec_with_loader +execv +execve 11 +execveat 342 +exit 1 +exit_group 222 +faccessat 287 +faccessat2 439 +fadvise64 +fadvise64_64 236 +fallocate 305 +fanotify_init 322 +fanotify_mark 323 +fchdir 133 +fchmod 94 +fchmodat 286 +fchown 95 +fchown32 +fchownat 278 +fcntl 55 +fcntl64 202 +fdatasync 148 +fgetxattr 243 +finit_module 333 +flistxattr 246 +flock 143 +fork 2 +fp_udfiex_crtl +fremovexattr 249 +fsconfig 431 +fsetxattr 240 +fsmount 432 +fsopen 430 +fspick 433 +fstat 28 +fstat64 112 +fstatat64 280 +fstatfs 100 +fstatfs64 299 +fsync 118 +ftruncate 93 +ftruncate64 200 +futex 210 +futex_time64 422 +futex_waitv 449 +futimesat 279 +get_kernel_syms +get_mempolicy 261 +get_robust_list 290 +get_thread_area +getcpu 296 +getcwd 110 +getdents 141 +getdents64 201 +getdomainname +getdtablesize +getegid 50 +getegid32 +geteuid 49 +geteuid32 +getgid 47 +getgid32 +getgroups 80 +getgroups32 +gethostname +getitimer 105 +getpagesize +getpeername 53 +getpgid 132 +getpgrp 65 +getpid 20 +getpmsg +getppid 64 +getpriority 96 +getrandom 339 +getresgid 171 +getresgid32 +getresuid 165 +getresuid32 +getrlimit 76 +getrusage 77 +getsid 147 +getsockname 44 +getsockopt 182 +gettid 206 +gettimeofday 78 +getuid 24 +getuid32 +getunwind +getxattr 241 +getxgid +getxpid +getxuid +idle +init_module 128 +inotify_add_watch 270 +inotify_init 269 +inotify_init1 314 +inotify_rm_watch 271 +io_cancel 219 +io_destroy 216 +io_getevents 217 +io_pgetevents 350 +io_pgetevents_time64 416 +io_setup 215 +io_submit 218 +io_uring_enter 426 +io_uring_register 427 +io_uring_setup 425 +ioctl 54 +ioperm +iopl +ioprio_get 268 +ioprio_set 267 +ipc +kcmp 332 +kern_features +kexec_file_load 355 +kexec_load 300 +keyctl 266 +kill 37 +landlock_add_rule 445 +landlock_create_ruleset 444 +landlock_restrict_self 446 +lchown 16 +lchown32 +lgetxattr 242 +link 9 +linkat 283 +listen 32 +listxattr 244 +llistxattr 245 +lookup_dcookie 223 +lremovexattr 248 +lseek 19 +lsetxattr 239 +lstat 84 +lstat64 198 +madvise 119 +mbind 260 +membarrier 343 +memfd_create 340 +memfd_secret +memory_ordering +migrate_pages 272 +mincore 72 +mkdir 39 +mkdirat 276 +mknod 14 +mknodat 277 +mlock 150 +mlock2 345 +mlockall 152 +mmap 90 +mmap2 89 +modify_ldt +mount 21 +mount_setattr 442 +move_mount 429 +move_pages 295 +mprotect 125 +mq_getsetattr 234 +mq_notify 233 +mq_open 229 +mq_timedreceive 232 +mq_timedreceive_time64 419 +mq_timedsend 231 +mq_timedsend_time64 418 +mq_unlink 230 +mremap 163 +msgctl 191 +msgget 190 +msgrcv 189 +msgsnd 188 +msync 144 +multiplexer +munlock 151 +munlockall 153 +munmap 91 +name_to_handle_at 325 +nanosleep 162 +newfstatat +nfsservctl +nice 34 +old_adjtimex +old_getpagesize +oldfstat +oldlstat +oldolduname +oldstat +oldumount +olduname +open 5 +open_by_handle_at 326 +open_tree 428 +openat 275 +openat2 437 +or1k_atomic +osf_adjtime +osf_afs_syscall +osf_alt_plock +osf_alt_setsid +osf_alt_sigpending +osf_asynch_daemon +osf_audcntl +osf_audgen +osf_chflags +osf_execve +osf_exportfs +osf_fchflags +osf_fdatasync +osf_fpathconf +osf_fstat +osf_fstatfs +osf_fstatfs64 +osf_fuser +osf_getaddressconf +osf_getdirentries +osf_getdomainname +osf_getfh +osf_getfsstat +osf_gethostid +osf_getitimer +osf_getlogin +osf_getmnt +osf_getrusage +osf_getsysinfo +osf_gettimeofday +osf_kloadcall +osf_kmodcall +osf_lstat +osf_memcntl +osf_mincore +osf_mount +osf_mremap +osf_msfs_syscall +osf_msleep +osf_mvalid +osf_mwakeup +osf_naccept +osf_nfssvc +osf_ngetpeername +osf_ngetsockname +osf_nrecvfrom +osf_nrecvmsg +osf_nsendmsg +osf_ntp_adjtime +osf_ntp_gettime +osf_old_creat +osf_old_fstat +osf_old_getpgrp +osf_old_killpg +osf_old_lstat +osf_old_open +osf_old_sigaction +osf_old_sigblock +osf_old_sigreturn +osf_old_sigsetmask +osf_old_sigvec +osf_old_stat +osf_old_vadvise +osf_old_vtrace +osf_old_wait +osf_oldquota +osf_pathconf +osf_pid_block +osf_pid_unblock +osf_plock +osf_priocntlset +osf_profil +osf_proplist_syscall +osf_reboot +osf_revoke +osf_sbrk +osf_security +osf_select +osf_set_program_attributes +osf_set_speculative +osf_sethostid +osf_setitimer +osf_setlogin +osf_setsysinfo +osf_settimeofday +osf_shmat +osf_signal +osf_sigprocmask +osf_sigsendset +osf_sigstack +osf_sigwaitprim +osf_sstk +osf_stat +osf_statfs +osf_statfs64 +osf_subsys_info +osf_swapctl +osf_swapon +osf_syscall +osf_sysinfo +osf_table +osf_uadmin +osf_usleep_thread +osf_uswitch +osf_utc_adjtime +osf_utc_gettime +osf_utimes +osf_utsname +osf_wait4 +osf_waitid +pause 29 +pciconfig_iobase +pciconfig_read +pciconfig_write +perf_event_open 318 +perfctr +personality 136 +pidfd_getfd 438 +pidfd_open 434 +pidfd_send_signal 424 +pipe 42 +pipe2 313 +pivot_root 67 +pkey_alloc 352 +pkey_free 353 +pkey_mprotect 351 +poll 168 +ppoll 274 +ppoll_time64 414 +prctl 172 +pread64 108 +preadv 315 +preadv2 347 +prlimit64 321 +process_madvise 440 +process_mrelease 448 +process_vm_readv 330 +process_vm_writev 331 +pselect6 273 +pselect6_time64 413 +ptrace 26 +pwrite64 109 +pwritev 316 +pwritev2 348 +query_module +quotactl 131 +quotactl_fd 443 +read 3 +readahead 207 +readdir +readlink 85 +readlinkat 285 +readv 145 +reboot 88 +recv 98 +recvfrom 123 +recvmmsg 319 +recvmmsg_time64 417 +recvmsg 184 +remap_file_pages 227 +removexattr 247 +rename 38 +renameat 282 +renameat2 337 +request_key 265 +restart_syscall 0 +riscv_flush_icache +rmdir 40 +rseq 354 +rt_sigaction 174 +rt_sigpending 176 +rt_sigprocmask 175 +rt_sigqueueinfo 178 +rt_sigreturn 173 +rt_sigsuspend 179 +rt_sigtimedwait 177 +rt_sigtimedwait_time64 421 +rt_tgsigqueueinfo 317 +rtas +s390_guarded_storage +s390_pci_mmio_read +s390_pci_mmio_write +s390_runtime_instr +s390_sthyi +sched_get_affinity +sched_get_priority_max 159 +sched_get_priority_min 160 +sched_getaffinity 212 +sched_getattr 335 +sched_getparam 155 +sched_getscheduler 157 +sched_rr_get_interval 161 +sched_rr_get_interval_time64 423 +sched_set_affinity +sched_setaffinity 211 +sched_setattr 334 +sched_setparam 154 +sched_setscheduler 156 +sched_yield 158 +seccomp 338 +select +semctl 187 +semget 186 +semop 185 +semtimedop 228 +semtimedop_time64 420 +send 58 +sendfile 122 +sendfile64 209 +sendmmsg 329 +sendmsg 183 +sendto 82 +set_mempolicy 262 +set_mempolicy_home_node 450 +set_robust_list 289 +set_thread_area +set_tid_address 237 +setdomainname 121 +setfsgid 139 +setfsgid32 +setfsuid 138 +setfsuid32 +setgid 46 +setgid32 +setgroups 81 +setgroups32 +sethae +sethostname 74 +setitimer 104 +setns 328 +setpgid 57 +setpgrp +setpriority 97 +setregid 71 +setregid32 +setresgid 170 +setresgid32 +setresuid 164 +setresuid32 +setreuid 70 +setreuid32 +setrlimit 75 +setsid 66 +setsockopt 181 +settimeofday 79 +setuid 23 +setuid32 +setxattr 238 +sgetmask 68 +shmat 192 +shmctl 195 +shmdt 193 +shmget 194 +shutdown 117 +sigaction +sigaltstack 166 +signal 48 +signalfd 302 +signalfd4 309 +sigpending 73 +sigprocmask 126 +sigreturn +sigsuspend +socket 17 +socketcall +socketpair 56 +splice 291 +spu_create +spu_run +ssetmask 69 +stat 18 +stat64 101 +statfs 99 +statfs64 298 +statx 349 +stime 25 +subpage_prot +swapcontext +swapoff 115 +swapon 87 +switch_endian +symlink 83 +symlinkat 284 +sync 36 +sync_file_range 292 +sync_file_range2 +syncfs 327 +sys_debug_setcontext +syscall +sysfs 135 +sysinfo 116 +syslog 103 +sysmips +tee 293 +tgkill 259 +time 13 +timer_create 250 +timer_delete 254 +timer_getoverrun 253 +timer_gettime 252 +timer_gettime64 408 +timer_settime 251 +timer_settime64 409 +timerfd +timerfd_create 306 +timerfd_gettime 308 +timerfd_gettime64 410 +timerfd_settime 307 +timerfd_settime64 411 +times 43 +tkill 208 +truncate 92 +truncate64 199 +ugetrlimit +umask 60 +umount +umount2 52 +uname 59 +unlink 10 +unlinkat 281 +unshare 288 +uselib 86 +userfaultfd 344 +ustat 62 +utime 30 +utimensat 301 +utimensat_time64 412 +utimes 336 +utrap_install +vfork 113 +vhangup 111 +vm86 +vm86old +vmsplice 294 +wait4 114 +waitid 235 +waitpid 7 +write 4 +writev 146 diff --git a/src/basic/syscalls-riscv32.txt b/src/basic/syscalls-riscv32.txt index 2a4aceff94..50f4de65b8 100644 --- a/src/basic/syscalls-riscv32.txt +++ b/src/basic/syscalls-riscv32.txt @@ -204,7 +204,7 @@ madvise 233 mbind 235 membarrier 283 memfd_create 279 -memfd_secret +memfd_secret 447 memory_ordering migrate_pages 238 mincore 232 diff --git a/src/basic/syscalls-riscv64.txt b/src/basic/syscalls-riscv64.txt index 07d1d4253a..afa33b2bcc 100644 --- a/src/basic/syscalls-riscv64.txt +++ b/src/basic/syscalls-riscv64.txt @@ -204,7 +204,7 @@ madvise 233 mbind 235 membarrier 283 memfd_create 279 -memfd_secret +memfd_secret 447 memory_ordering migrate_pages 238 mincore 232 diff --git a/src/shared/gpt.c b/src/shared/gpt.c index 88b32ac102..37f3919724 100644 --- a/src/shared/gpt.c +++ b/src/shared/gpt.c @@ -31,6 +31,7 @@ const GptPartitionType gpt_partition_type_table[] = { _GPT_ARCH_SEXTET(LOONGARCH64, "loongarch64"), _GPT_ARCH_SEXTET(MIPS_LE, "mips-le"), _GPT_ARCH_SEXTET(MIPS64_LE, "mips64-le"), + _GPT_ARCH_SEXTET(PARISC, "parisc"), _GPT_ARCH_SEXTET(PPC, "ppc"), _GPT_ARCH_SEXTET(PPC64, "ppc64"), _GPT_ARCH_SEXTET(PPC64_LE, "ppc64-le"), diff --git a/src/shared/gpt.h b/src/shared/gpt.h index 64416bb083..f49cfdac61 100644 --- a/src/shared/gpt.h +++ b/src/shared/gpt.h @@ -16,6 +16,7 @@ #define GPT_ROOT_LOONGARCH64 SD_ID128_MAKE(77,05,58,00,79,2c,4f,94,b3,9a,98,c9,1b,76,2b,b6) #define GPT_ROOT_MIPS_LE SD_ID128_MAKE(37,c5,8c,8a,d9,13,41,56,a2,5f,48,b1,b6,4e,07,f0) #define GPT_ROOT_MIPS64_LE SD_ID128_MAKE(70,0b,da,43,7a,34,45,07,b1,79,ee,b9,3d,7a,7c,a3) +#define GPT_ROOT_PARISC SD_ID128_MAKE(1a,ac,db,3b,54,44,41,38,bd,9e,e5,c2,23,9b,23,46) #define GPT_ROOT_PPC SD_ID128_MAKE(1d,e3,f1,ef,fa,98,47,b5,8d,cd,4a,86,0a,65,4d,78) #define GPT_ROOT_PPC64 SD_ID128_MAKE(91,2a,de,1d,a8,39,49,13,89,64,a1,0e,ee,08,fb,d2) #define GPT_ROOT_PPC64_LE SD_ID128_MAKE(c3,1c,45,e6,3f,39,41,2e,80,fb,48,09,c4,98,05,99) @@ -34,6 +35,7 @@ #define GPT_USR_LOONGARCH64 SD_ID128_MAKE(e6,11,c7,02,57,5c,4c,be,9a,46,43,4f,a0,bf,7e,3f) #define GPT_USR_MIPS_LE SD_ID128_MAKE(0f,48,68,e9,99,52,47,06,97,9f,3e,d3,a4,73,e9,47) #define GPT_USR_MIPS64_LE SD_ID128_MAKE(c9,7c,1f,32,ba,06,40,b4,9f,22,23,60,61,b0,8a,a8) +#define GPT_USR_PARISC SD_ID128_MAKE(dc,4a,44,80,69,17,42,62,a4,ec,db,93,84,94,9f,25) #define GPT_USR_PPC SD_ID128_MAKE(7d,14,fe,c5,cc,71,41,5d,9d,6c,06,bf,0b,3c,3e,af) #define GPT_USR_PPC64 SD_ID128_MAKE(2c,97,39,e2,f0,68,46,b3,9f,d0,01,c5,a9,af,bc,ca) #define GPT_USR_PPC64_LE SD_ID128_MAKE(15,bb,03,af,77,e7,4d,4a,b1,2b,c0,d0,84,f7,49,1c) @@ -55,6 +57,7 @@ #define GPT_ROOT_LOONGARCH64_VERITY SD_ID128_MAKE(f3,39,3b,22,e9,af,46,13,a9,48,9d,3b,fb,d0,c5,35) #define GPT_ROOT_MIPS_LE_VERITY SD_ID128_MAKE(d7,d1,50,d2,2a,04,4a,33,8f,12,16,65,12,05,ff,7b) #define GPT_ROOT_MIPS64_LE_VERITY SD_ID128_MAKE(16,b4,17,f8,3e,06,4f,57,8d,d2,9b,52,32,f4,1a,a6) +#define GPT_ROOT_PARISC_VERITY SD_ID128_MAKE(d2,12,a4,30,fb,c5,49,f9,a9,83,a7,fe,ef,2b,8d,0e) #define GPT_ROOT_PPC64_LE_VERITY SD_ID128_MAKE(90,6b,d9,44,45,89,4a,ae,a4,e4,dd,98,39,17,44,6a) #define GPT_ROOT_PPC64_VERITY SD_ID128_MAKE(92,25,a9,a3,3c,19,4d,89,b4,f6,ee,ff,88,f1,76,31) #define GPT_ROOT_PPC_VERITY SD_ID128_MAKE(98,cf,e6,49,15,88,46,dc,b2,f0,ad,d1,47,42,49,25) @@ -73,6 +76,7 @@ #define GPT_USR_LOONGARCH64_VERITY SD_ID128_MAKE(f4,6b,2c,26,59,ae,48,f0,91,06,c5,0e,d4,7f,67,3d) #define GPT_USR_MIPS_LE_VERITY SD_ID128_MAKE(46,b9,8d,8d,b5,5c,4e,8f,aa,b3,37,fc,a7,f8,07,52) #define GPT_USR_MIPS64_LE_VERITY SD_ID128_MAKE(3c,3d,61,fe,b5,f3,41,4d,bb,71,87,39,a6,94,a4,ef) +#define GPT_USR_PARISC_VERITY SD_ID128_MAKE(58,43,d6,18,ec,37,48,d7,9f,12,ce,a8,e0,87,68,b2) #define GPT_USR_PPC64_LE_VERITY SD_ID128_MAKE(ee,2b,99,83,21,e8,41,53,86,d9,b6,90,1a,54,d1,ce) #define GPT_USR_PPC64_VERITY SD_ID128_MAKE(bd,b5,28,a5,a2,59,47,5f,a8,7d,da,53,fa,73,6a,07) #define GPT_USR_PPC_VERITY SD_ID128_MAKE(df,76,5d,00,27,0e,49,e5,bc,75,f4,7b,b2,11,8b,09) @@ -93,6 +97,7 @@ #define GPT_ROOT_LOONGARCH64_VERITY_SIG SD_ID128_MAKE(5a,fb,67,eb,ec,c8,4f,85,ae,8e,ac,1e,7c,50,e7,d0) #define GPT_ROOT_MIPS_LE_VERITY_SIG SD_ID128_MAKE(c9,19,cc,1f,44,56,4e,ff,91,8c,f7,5e,94,52,5c,a5) #define GPT_ROOT_MIPS64_LE_VERITY_SIG SD_ID128_MAKE(90,4e,58,ef,5c,65,4a,31,9c,57,6a,f5,fc,7c,5d,e7) +#define GPT_ROOT_PARISC_VERITY_SIG SD_ID128_MAKE(15,de,61,70,65,d3,43,1c,91,6e,b0,dc,d8,39,3f,25) #define GPT_ROOT_PPC64_LE_VERITY_SIG SD_ID128_MAKE(d4,a2,36,e7,e8,73,4c,07,bf,1d,bf,6c,f7,f1,c3,c6) #define GPT_ROOT_PPC64_VERITY_SIG SD_ID128_MAKE(f5,e2,c2,0c,45,b2,4f,fa,bc,e9,2a,60,73,7e,1a,af) #define GPT_ROOT_PPC_VERITY_SIG SD_ID128_MAKE(1b,31,b5,aa,ad,d9,46,3a,b2,ed,bd,46,7f,c8,57,e7) @@ -111,6 +116,7 @@ #define GPT_USR_LOONGARCH64_VERITY_SIG SD_ID128_MAKE(b0,24,f3,15,d3,30,44,4c,84,61,44,bb,de,52,4e,99) #define GPT_USR_MIPS_LE_VERITY_SIG SD_ID128_MAKE(3e,23,ca,0b,a4,bc,4b,4e,80,87,5a,b6,a2,6a,a8,a9) #define GPT_USR_MIPS64_LE_VERITY_SIG SD_ID128_MAKE(f2,c2,c7,ee,ad,cc,43,51,b5,c6,ee,98,16,b6,6e,16) +#define GPT_USR_PARISC_VERITY_SIG SD_ID128_MAKE(45,0d,d7,d1,32,24,45,ec,9c,f2,a4,3a,34,6d,71,ee) #define GPT_USR_PPC64_LE_VERITY_SIG SD_ID128_MAKE(c8,bf,bd,1e,26,8e,45,21,8b,ba,bf,31,4c,39,95,57) #define GPT_USR_PPC64_VERITY_SIG SD_ID128_MAKE(0b,88,88,63,d7,f8,4d,9e,97,66,23,9f,ce,4d,58,af) #define GPT_USR_PPC_VERITY_SIG SD_ID128_MAKE(70,07,89,1d,d3,71,4a,80,86,a4,5c,b8,75,b9,30,2e) diff --git a/src/shared/seccomp-util.c b/src/shared/seccomp-util.c index 0996ca6625..882547d655 100644 --- a/src/shared/seccomp-util.c +++ b/src/shared/seccomp-util.c @@ -80,6 +80,11 @@ uint32_t seccomp_local_archs[] = { SCMP_ARCH_MIPSEL64, SCMP_ARCH_MIPS64N32, SCMP_ARCH_MIPSEL64N32, /* native */ +#elif defined(__hppa64__) && defined(SCMP_ARCH_PARISC) && defined(SCMP_ARCH_PARISC64) + SCMP_ARCH_PARISC, + SCMP_ARCH_PARISC64, /* native */ +#elif defined(__hppa__) && defined(SCMP_ARCH_PARISC) + SCMP_ARCH_PARISC, #elif defined(__powerpc64__) && __BYTE_ORDER == __BIG_ENDIAN SCMP_ARCH_PPC, SCMP_ARCH_PPC64LE, @@ -132,6 +137,14 @@ const char* seccomp_arch_to_string(uint32_t c) { return "mips64-le"; case SCMP_ARCH_MIPSEL64N32: return "mips64-le-n32"; +#ifdef SCMP_ARCH_PARISC + case SCMP_ARCH_PARISC: + return "parisc"; +#endif +#ifdef SCMP_ARCH_PARISC64 + case SCMP_ARCH_PARISC64: + return "parisc64"; +#endif case SCMP_ARCH_PPC: return "ppc"; case SCMP_ARCH_PPC64: @@ -181,6 +194,14 @@ int seccomp_arch_from_string(const char *n, uint32_t *ret) { *ret = SCMP_ARCH_MIPSEL64; else if (streq(n, "mips64-le-n32")) *ret = SCMP_ARCH_MIPSEL64N32; +#ifdef SCMP_ARCH_PARISC + else if (streq(n, "parisc")) + *ret = SCMP_ARCH_PARISC; +#endif +#ifdef SCMP_ARCH_PARISC64 + else if (streq(n, "parisc64")) + *ret = SCMP_ARCH_PARISC64; +#endif else if (streq(n, "ppc")) *ret = SCMP_ARCH_PPC; else if (streq(n, "ppc64")) @@ -1443,6 +1464,12 @@ int seccomp_restrict_address_families(Set *address_families, bool allow_list) { case SCMP_ARCH_X86: case SCMP_ARCH_MIPSEL: case SCMP_ARCH_MIPS: +#ifdef SCMP_ARCH_PARISC + case SCMP_ARCH_PARISC: +#endif +#ifdef SCMP_ARCH_PARISC64 + case SCMP_ARCH_PARISC64: +#endif case SCMP_ARCH_PPC: case SCMP_ARCH_PPC64: case SCMP_ARCH_PPC64LE: @@ -1693,7 +1720,11 @@ int seccomp_memory_deny_write_execute(void) { /* Note that on some architectures shmat() isn't available, and the call is multiplexed through ipc(). * We ignore that here, which means there's still a way to get writable/executable - * memory, if an IPC key is mapped like this. That's a pity, but no total loss. */ + * memory, if an IPC key is mapped like this. That's a pity, but no total loss. + * + * Also, PARISC isn't here right now because it still needs executable memory, but work is in progress + * on that front (kernel work done in 5.18). + */ case SCMP_ARCH_X86: case SCMP_ARCH_S390: @@ -1727,7 +1758,7 @@ int seccomp_memory_deny_write_execute(void) { /* Please add more definitions here, if you port systemd to other architectures! */ -#if !defined(__i386__) && !defined(__x86_64__) && !defined(__powerpc__) && !defined(__powerpc64__) && !defined(__arm__) && !defined(__aarch64__) && !defined(__s390__) && !defined(__s390x__) && !(defined(__riscv) && __riscv_xlen == 64) +#if !defined(__i386__) && !defined(__x86_64__) && !defined(__hppa__) && !defined(__hppa64__) && !defined(__powerpc__) && !defined(__powerpc64__) && !defined(__arm__) && !defined(__aarch64__) && !defined(__s390__) && !defined(__s390x__) && !(defined(__riscv) && __riscv_xlen == 64) #warning "Consider adding the right mmap() syscall definitions here!" #endif } diff --git a/src/test/test-seccomp.c b/src/test/test-seccomp.c index db7c217521..3aaeb7147e 100644 --- a/src/test/test-seccomp.c +++ b/src/test/test-seccomp.c @@ -132,6 +132,8 @@ TEST(architecture_table) { "mips-le\0" "mips64-le\0" "mips64-le-n32\0" + "parisc\0" + "parisc64\0" "ppc\0" "ppc64\0" "ppc64-le\0" |