aboutgitcodebugslistschat
path: root/log.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2024-08-02 15:22:30 +0200
committerStefano Brivio <sbrivio@redhat.com>2024-08-05 15:02:36 +0200
commitf30ed68c52734b549304f808b780972f93b0515d (patch)
tree41e478dd2a582ae11d1fab55595e3b4cc98efecd /log.c
parent0149d11cc5043d618cf4a6e6e8201d5718836dd2 (diff)
downloadpasst-f30ed68c52734b549304f808b780972f93b0515d.tar
passt-f30ed68c52734b549304f808b780972f93b0515d.tar.gz
passt-f30ed68c52734b549304f808b780972f93b0515d.tar.bz2
passt-f30ed68c52734b549304f808b780972f93b0515d.tar.lz
passt-f30ed68c52734b549304f808b780972f93b0515d.tar.xz
passt-f30ed68c52734b549304f808b780972f93b0515d.tar.zst
passt-f30ed68c52734b549304f808b780972f93b0515d.zip
pasta: Save errno on signal handler entry, restore on return when needed
Ed reported this: # Error: pasta failed with exit code 1: # Couldn't drop cap 3 from bounding set # : No child processes in a Podman CI run with tests being run in parallel. The error message itself, by the way, is fixed by commit 1cd773081f12 ("log: Drop newlines in the middle of the perror()-like messages"), but how can we possibly get ECHILD as failure code for prctl()? Well, we don't, but if we exit early enough, pasta_child_handler() might run before we're even done with isolation steps, and it calls waitid(), which sets errno. We need to restore it before returning from the signal handler (if we return after calling functions that might set it), as signal-safety(7) also implies: Fetching and setting the value of errno is async-signal-safe provided that the signal handler saves errno on entry and restores its value before returning. Eventually, we'll probably need to switch to signalfd(2) the day we want to implement multithreading, but this will do for the moment. Reported-by: Ed Santiago <santiago@redhat.com> Link: https://github.com/containers/podman/issues/23478 Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Reviewed-by: Paul Holzinger <pholzing@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'log.c')
0 files changed, 0 insertions, 0 deletions