]> git.proxmox.com Git - mirror_qemu.git/commit
seccomp: Get actual errno value from failed seccomp functions
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 26 Oct 2022 07:30:24 +0000 (09:30 +0200)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 26 Oct 2022 12:32:58 +0000 (13:32 +0100)
commit73422d9524376526ab5950b3be3098901cd605d6
tree9624968f625979d7ea9d0243ca6b6597baf97512
parent23f77f05f2faa8ff3028fef388322f7b4f09533e
seccomp: Get actual errno value from failed seccomp functions

Upon failure, a libseccomp API returns actual errno value very
rarely. Fortunately, after its commit 34bf78ab (contained in
2.5.0 release), the SCMP_FLTATR_API_SYSRAWRC attribute can be set
which makes subsequent APIs return true errno on failure.

This is especially critical when seccomp_load() fails, because
generic -ECANCELED says nothing.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
meson.build
softmmu/qemu-seccomp.c