vmm: Fix panic in SIGWINCH listener thread when no seccomp filter set

When running with `--serial pty --console pty --seccomp=false` the
SIGWICH listener thread would panic as the seccomp filter was empty.
Adopt the mechanism used in the rest of the code and check for non-empty
filter before trying to apply it.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2021-11-16 13:56:45 +00:00
parent 5813ce0307
commit 66a2045148

View File

@ -67,7 +67,9 @@ fn sigwinch_listener_main(seccomp_filter: BpfProgram, tx: File, tty: &File) -> !
unblock_all_signals().unwrap();
apply_filter(&seccomp_filter).unwrap();
if !seccomp_filter.is_empty() {
apply_filter(&seccomp_filter).unwrap();
}
register_signal_handler(SIGWINCH, sigwinch_handler).unwrap();