From 3da9017c17c7d2432c4b76345c4d2efbeedd2935 Mon Sep 17 00:00:00 2001 From: Joey Jiaojg Date: Wed, 26 May 2021 19:38:04 +0800 Subject: pkg/compiler: add glob type * all: add new typename dirname The current way to check files under sysfs or proc is: - define a string to represent each file - open the file - pass the fd to write / read / close The issues above are: - Need to know what file present on target device - Need to write openat for each file With dirname added, which will open one file in the directory randomly and then pass the fd to write/read/close. * all: use typename glob to match filename Fixes #481 --- sys/linux/sys.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sys/linux') diff --git a/sys/linux/sys.txt b/sys/linux/sys.txt index c2725bfe7..ab39e6ded 100644 --- a/sys/linux/sys.txt +++ b/sys/linux/sys.txt @@ -78,6 +78,8 @@ type signalnoptr intptr[0:65] syz_execute_func(text ptr[in, text[target]]) +openat$sysfs(fd const[AT_FDCWD], dir ptr[in, glob["/sys/**/*"]], flags flags[open_flags], mode flags[open_mode]) fd + open(file ptr[in, filename], flags flags[open_flags], mode flags[open_mode]) fd # Just so that we have something that creates fd_dir resources. open$dir(file ptr[in, filename], flags flags[open_flags], mode flags[open_mode]) fd_dir -- cgit mrf-deployment