From 04a7790f23958cc7ea47f3ae712ec221fb55ad5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 25 Jan 2024 13:23:25 +0100 Subject: [PATCH 1/3] meson: use a single line for one-item file lists That file was mixing two styles, which looks ugly. Let's not make the file unnecessarily long. --- src/shared/meson.build | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/shared/meson.build b/src/shared/meson.build index 69a60b0f45..533c08d20a 100644 --- a/src/shared/meson.build +++ b/src/shared/meson.build @@ -199,9 +199,7 @@ shared_sources = files( ) if get_option('tests') != 'false' - shared_sources += files( - 'tests.c', - ) + shared_sources += files('tests.c') endif generate_syscall_list = find_program('generate-syscall-list.py') @@ -215,9 +213,7 @@ syscall_list_h = custom_target( capture : true) if conf.get('HAVE_ACL') == 1 - shared_sources += files( - 'devnode-acl.c', - ) + shared_sources += files('devnode-acl.c') endif if conf.get('ENABLE_UTMP') == 1 @@ -234,9 +230,7 @@ if conf.get('HAVE_LIBIPTC') == 1 endif if conf.get('HAVE_LIBBPF') == 1 - shared_sources += files( - 'bpf-link.c', - ) + shared_sources += files('bpf-link.c') endif if conf.get('HAVE_KMOD') == 1 @@ -244,9 +238,7 @@ if conf.get('HAVE_KMOD') == 1 endif if conf.get('HAVE_PAM') == 1 - shared_sources += files( - 'pam-util.c', - ) + shared_sources += files('pam-util.c') endif if conf.get('ENABLE_NSCD') == 1 @@ -366,9 +358,7 @@ libshared = shared_library( install : true, install_dir : pkglibdir) -shared_fdisk_sources = files( - 'fdisk-util.c', -) +shared_fdisk_sources = files('fdisk-util.c') libshared_fdisk = static_library( 'shared-fdisk', From 58fcc6b013bbc8c6290348f701ddb862928cc1a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 25 Jan 2024 13:26:21 +0100 Subject: [PATCH 2/3] meson: drop arch filtering in syscall list I added the filtering in 752fedbea7c02c82287c7ff2a4139f528b3f7ba8 as a way to reduce the number of items in the tables. I thought it's "obvious", but it might not be so. One immediate problem is that the filter is broken, because on arm64, os.uname().machine returns "aarch64", so we incorrectly filter out the arm syscalls (there is just one: arm_fadvise64_64). Of course we could fix the filter, but I think it's better to nuke it altogether. The filter on applies to 1 arm syscall and 5 s390 syscalls, and we have 500+ other syscalls, so this "optimization" doesn't really matter. OTOH, if we get the filter wrong, the result is bad. And also, the existence of the filter at all creates problems for cross-builds. I wanted to get rid of 'generate-syscall-list.py', but we need to generate a backslash in the output. https://github.com/mesonbuild/meson/issues/1564 makes this very very hard, since any attempt to put a backslash an inline argument results in the backslash being replaces by a forward slash, which doesn't quite have the same meaning. So let's use a standalone script until https://github.com/mesonbuild/meson/issues/1564 is resolved. --- src/shared/generate-syscall-list.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/shared/generate-syscall-list.py b/src/shared/generate-syscall-list.py index 3ee19ff709..c0975a06da 100755 --- a/src/shared/generate-syscall-list.py +++ b/src/shared/generate-syscall-list.py @@ -2,15 +2,6 @@ # SPDX-License-Identifier: LGPL-2.1-or-later import sys -import os - -s390 = 's390' in os.uname().machine -arm = 'arm' in os.uname().machine for line in open(sys.argv[1]): - if line.startswith('s390_') and not s390: - continue - if line.startswith('arm_') and not arm: - continue - print('"{}\\0"'.format(line.strip())) From bca1b70af9c6683e57284f11465c7f844997f525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 25 Jan 2024 13:45:14 +0100 Subject: [PATCH 3/3] Update syscalls lists For discussion of listmount() and statmount(), see https://lwn.net/Articles/950569/. --- src/basic/syscall-list.txt | 5 +++++ src/basic/syscalls-alpha.txt | 5 +++++ src/basic/syscalls-arc.txt | 5 +++++ src/basic/syscalls-arm.txt | 5 +++++ src/basic/syscalls-arm64.txt | 5 +++++ src/basic/syscalls-i386.txt | 5 +++++ src/basic/syscalls-loongarch64.txt | 5 +++++ src/basic/syscalls-m68k.txt | 5 +++++ src/basic/syscalls-mips64.txt | 5 +++++ src/basic/syscalls-mips64n32.txt | 5 +++++ src/basic/syscalls-mipso32.txt | 5 +++++ src/basic/syscalls-parisc.txt | 5 +++++ src/basic/syscalls-powerpc.txt | 5 +++++ src/basic/syscalls-powerpc64.txt | 5 +++++ src/basic/syscalls-riscv32.txt | 5 +++++ src/basic/syscalls-riscv64.txt | 5 +++++ src/basic/syscalls-s390.txt | 5 +++++ src/basic/syscalls-s390x.txt | 5 +++++ src/basic/syscalls-sparc.txt | 5 +++++ src/basic/syscalls-x86_64.txt | 5 +++++ 20 files changed, 100 insertions(+) diff --git a/src/basic/syscall-list.txt b/src/basic/syscall-list.txt index 1c335bb081..440f4bcfb1 100644 --- a/src/basic/syscall-list.txt +++ b/src/basic/syscall-list.txt @@ -188,12 +188,16 @@ lgetxattr link linkat listen +listmount listxattr llistxattr lookup_dcookie lremovexattr lseek lsetxattr +lsm_get_self_attr +lsm_list_modules +lsm_set_self_attr lstat lstat64 madvise @@ -449,6 +453,7 @@ stat stat64 statfs statfs64 +statmount statx stime subpage_prot diff --git a/src/basic/syscalls-alpha.txt b/src/basic/syscalls-alpha.txt index d3ed3a4a62..ce20e4d617 100644 --- a/src/basic/syscalls-alpha.txt +++ b/src/basic/syscalls-alpha.txt @@ -188,12 +188,16 @@ lgetxattr 386 link 9 linkat 458 listen 106 +listmount 568 listxattr 388 llistxattr 389 lookup_dcookie 406 lremovexattr 392 lseek 19 lsetxattr 383 +lsm_get_self_attr 569 +lsm_list_modules 571 +lsm_set_self_attr 570 lstat 68 lstat64 426 madvise 75 @@ -449,6 +453,7 @@ stat 67 stat64 425 statfs 328 statfs64 528 +statmount 567 statx 522 stime subpage_prot diff --git a/src/basic/syscalls-arc.txt b/src/basic/syscalls-arc.txt index 951ef56158..6c39eb4352 100644 --- a/src/basic/syscalls-arc.txt +++ b/src/basic/syscalls-arc.txt @@ -188,12 +188,16 @@ lgetxattr 9 link linkat 37 listen 201 +listmount 458 listxattr 11 llistxattr 12 lookup_dcookie 18 lremovexattr 15 lseek lsetxattr 6 +lsm_get_self_attr 459 +lsm_list_modules 461 +lsm_set_self_attr 460 lstat lstat64 madvise 233 @@ -449,6 +453,7 @@ stat stat64 statfs statfs64 43 +statmount 457 statx 291 stime subpage_prot diff --git a/src/basic/syscalls-arm.txt b/src/basic/syscalls-arm.txt index 1c0e66f8a6..9937785a8d 100644 --- a/src/basic/syscalls-arm.txt +++ b/src/basic/syscalls-arm.txt @@ -188,12 +188,16 @@ lgetxattr 230 link 9 linkat 330 listen 284 +listmount 458 listxattr 232 llistxattr 233 lookup_dcookie 249 lremovexattr 236 lseek 19 lsetxattr 227 +lsm_get_self_attr 459 +lsm_list_modules 461 +lsm_set_self_attr 460 lstat 107 lstat64 196 madvise 220 @@ -449,6 +453,7 @@ stat 106 stat64 195 statfs 99 statfs64 266 +statmount 457 statx 397 stime subpage_prot diff --git a/src/basic/syscalls-arm64.txt b/src/basic/syscalls-arm64.txt index b8602a17ac..1fd91af88f 100644 --- a/src/basic/syscalls-arm64.txt +++ b/src/basic/syscalls-arm64.txt @@ -188,12 +188,16 @@ lgetxattr 9 link linkat 37 listen 201 +listmount 458 listxattr 11 llistxattr 12 lookup_dcookie 18 lremovexattr 15 lseek 62 lsetxattr 6 +lsm_get_self_attr 459 +lsm_list_modules 461 +lsm_set_self_attr 460 lstat lstat64 madvise 233 @@ -449,6 +453,7 @@ stat stat64 statfs 43 statfs64 +statmount 457 statx 291 stime subpage_prot diff --git a/src/basic/syscalls-i386.txt b/src/basic/syscalls-i386.txt index 6d0c57f7f9..1a5dd0a707 100644 --- a/src/basic/syscalls-i386.txt +++ b/src/basic/syscalls-i386.txt @@ -188,12 +188,16 @@ lgetxattr 230 link 9 linkat 303 listen 363 +listmount 458 listxattr 232 llistxattr 233 lookup_dcookie 253 lremovexattr 236 lseek 19 lsetxattr 227 +lsm_get_self_attr 459 +lsm_list_modules 461 +lsm_set_self_attr 460 lstat 107 lstat64 196 madvise 219 @@ -449,6 +453,7 @@ stat 106 stat64 195 statfs 99 statfs64 268 +statmount 457 statx 383 stime 25 subpage_prot diff --git a/src/basic/syscalls-loongarch64.txt b/src/basic/syscalls-loongarch64.txt index 34a45cb52b..185c217b7e 100644 --- a/src/basic/syscalls-loongarch64.txt +++ b/src/basic/syscalls-loongarch64.txt @@ -188,12 +188,16 @@ lgetxattr 9 link linkat 37 listen 201 +listmount 458 listxattr 11 llistxattr 12 lookup_dcookie 18 lremovexattr 15 lseek 62 lsetxattr 6 +lsm_get_self_attr 459 +lsm_list_modules 461 +lsm_set_self_attr 460 lstat lstat64 madvise 233 @@ -449,6 +453,7 @@ stat stat64 statfs 43 statfs64 +statmount 457 statx 291 stime subpage_prot diff --git a/src/basic/syscalls-m68k.txt b/src/basic/syscalls-m68k.txt index 712f272b1a..ccd7cf8235 100644 --- a/src/basic/syscalls-m68k.txt +++ b/src/basic/syscalls-m68k.txt @@ -188,12 +188,16 @@ lgetxattr 227 link 9 linkat 296 listen 360 +listmount 458 listxattr 229 llistxattr 230 lookup_dcookie 248 lremovexattr 233 lseek 19 lsetxattr 224 +lsm_get_self_attr 459 +lsm_list_modules 461 +lsm_set_self_attr 460 lstat 107 lstat64 196 madvise 238 @@ -449,6 +453,7 @@ stat 106 stat64 195 statfs 99 statfs64 263 +statmount 457 statx 379 stime 25 subpage_prot diff --git a/src/basic/syscalls-mips64.txt b/src/basic/syscalls-mips64.txt index 2d0984edbd..6c7adc5975 100644 --- a/src/basic/syscalls-mips64.txt +++ b/src/basic/syscalls-mips64.txt @@ -188,12 +188,16 @@ lgetxattr 5184 link 5084 linkat 5255 listen 5049 +listmount 5458 listxattr 5186 llistxattr 5187 lookup_dcookie 5206 lremovexattr 5190 lseek 5008 lsetxattr 5181 +lsm_get_self_attr 5459 +lsm_list_modules 5461 +lsm_set_self_attr 5460 lstat 5006 lstat64 madvise 5027 @@ -449,6 +453,7 @@ stat 5004 stat64 statfs 5134 statfs64 +statmount 5457 statx 5326 stime subpage_prot diff --git a/src/basic/syscalls-mips64n32.txt b/src/basic/syscalls-mips64n32.txt index 44758675e1..c6d49a365d 100644 --- a/src/basic/syscalls-mips64n32.txt +++ b/src/basic/syscalls-mips64n32.txt @@ -188,12 +188,16 @@ lgetxattr 6184 link 6084 linkat 6259 listen 6049 +listmount 6458 listxattr 6186 llistxattr 6187 lookup_dcookie 6206 lremovexattr 6190 lseek 6008 lsetxattr 6181 +lsm_get_self_attr 6459 +lsm_list_modules 6461 +lsm_set_self_attr 6460 lstat 6006 lstat64 madvise 6027 @@ -449,6 +453,7 @@ stat 6004 stat64 statfs 6134 statfs64 6217 +statmount 6457 statx 6330 stime subpage_prot diff --git a/src/basic/syscalls-mipso32.txt b/src/basic/syscalls-mipso32.txt index 0254cb3476..2298dcafcc 100644 --- a/src/basic/syscalls-mipso32.txt +++ b/src/basic/syscalls-mipso32.txt @@ -188,12 +188,16 @@ lgetxattr 4228 link 4009 linkat 4296 listen 4174 +listmount 4458 listxattr 4230 llistxattr 4231 lookup_dcookie 4247 lremovexattr 4234 lseek 4019 lsetxattr 4225 +lsm_get_self_attr 4459 +lsm_list_modules 4461 +lsm_set_self_attr 4460 lstat 4107 lstat64 4214 madvise 4218 @@ -449,6 +453,7 @@ stat 4106 stat64 4213 statfs 4099 statfs64 4255 +statmount 4457 statx 4366 stime 4025 subpage_prot diff --git a/src/basic/syscalls-parisc.txt b/src/basic/syscalls-parisc.txt index 2bb1de5645..3be890c004 100644 --- a/src/basic/syscalls-parisc.txt +++ b/src/basic/syscalls-parisc.txt @@ -188,12 +188,16 @@ lgetxattr 242 link 9 linkat 283 listen 32 +listmount 458 listxattr 244 llistxattr 245 lookup_dcookie 223 lremovexattr 248 lseek 19 lsetxattr 239 +lsm_get_self_attr 459 +lsm_list_modules 461 +lsm_set_self_attr 460 lstat 84 lstat64 198 madvise 119 @@ -449,6 +453,7 @@ stat 18 stat64 101 statfs 99 statfs64 298 +statmount 457 statx 349 stime 25 subpage_prot diff --git a/src/basic/syscalls-powerpc.txt b/src/basic/syscalls-powerpc.txt index a8c1b1b547..a1c28fa3af 100644 --- a/src/basic/syscalls-powerpc.txt +++ b/src/basic/syscalls-powerpc.txt @@ -188,12 +188,16 @@ lgetxattr 213 link 9 linkat 294 listen 329 +listmount 458 listxattr 215 llistxattr 216 lookup_dcookie 235 lremovexattr 219 lseek 19 lsetxattr 210 +lsm_get_self_attr 459 +lsm_list_modules 461 +lsm_set_self_attr 460 lstat 107 lstat64 196 madvise 205 @@ -449,6 +453,7 @@ stat 106 stat64 195 statfs 99 statfs64 252 +statmount 457 statx 383 stime 25 subpage_prot 310 diff --git a/src/basic/syscalls-powerpc64.txt b/src/basic/syscalls-powerpc64.txt index 824cc614be..394a64bd11 100644 --- a/src/basic/syscalls-powerpc64.txt +++ b/src/basic/syscalls-powerpc64.txt @@ -188,12 +188,16 @@ lgetxattr 213 link 9 linkat 294 listen 329 +listmount 458 listxattr 215 llistxattr 216 lookup_dcookie 235 lremovexattr 219 lseek 19 lsetxattr 210 +lsm_get_self_attr 459 +lsm_list_modules 461 +lsm_set_self_attr 460 lstat 107 lstat64 madvise 205 @@ -449,6 +453,7 @@ stat 106 stat64 statfs 99 statfs64 252 +statmount 457 statx 383 stime 25 subpage_prot 310 diff --git a/src/basic/syscalls-riscv32.txt b/src/basic/syscalls-riscv32.txt index 5011956e72..bc87ee9ff5 100644 --- a/src/basic/syscalls-riscv32.txt +++ b/src/basic/syscalls-riscv32.txt @@ -188,12 +188,16 @@ lgetxattr 9 link linkat 37 listen 201 +listmount 458 listxattr 11 llistxattr 12 lookup_dcookie 18 lremovexattr 15 lseek lsetxattr 6 +lsm_get_self_attr 459 +lsm_list_modules 461 +lsm_set_self_attr 460 lstat lstat64 madvise 233 @@ -449,6 +453,7 @@ stat stat64 statfs statfs64 43 +statmount 457 statx 291 stime subpage_prot diff --git a/src/basic/syscalls-riscv64.txt b/src/basic/syscalls-riscv64.txt index ba00b90207..c0364d76f6 100644 --- a/src/basic/syscalls-riscv64.txt +++ b/src/basic/syscalls-riscv64.txt @@ -188,12 +188,16 @@ lgetxattr 9 link linkat 37 listen 201 +listmount 458 listxattr 11 llistxattr 12 lookup_dcookie 18 lremovexattr 15 lseek 62 lsetxattr 6 +lsm_get_self_attr 459 +lsm_list_modules 461 +lsm_set_self_attr 460 lstat lstat64 madvise 233 @@ -449,6 +453,7 @@ stat stat64 statfs 43 statfs64 +statmount 457 statx 291 stime subpage_prot diff --git a/src/basic/syscalls-s390.txt b/src/basic/syscalls-s390.txt index c81f795e40..ed43768a97 100644 --- a/src/basic/syscalls-s390.txt +++ b/src/basic/syscalls-s390.txt @@ -188,12 +188,16 @@ lgetxattr 228 link 9 linkat 296 listen 363 +listmount 458 listxattr 230 llistxattr 231 lookup_dcookie 110 lremovexattr 234 lseek 19 lsetxattr 225 +lsm_get_self_attr 459 +lsm_list_modules 461 +lsm_set_self_attr 460 lstat 107 lstat64 196 madvise 219 @@ -449,6 +453,7 @@ stat 106 stat64 195 statfs 99 statfs64 265 +statmount 457 statx 379 stime 25 subpage_prot diff --git a/src/basic/syscalls-s390x.txt b/src/basic/syscalls-s390x.txt index c999fd6796..3fa39163ee 100644 --- a/src/basic/syscalls-s390x.txt +++ b/src/basic/syscalls-s390x.txt @@ -188,12 +188,16 @@ lgetxattr 228 link 9 linkat 296 listen 363 +listmount 458 listxattr 230 llistxattr 231 lookup_dcookie 110 lremovexattr 234 lseek 19 lsetxattr 225 +lsm_get_self_attr 459 +lsm_list_modules 461 +lsm_set_self_attr 460 lstat 107 lstat64 madvise 219 @@ -449,6 +453,7 @@ stat 106 stat64 statfs 99 statfs64 265 +statmount 457 statx 379 stime subpage_prot diff --git a/src/basic/syscalls-sparc.txt b/src/basic/syscalls-sparc.txt index e631d30fa6..3a4756c520 100644 --- a/src/basic/syscalls-sparc.txt +++ b/src/basic/syscalls-sparc.txt @@ -188,12 +188,16 @@ lgetxattr 173 link 9 linkat 292 listen 354 +listmount 458 listxattr 178 llistxattr 179 lookup_dcookie 208 lremovexattr 182 lseek 19 lsetxattr 170 +lsm_get_self_attr 459 +lsm_list_modules 461 +lsm_set_self_attr 460 lstat 40 lstat64 132 madvise 75 @@ -449,6 +453,7 @@ stat 38 stat64 139 statfs 157 statfs64 234 +statmount 457 statx 360 stime 233 subpage_prot diff --git a/src/basic/syscalls-x86_64.txt b/src/basic/syscalls-x86_64.txt index 52d61768f7..7427ee231e 100644 --- a/src/basic/syscalls-x86_64.txt +++ b/src/basic/syscalls-x86_64.txt @@ -188,12 +188,16 @@ lgetxattr 192 link 86 linkat 265 listen 50 +listmount 458 listxattr 194 llistxattr 195 lookup_dcookie 212 lremovexattr 198 lseek 8 lsetxattr 189 +lsm_get_self_attr 459 +lsm_list_modules 461 +lsm_set_self_attr 460 lstat 6 lstat64 madvise 28 @@ -449,6 +453,7 @@ stat 4 stat64 statfs 137 statfs64 +statmount 457 statx 332 stime subpage_prot