aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/subsystem/extract.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2022-12-14 19:23:40 +0100
committerAleksandr Nogikh <wp32pw@gmail.com>2022-12-16 10:22:43 +0100
commit48ec7344e13eaeee104976fb52d3ed30c1073d5d (patch)
tree4610491e2b90c0ec21c61a518673273788f00e27 /pkg/subsystem/extract.go
parentf38211dffe4374a9e09d966b021c00da9d1300c5 (diff)
pkg/subsystem: extract subsystems from syz_mount_image$ calls
Dump the mapping between the currently available pseudo syscalls and the corresponding subsystems.
Diffstat (limited to 'pkg/subsystem/extract.go')
-rw-r--r--pkg/subsystem/extract.go53
1 files changed, 53 insertions, 0 deletions
diff --git a/pkg/subsystem/extract.go b/pkg/subsystem/extract.go
index 181c15835..e29fbab01 100644
--- a/pkg/subsystem/extract.go
+++ b/pkg/subsystem/extract.go
@@ -24,6 +24,7 @@ type Crash struct {
func MakeLinuxSubsystemExtractor() *SubsystemExtractor {
return &SubsystemExtractor{
pathToSubsystems: linuxPathToSubsystems,
+ callToSubsystems: linuxCallToSubsystems,
}
}
@@ -60,6 +61,58 @@ func linuxPathToSubsystems(path string) []string {
return ret
}
+func linuxCallToSubsystems(call string) []string {
+ name := linuxCallToSubsystemsMap[call]
+ if name != "" {
+ return []string{name}
+ }
+ return nil
+}
+
+var linuxCallToSubsystemsMap = map[string]string{
+ "syz_mount_image$adfs": "adfs",
+ "syz_mount_image$affs": "affs",
+ "syz_mount_image$befs": "befs",
+ "syz_mount_image$bfs": "bfs",
+ "syz_mount_image$btrfs": "btrfs",
+ "syz_mount_image$cramfs": "cramfs",
+ "syz_mount_image$efs": "efs",
+ "syz_mount_image$erofs": "erofs",
+ "syz_mount_image$exfat": "exfat",
+ "syz_mount_image$ext4": "ext4",
+ "syz_mount_image$f2fs": "f2fs",
+ "syz_mount_image$gfs2": "gfs2",
+ "syz_mount_image$gfs2meta": "gfs2",
+ "syz_mount_image$hfs": "hfs",
+ "syz_mount_image$hfsplus": "hfsplus",
+ "syz_mount_image$hpfs": "hpfs",
+ "syz_mount_image$iso9660": "iso9660",
+ "syz_mount_image$jffs2": "jffs2",
+ "syz_mount_image$jfs": "jfs",
+ "syz_mount_image$minix": "minix",
+ "syz_mount_image$msdos": "fat",
+ "syz_mount_image$nilfs2": "nilfs2",
+ "syz_mount_image$ntfs": "ntfs",
+ "syz_mount_image$ntfs3": "ntfs3",
+ "syz_mount_image$ocfs2": "ocfs2",
+ "syz_mount_image$omfs": "omfs",
+ "syz_mount_image$qnx4": "qnx4",
+ "syz_mount_image$qnx6": "qnx6",
+ "syz_mount_image$reiserfs": "reiserfs",
+ "syz_mount_image$romfs": "romfs",
+ "syz_mount_image$squashfs": "squashfs",
+ "syz_mount_image$sysv": "sysv",
+ "syz_mount_image$tmpfs": "tmpfs",
+ "syz_mount_image$ubifs": "ubifs",
+ "syz_mount_image$udf": "udf",
+ "syz_mount_image$ufs": "ufs",
+ "syz_mount_image$v7": "v7",
+ "syz_mount_image$vfat": "vfat",
+ "syz_mount_image$vxfs": "vxfs",
+ "syz_mount_image$xfs": "xfs",
+ "syz_mount_image$zonefs": "zonefs",
+}
+
var (
vfsPathRegexp = regexp.MustCompile(`^fs/[^/]+\.c`)
)