You are not logged in.

#1 2023-11-30 08:25:33

solskog
Member
Registered: 2020-09-05
Posts: 462

[Solved] file Bad system call

Linux 6.6.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Mon, 20 Nov 2023 23:18:21 +0000 x86_64 GNU/Linux
file a.txt
a.txt: ASCII text
Bad system call
file -v
file-5.45
magic file from /usr/share/file/misc/magic
seccomp support included
=========================
Linux 6.5.5-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 23 Sep 2023 22:55:13 +0000 x86_64 GNU/Linux
file a.txt
a.txt: ASCII text
file-5.45
magic file from /usr/share/file/misc/magic
seccomp support included

This maybe a reincarnation of this old issue.
https://bbs.archlinux.org/viewtopic.php?id=256286

Last edited by solskog (2023-12-01 10:01:27)

Offline

#2 2023-11-30 09:49:01

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: [Solved] file Bad system call

I cannot reproduce the error. More details?

Offline

#3 2023-11-30 12:05:28

solskog
Member
Registered: 2020-09-05
Posts: 462

Re: [Solved] file Bad system call

Awebb wrote:

I cannot reproduce the error. More details?

Compile upstream source failed with
Linux 6.6.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Mon, 20 Nov 2023 23:18:21 +0000 x86_64 GNU/Linux
Linux 6.6.3-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 29 Nov 2023 00:37:40 +0000 x86_64 GNU/Linux

https://gitlab.archlinux.org/archlinux/ … kages/file

Making all in magic
make[2]: Entering directory '/home/one/git/file/pkg/file-main/src/file-5.45/magic'
../src/file -C -m magic
make[2]: *** [Makefile:867: magic.mgc] Bad system call
make[2]: *** Deleting file 'magic.mgc'
make[2]: Leaving directory '/home/one/git/file/pkg/file-main/src/file-5.45/magic'
make[1]: *** [Makefile:464: all-recursive] Error 1
make[1]: Leaving directory '/home/one/git/file/pkg/file-main/src/file-5.45'
make: *** [Makefile:373: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

On the other hand Compile upstream source succeed with
Linux 6.6.1-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 08 Nov 2023 16:05:38 +0000 x86_64 GNU/Linux
The issue seems to be 'libseccomp' 'libseccomp.so', But both kernel comes with libseccomp 2.5.4-2 and file 5.45-1.

Last edited by solskog (2023-11-30 13:09:18)

Offline

#4 2023-11-30 14:03:59

loqs
Member
Registered: 2014-03-06
Posts: 18,928

Re: [Solved] file Bad system call

Did you try `file --no-sandbox` to disable libseccomp to see if the issue is caused by libseccomp?  If so have you tried stracing the issue to see if you can determine which syscall is triggering the issue?
Edit:
If strace does not work try replacing the two occurrences of SCMP_ACT_KILL with SCMP_ACT_LOG in src/seccomp.c of file.

Last edited by loqs (2023-11-30 14:43:04)

Offline

#5 2023-12-01 10:00:53

solskog
Member
Registered: 2020-09-05
Posts: 462

Re: [Solved] file Bad system call

loqs wrote:

Did you try `file --no-sandbox` to disable libseccomp to see if the issue is caused by libseccomp

Yes, it works now and thanks!

Offline

#6 2023-12-01 11:13:32

loqs
Member
Registered: 2014-03-06
Posts: 18,928

Re: [Solved] file Bad system call

solskog wrote:
loqs wrote:

Did you try `file --no-sandbox` to disable libseccomp to see if the issue is caused by libseccomp

Yes, it works now and thanks!

I would consider that a workaround as the sandbox is not intended to prevent normal operation.

Offline

Board footer

Powered by FluxBB