diff options
Diffstat (limited to 'pkg/host')
| -rw-r--r-- | pkg/host/features.go | 2 | ||||
| -rw-r--r-- | pkg/host/features_linux.go | 8 | ||||
| -rw-r--r-- | pkg/host/syscalls_linux.go | 3 |
3 files changed, 13 insertions, 0 deletions
diff --git a/pkg/host/features.go b/pkg/host/features.go index 800e3ea19..07f6487a8 100644 --- a/pkg/host/features.go +++ b/pkg/host/features.go @@ -27,6 +27,7 @@ const ( FeatureKCSAN FeatureDevlinkPCI FeatureUSBEmulation + FeatureVhciInjection numFeatures ) @@ -65,6 +66,7 @@ func Check(target *prog.Target) (*Features, error) { FeatureKCSAN: {Name: "concurrency sanitizer", Reason: unsupported}, FeatureDevlinkPCI: {Name: "devlink PCI setup", Reason: unsupported}, FeatureUSBEmulation: {Name: "USB emulation", Reason: unsupported}, + FeatureVhciInjection: {Name: "hci packet injection", Reason: unsupported}, } if noHostChecks(target) { return res, nil diff --git a/pkg/host/features_linux.go b/pkg/host/features_linux.go index 8c6f63004..230022c38 100644 --- a/pkg/host/features_linux.go +++ b/pkg/host/features_linux.go @@ -28,6 +28,7 @@ func init() { checkFeature[FeatureKCSAN] = checkKCSAN checkFeature[FeatureDevlinkPCI] = checkDevlinkPCI checkFeature[FeatureUSBEmulation] = checkUSBEmulation + checkFeature[FeatureVhciInjection] = checkVhciInjection } func checkCoverage() string { @@ -191,6 +192,13 @@ func checkUSBEmulation() string { return "" } +func checkVhciInjection() string { + if err := osutil.IsAccessible("/dev/vhci"); err != nil { + return err.Error() + } + return "" +} + func checkDebugFS() string { if err := osutil.IsAccessible("/sys/kernel/debug"); err != nil { return "debugfs is not enabled or not mounted" diff --git a/pkg/host/syscalls_linux.go b/pkg/host/syscalls_linux.go index 715deada4..f0230bb6a 100644 --- a/pkg/host/syscalls_linux.go +++ b/pkg/host/syscalls_linux.go @@ -181,6 +181,9 @@ func isSupportedSyzkall(c *prog.Syscall, target *prog.Target, sandbox string) (b case "syz_emit_ethernet", "syz_extract_tcp_res": reason := checkNetInjection() return reason == "", reason + case "syz_emit_vhci": + reason := checkVhciInjection() + return reason == "", reason case "syz_usb_connect", "syz_usb_connect_ath9k", "syz_usb_disconnect", "syz_usb_control_io", "syz_usb_ep_write", "syz_usb_ep_read": reason := checkUSBEmulation() |
