virtio-devices: Add seccomp filter list for net worker thread

This patch adds the seccomp filter list for the virtio_net thread, while
the list was already added for the virtio_net_ctl thread.

Partially fixes: #925

Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
Bo Chen
2020-08-14 14:55:53 -07:00
committed by Sebastien Boeuf
parent 3d6d9ca4de
commit c70ad27247
2 changed files with 30 additions and 1 deletions
+7 -1
View File
@@ -490,10 +490,16 @@ impl VirtioDevice for Net {
let paused = self.paused.clone();
let paused_sync = self.paused_sync.clone();
// Retrieve seccomp filter for virtio_net thread
let virtio_net_seccomp_filter =
get_seccomp_filter(&self.seccomp_action, Thread::VirtioNet)
.map_err(ActivateError::CreateSeccompFilter)?;
thread::Builder::new()
.name("virtio_net".to_string())
.spawn(move || {
if let Err(e) = handler.run(paused, paused_sync) {
if let Err(e) = SeccompFilter::apply(virtio_net_seccomp_filter) {
error!("Error applying seccomp filter: {:?}", e);
} else if let Err(e) = handler.run(paused, paused_sync) {
error!("Error running worker: {:?}", e);
}
})