aboutsummaryrefslogtreecommitdiffstats
path: root/tools/syz-declextract/testdata/scopes.c.json
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2025-04-08 14:11:26 +0200
committerDmitry Vyukov <dvyukov@google.com>2025-04-09 10:27:41 +0000
commit1aed810c86069f8b9b117ccccf083e98bf0da74c (patch)
treee6841902edef7496b3813eea3e31c7c599625c62 /tools/syz-declextract/testdata/scopes.c.json
parent6dfb898e263c6fdb948f1578b0dada1e15b6764e (diff)
tools/syz-declextract: extend test data
Add few interesting cases for scope analysis. Move functions related to resource to the header file, they must be visible in every file to work.
Diffstat (limited to 'tools/syz-declextract/testdata/scopes.c.json')
-rw-r--r--tools/syz-declextract/testdata/scopes.c.json174
1 files changed, 174 insertions, 0 deletions
diff --git a/tools/syz-declextract/testdata/scopes.c.json b/tools/syz-declextract/testdata/scopes.c.json
index 2a497dbe1..ab03673b0 100644
--- a/tools/syz-declextract/testdata/scopes.c.json
+++ b/tools/syz-declextract/testdata/scopes.c.json
@@ -114,6 +114,59 @@
{
"arg": 1,
"values": [
+ "FOO_IOCTL7",
+ "FOO_IOCTL8"
+ ],
+ "loc": 4,
+ "calls": [
+ "scopes_helper"
+ ],
+ "facts": [
+ {
+ "src": {
+ "return": {
+ "func": "scopes_helper"
+ }
+ },
+ "dst": {
+ "local": {
+ "name": "tmp"
+ }
+ }
+ },
+ {
+ "src": {
+ "argument": {
+ "func": "__do_sys_scopes0",
+ "arg": 1
+ }
+ },
+ "dst": {
+ "argument": {
+ "func": "scopes_helper",
+ "arg": 0
+ }
+ }
+ },
+ {
+ "src": {
+ "argument": {
+ "func": "__do_sys_scopes0",
+ "arg": 0
+ }
+ },
+ "dst": {
+ "argument": {
+ "func": "scopes_helper",
+ "arg": 1
+ }
+ }
+ }
+ ]
+ },
+ {
+ "arg": 1,
+ "values": [
"100",
"101",
"102"
@@ -140,6 +193,99 @@
]
}
]
+ },
+ {
+ "name": "__fget_light",
+ "file": "include/fs.h",
+ "is_static": true,
+ "scopes": [
+ {
+ "arg": -1
+ }
+ ]
+ },
+ {
+ "name": "alloc_fd",
+ "file": "include/fs.h",
+ "is_static": true,
+ "scopes": [
+ {
+ "arg": -1,
+ "loc": 1
+ }
+ ]
+ },
+ {
+ "name": "from_kuid",
+ "file": "include/fs.h",
+ "is_static": true,
+ "scopes": [
+ {
+ "arg": -1,
+ "loc": 1
+ }
+ ]
+ },
+ {
+ "name": "scopes_helper",
+ "file": "scopes.c",
+ "is_static": true,
+ "scopes": [
+ {
+ "arg": -1,
+ "loc": 2
+ },
+ {
+ "arg": 0,
+ "values": [
+ "FOO_IOCTL7"
+ ],
+ "loc": 2,
+ "calls": [
+ "alloc_fd"
+ ],
+ "facts": [
+ {
+ "src": {
+ "return": {
+ "func": "alloc_fd"
+ }
+ },
+ "dst": {
+ "return": {
+ "func": "scopes_helper"
+ }
+ }
+ }
+ ]
+ },
+ {
+ "arg": 0,
+ "values": [
+ "FOO_IOCTL8"
+ ],
+ "loc": 3,
+ "calls": [
+ "__fget_light"
+ ],
+ "facts": [
+ {
+ "src": {
+ "argument": {
+ "func": "scopes_helper",
+ "arg": 1
+ }
+ },
+ "dst": {
+ "argument": {
+ "func": "__fget_light",
+ "arg": 0
+ }
+ }
+ }
+ ]
+ }
+ ]
}
],
"consts": [
@@ -162,6 +308,16 @@
"name": "FOO_IOCTL4",
"filename": "include/uapi/file_operations.h",
"value": 1074291460
+ },
+ {
+ "name": "FOO_IOCTL7",
+ "filename": "include/uapi/file_operations.h",
+ "value": 25351
+ },
+ {
+ "name": "FOO_IOCTL8",
+ "filename": "include/uapi/file_operations.h",
+ "value": 25352
}
],
"structs": [
@@ -281,6 +437,24 @@
}
}
}
+ },
+ {
+ "name": "FOO_IOCTL7",
+ "type": {
+ "int": {
+ "byte_size": 1,
+ "is_const": true
+ }
+ }
+ },
+ {
+ "name": "FOO_IOCTL8",
+ "type": {
+ "int": {
+ "byte_size": 1,
+ "is_const": true
+ }
+ }
}
]
} \ No newline at end of file