From 48ec7344e13eaeee104976fb52d3ed30c1073d5d Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Wed, 14 Dec 2022 19:23:40 +0100 Subject: pkg/subsystem: extract subsystems from syz_mount_image$ calls Dump the mapping between the currently available pseudo syscalls and the corresponding subsystems. --- pkg/subsystem/extract.go | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'pkg/subsystem/extract.go') 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`) ) -- cgit mrf-deployment