View Issue Details

IDProjectCategoryView StatusLast Update
0000406fileGeneralpublic2022-12-02 17:38
Reporterrwmjones Assigned Tochristos  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionwon't fix 
Product Version5.42 
Summary0000406: seccomp support causes the -z option to fail on zstd-compressed files
Description"file" is been compiled with seccomp support. When we ask to inspect a zstd-compressed file with the -z option, it crashes:

$ ./file-5.42/src/.libs/file -z /var/tmp/lib-i586.so.zst
/var/tmp/lib-i586.so.zst: Bad system call
Steps To ReproducePlease see attached zstd file. Just run the above command on it.
TagsNo tags attached.

Activities

rwmjones

2022-11-27 18:00

reporter  

lib-i586.so.zst (1,712 bytes)

rwmjones

2022-11-27 18:00

reporter   ~0003863

This issue was originally reported by Toolybird here:
https://github.com/libguestfs/libguestfs/issues/100#issuecomment-1328182986

rwmjones

2022-11-27 18:03

reporter   ~0003864

Bad system call is possibly pipe2 ...?

pipe2(0x7fff7c648048, O_CLOEXEC) = 293
+++ killed by SIGSYS +++
Bad system call (core dumped)

rwmjones

2022-11-28 10:19

reporter   ~0003865

I've read about the -S option which the manual suggests combining with -z.

Nevertheless it is possible to get it to work by enabling the following syscalls (quite a broad set):

clone3
execve
pipe2
prlimit64
wait4

I wonder if they could only be enabled when we know we're going to need to run a subcommand.

christos

2022-12-02 17:38

manager   ~0003868

If you enable clone and execve might as well turn off the sandbox. 5.43 gives you a better error message than bad system call. Fix the distribution provider to include the proper libraries instead.

Issue History

Date Modified Username Field Change
2022-11-27 18:00 rwmjones New Issue
2022-11-27 18:00 rwmjones File Added: lib-i586.so.zst
2022-11-27 18:00 rwmjones Note Added: 0003863
2022-11-27 18:03 rwmjones Note Added: 0003864
2022-11-28 10:19 rwmjones Note Added: 0003865
2022-12-02 17:37 christos Assigned To => christos
2022-12-02 17:37 christos Status new => assigned
2022-12-02 17:38 christos Status assigned => resolved
2022-12-02 17:38 christos Resolution open => won't fix
2022-12-02 17:38 christos Note Added: 0003868