From 0b3dad4606c0984ce2d81ba5dd698fa248ce91b8 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 3 May 2024 10:16:58 +0200 Subject: pkg/vminfo: move feature checking to host Feature checking procedure is split into 2 phases: 1. syz-fuzzer invokes "syz-executor setup feature" for each feature one-by-one, and checks if executor does not fail. Executor can also return a special "this feature does not need custom setup", this allows to not call setup of these features in each new VM. 2. pkg/vminfo runs a simple program with ipc.ExecOpts specific for a concrete feature, e.g. for wifi injection it will try to run a program with wifi feature enabled, if setup of the feature fails, executor should also exit with an error. For coverage features we also additionally check that we actually got coverage. Then pkg/vminfo combines results of these 2 checks into final result. syz-execprog now also uses vminfo package and mimics the same checking procedure. Update #1541 --- executor/common_bsd.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'executor/common_bsd.h') diff --git a/executor/common_bsd.h b/executor/common_bsd.h index 4ed45d0bd..e0beac33f 100644 --- a/executor/common_bsd.h +++ b/executor/common_bsd.h @@ -24,6 +24,7 @@ static void setup_usb(void) if (dir == NULL) fail("failed to open /dev"); + bool have_vhci = false; struct dirent* ent = NULL; while ((ent = readdir(dir)) != NULL) { if (ent->d_type != DT_CHR) @@ -34,7 +35,10 @@ static void setup_usb(void) snprintf(path, sizeof(path), "/dev/%s", ent->d_name); if (chmod(path, 0666)) failmsg("failed to chmod vhci", "path=%s", path); + have_vhci = true; } + if (!have_vhci) + fail("don't have any /dev/vhci devices"); closedir(dir); } -- cgit mrf-deployment