From c756ba4e975097bf74b952367e2cd1a8db466c69 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 2 Dec 2024 10:57:36 +0100 Subject: tools/syz-declextract: extract file_operations descriptions Extend the clang tool to locate file_operations variables and arrays and dump open/read/write/mmap/ioctl callbacks for each. It also tries to extract set of ioctl commands and argument types for them in a simple best-effort way (for now). It just locates switch in the ioctl callback and extracts each case as a command. --- tools/syz-declextract/testdata/include/fs.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tools/syz-declextract/testdata/include/fs.h (limited to 'tools/syz-declextract/testdata/include/fs.h') diff --git a/tools/syz-declextract/testdata/include/fs.h b/tools/syz-declextract/testdata/include/fs.h new file mode 100644 index 000000000..a5c838595 --- /dev/null +++ b/tools/syz-declextract/testdata/include/fs.h @@ -0,0 +1,12 @@ +// Copyright 2024 syzkaller project authors. All rights reserved. +// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +struct file_operations { + void (*open)(void); + void (*read)(void); + void (*write)(void); + void (*read_iter)(void); + void (*write_iter)(void); + void (*unlocked_ioctl)(unsigned int); + void (*mmap)(void); +}; -- cgit mrf-deployment