Well this change made the ID 392 "known" to all architectures (in a try
to sync numbers across everywhere) but it fails on those it isn't
implemented (32bit, ppc, s390x + sparc which we don't have).

The path registering these calls goes
seccomp_rule_add
 -> seccomp_rule_add_array
     -> db_col_valid
     -> _syscall_valid
     -> db_col_rule_add   <- still -204/392
         -> _db_rule_new
         -> db_col_transaction_start  <- dups old rule (-201) ITERATES
            -> arch_filter_rule_add
                -> arch_syscall_translate
                    -> arch_syscall_resolve_num  <- returns "semop" for -201
                    -> arch_syscall_resolve_name <- returns -201 for "semop"
            Returns RC=0 (db_col_transaction_start)
            The above defined the transaction start
         -> arch_filter_rule_add  <- this adds the new rule -204/392
             -> arch_syscall_translate
                 -> arch_syscall_resolve_num  
                      Good case returns "semtimedop" for 
                      Bad  case returns 0x0 for 392
                  From here it now returns -EFAULT (=> -14) and things break

So we enter:
Good: Breakpoint 14, s390x_syscall_resolve_num (num=-204) at 
arch-s390x-syscalls.c:533
Bad: Breakpoint 13, s390x_syscall_resolve_num (num=392) at 
arch-s390x-syscalls.c:533

This searches the table s390x_syscall_table and fails to find 392, from there 
things break.
The worst is, that "semtimedop" is there, but with __PNR_semtimedop as number.
As it used to have no number yet when last time generated.
If it would use __NR_semtimedop instead of __PNR_semtimedop it might even work 
as-is.
I'm not sure if src/arch-s390x-syscalls.c is allowed to use include/seccomp.h 
(where these compat defines are).
I need to suggest that upstream (or check if a change exists)

Summary of the above:
- kernel change defined numbers for all calls (implemented or not)
- due to that no more the fallback "#define __PNR_semtimedop -204" but provided 
392 is used
- arch_syscall_translate tries to translate 392 in the context of the native 
architecure to the provided architecture and fails
- src/arch-s390x-syscalls.c contains syscall tables derived from 4.15-rc7 which 
need to be updated
- Definitions in this table should use __NR_ instead of __PNR_ to get the 
kernel value once it is defined (will be ==__PNR when not defined)
- Even if not using __NR it needs a redefine for newer kernels

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to libseccomp in Ubuntu.
https://bugs.launchpad.net/bugs/1849785

Title:
  FTBFS on i386/ppc64/s390x (Eoan+Focal)

Status in libseccomp package in Ubuntu:
  Confirmed
Status in libseccomp source package in Eoan:
  Confirmed

Bug description:
  Due to the python 3.8 transition in focal this was rebuilt but fails atm.
  => 
https://launchpadlibrarian.net/448119198/buildlog_ubuntu-focal-s390x.libseccomp_2.4.1-0ubuntu0.19.10.4_BUILDING.txt.gz

  The simulations fail in this case:
   batch name: 36-sim-ipc_syscalls
   test mode:  c
   test type:  bpf-sim
  Test 36-sim-ipc_syscalls%%001-00001 result:   ERROR 36-sim-ipc_syscalls rc=14
  Test 36-sim-ipc_syscalls%%002-00001 result:   ERROR 36-sim-ipc_syscalls rc=14
  Test 36-sim-ipc_syscalls%%003-00001 result:   ERROR 36-sim-ipc_syscalls rc=14
  Test 36-sim-ipc_syscalls%%004-00001 result:   ERROR 36-sim-ipc_syscalls rc=14
  Test 36-sim-ipc_syscalls%%005-00001 result:   ERROR 36-sim-ipc_syscalls rc=14
  Test 36-sim-ipc_syscalls%%006-00001 result:   ERROR 36-sim-ipc_syscalls rc=14
  Test 36-sim-ipc_syscalls%%007-00001 result:   ERROR 36-sim-ipc_syscalls rc=14
  Test 36-sim-ipc_syscalls%%008-00001 result:   ERROR 36-sim-ipc_syscalls rc=14
  Test 36-sim-ipc_syscalls%%009-00001 result:   ERROR 36-sim-ipc_syscalls rc=14
  Test 36-sim-ipc_syscalls%%010-00001 result:   ERROR 36-sim-ipc_syscalls rc=14
  Test 36-sim-ipc_syscalls%%011-00001 result:   ERROR 36-sim-ipc_syscalls rc=14
  Test 36-sim-ipc_syscalls%%012-00001 result:   ERROR 36-sim-ipc_syscalls rc=14
  Test 36-sim-ipc_syscalls%%013-00001 result:   ERROR 36-sim-ipc_syscalls rc=14
  Test 36-sim-ipc_syscalls%%014-00001 result:   ERROR 36-sim-ipc_syscalls rc=14
  Test 36-sim-ipc_syscalls%%015-00001 result:   ERROR 36-sim-ipc_syscalls rc=14
  Test 36-sim-ipc_syscalls%%016-00001 result:   ERROR 36-sim-ipc_syscalls rc=14
  Test 36-sim-ipc_syscalls%%017-00001 result:   ERROR 36-sim-ipc_syscalls rc=14
  Test 36-sim-ipc_syscalls%%018-00001 result:   ERROR 36-sim-ipc_syscalls rc=14
  Test 36-sim-ipc_syscalls%%019-00001 result:   ERROR 36-sim-ipc_syscalls rc=14
  Test 36-sim-ipc_syscalls%%020-00001 result:   ERROR 36-sim-ipc_syscalls rc=14
  Test 36-sim-ipc_syscalls%%021-00001 result:   ERROR 36-sim-ipc_syscalls rc=14
  Test 36-sim-ipc_syscalls%%022-00001 result:   ERROR 36-sim-ipc_syscalls rc=14
  Test 36-sim-ipc_syscalls%%023-00001 result:   ERROR 36-sim-ipc_syscalls rc=14
  Test 36-sim-ipc_syscalls%%024-00001 result:   ERROR 36-sim-ipc_syscalls rc=14
   test mode:  c
   test type:  bpf-valgrind
  Test 36-sim-ipc_syscalls%%025-00001 result:   FAILURE 36-sim-ipc_syscalls 
rc=14
   batch name: 37-sim-ipc_syscalls_be
   test mode:  c
   test type:  bpf-sim
   test arch:  s390

  
   batch name: 37-sim-ipc_syscalls_be
   test mode:  c
   test type:  bpf-sim
   test arch:  s390
  Test 37-sim-ipc_syscalls_be%%001-00001 result:   ERROR 37-sim-ipc_syscalls_be 
rc=14
   test arch:  s390
  Test 37-sim-ipc_syscalls_be%%002-00001 result:   ERROR 37-sim-ipc_syscalls_be 
rc=14
   test arch:  s390
  Test 37-sim-ipc_syscalls_be%%003-00001 result:   ERROR 37-sim-ipc_syscalls_be 
rc=14
   test arch:  s390
  Test 37-sim-ipc_syscalls_be%%004-00001 result:   ERROR 37-sim-ipc_syscalls_be 
rc=14
   test arch:  s390
  Test 37-sim-ipc_syscalls_be%%005-00001 result:   ERROR 37-sim-ipc_syscalls_be 
rc=14
   test arch:  s390
  Test 37-sim-ipc_syscalls_be%%006-00001 result:   ERROR 37-sim-ipc_syscalls_be 
rc=14
   test arch:  s390
  Test 37-sim-ipc_syscalls_be%%007-00001 result:   ERROR 37-sim-ipc_syscalls_be 
rc=14
   test arch:  s390
  Test 37-sim-ipc_syscalls_be%%008-00001 result:   ERROR 37-sim-ipc_syscalls_be 
rc=14
   test arch:  s390
  Test 37-sim-ipc_syscalls_be%%009-00001 result:   ERROR 37-sim-ipc_syscalls_be 
rc=14
   test arch:  s390
  Test 37-sim-ipc_syscalls_be%%010-00001 result:   ERROR 37-sim-ipc_syscalls_be 
rc=14
   test arch:  s390
  Test 37-sim-ipc_syscalls_be%%011-00001 result:   ERROR 37-sim-ipc_syscalls_be 
rc=14
   test arch:  s390
  Test 37-sim-ipc_syscalls_be%%012-00001 result:   ERROR 37-sim-ipc_syscalls_be 
rc=14
   test mode:  c
   test type:  bpf-valgrind
  Test 37-sim-ipc_syscalls_be%%013-00001 result:   FAILURE 
37-sim-ipc_syscalls_be rc=14

  
  It is always the s390x test - even when running on i386/ppc64
  On x86_64 this test succeeds:

  Test 36-sim-ipc_syscalls%%025-00001 result:   SUCCESS
   batch name: 37-sim-ipc_syscalls_be
   test mode:  c
   test type:  bpf-sim
   test arch:  s390

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libseccomp/+bug/1849785/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to