From a2335417592dcd4545c1953807ae9c8906e133d5 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 11 Apr 2025 08:04:51 +0200 Subject: tools/syz-declextract: export info about file ops interfaces --- tools/syz-declextract/declextract.go | 4 +++- tools/syz-declextract/testdata/file_operations.c.info | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/syz-declextract/declextract.go b/tools/syz-declextract/declextract.go index 0200967db..6ffca0170 100644 --- a/tools/syz-declextract/declextract.go +++ b/tools/syz-declextract/declextract.go @@ -275,7 +275,9 @@ func finishInterfaces(interfaces []*declextract.Interface, consts map[string]*co } extractor := subsystem.MakeExtractor(subsystem.GetList(target.OS)) for _, iface := range interfaces { - iface.ManualDescriptions = manual[iface.IdentifyingConst] + if iface.IdentifyingConst != "" { + iface.ManualDescriptions = declextract.Tristate(manual[iface.IdentifyingConst]) + } var crashes []*subsystem.Crash for _, file := range iface.Files { crashes = append(crashes, &subsystem.Crash{GuiltyPath: file}) diff --git a/tools/syz-declextract/testdata/file_operations.c.info b/tools/syz-declextract/testdata/file_operations.c.info index e69de29bb..a6ad4f27b 100644 --- a/tools/syz-declextract/testdata/file_operations.c.info +++ b/tools/syz-declextract/testdata/file_operations.c.info @@ -0,0 +1,16 @@ +FILEOP foo_mmap func:foo_mmap loc:0 coverage:0 access:unknown manual_desc:unknown auto_desc:true file:file_operations.c subsystem:kernel +FILEOP foo_read func:foo_read loc:0 coverage:0 access:unknown manual_desc:unknown auto_desc:true file:file_operations.c subsystem:kernel +FILEOP foo_write func:foo_write loc:0 coverage:0 access:unknown manual_desc:unknown auto_desc:true file:file_operations.c subsystem:kernel +FILEOP proc_open func:proc_open loc:0 coverage:0 access:unknown manual_desc:unknown auto_desc:false file:file_operations.c subsystem:kernel +FILEOP proc_read func:proc_read loc:0 coverage:0 access:unknown manual_desc:unknown auto_desc:false file:file_operations.c subsystem:kernel +FILEOP proc_write func:proc_write loc:0 coverage:0 access:unknown manual_desc:unknown auto_desc:false file:file_operations.c subsystem:kernel +IOCTL FOO_IOCTL1 func:foo_ioctl loc:10 coverage:0 access:unknown manual_desc:false auto_desc:true file:file_operations.c subsystem:kernel +IOCTL FOO_IOCTL2 func:foo_ioctl loc:10 coverage:0 access:unknown manual_desc:false auto_desc:true file:file_operations.c subsystem:kernel +IOCTL FOO_IOCTL3 func:foo_ioctl loc:10 coverage:0 access:unknown manual_desc:false auto_desc:true file:file_operations.c subsystem:kernel +IOCTL FOO_IOCTL4 func:foo_ioctl loc:10 coverage:0 access:unknown manual_desc:false auto_desc:true file:file_operations.c subsystem:kernel +IOCTL FOO_IOCTL5 func:foo_ioctl loc:10 coverage:0 access:unknown manual_desc:false auto_desc:true file:file_operations.c subsystem:kernel +IOCTL FOO_IOCTL6 func:foo_ioctl loc:8 coverage:0 access:unknown manual_desc:false auto_desc:true file:file_operations.c subsystem:kernel +IOCTL FOO_IOCTL7 func:foo_ioctl loc:8 coverage:0 access:unknown manual_desc:false auto_desc:true file:file_operations.c subsystem:kernel +IOCTL UNUSED_IOCTL1 func:unused_ioctl loc:4 coverage:0 access:unknown manual_desc:false auto_desc:false file:file_operations.c subsystem:kernel +IOCTL UNUSED_IOCTL2 func:unused_ioctl loc:4 coverage:0 access:unknown manual_desc:false auto_desc:false file:file_operations.c subsystem:kernel +IOCTL proc_ioctl func:proc_ioctl loc:0 coverage:0 access:unknown manual_desc:unknown auto_desc:false file:file_operations.c subsystem:kernel -- cgit mrf-deployment