github.com/google/syzkaller@v0.0.0-20251211124644-a066d2bc4b02/tools/syz-declextract/testdata/file_operations.c.json (about)

     1  {
     2  	"functions": [
     3  		{
     4  			"name": "__fget_light",
     5  			"file": "include/fs.h",
     6  			"start_line": 18,
     7  			"end_line": 19,
     8  			"is_static": true,
     9  			"scopes": [
    10  				{
    11  					"arg": -1
    12  				}
    13  			]
    14  		},
    15  		{
    16  			"name": "alloc_fd",
    17  			"file": "include/fs.h",
    18  			"start_line": 14,
    19  			"end_line": 16,
    20  			"is_static": true,
    21  			"scopes": [
    22  				{
    23  					"arg": -1
    24  				}
    25  			]
    26  		},
    27  		{
    28  			"name": "foo_ioctl",
    29  			"file": "file_operations.c",
    30  			"start_line": 30,
    31  			"end_line": 42,
    32  			"is_static": true,
    33  			"scopes": [
    34  				{
    35  					"arg": -1,
    36  					"calls": [
    37  						"foo_ioctl2"
    38  					],
    39  					"facts": [
    40  						{
    41  							"src": {
    42  								"argument": {
    43  									"func": "foo_ioctl",
    44  									"arg": 1
    45  								}
    46  							},
    47  							"dst": {
    48  								"argument": {
    49  									"func": "foo_ioctl2",
    50  									"arg": 0
    51  								}
    52  							}
    53  						},
    54  						{
    55  							"src": {
    56  								"argument": {
    57  									"func": "foo_ioctl",
    58  									"arg": 2
    59  								}
    60  							},
    61  							"dst": {
    62  								"argument": {
    63  									"func": "foo_ioctl2",
    64  									"arg": 1
    65  								}
    66  							}
    67  						}
    68  					]
    69  				},
    70  				{
    71  					"arg": 1,
    72  					"values": [
    73  						"FOO_IOCTL1",
    74  						"FOO_IOCTL2",
    75  						"FOO_IOCTL3",
    76  						"FOO_IOCTL4",
    77  						"FOO_IOCTL5",
    78  						"FOO_IOCTL10",
    79  						"FOO_IOCTL11",
    80  						"FOO_IOCTL12"
    81  					],
    82  					"start_line": 32,
    83  					"end_line": 40
    84  				}
    85  			]
    86  		},
    87  		{
    88  			"name": "foo_ioctl2",
    89  			"file": "file_operations.c",
    90  			"start_line": 22,
    91  			"end_line": 28,
    92  			"is_static": true,
    93  			"scopes": [
    94  				{
    95  					"arg": -1
    96  				},
    97  				{
    98  					"arg": 0,
    99  					"values": [
   100  						"FOO_IOCTL6",
   101  						"FOO_IOCTL7"
   102  					],
   103  					"start_line": 24,
   104  					"end_line": 27
   105  				}
   106  			]
   107  		},
   108  		{
   109  			"name": "foo_mmap",
   110  			"file": "file_operations.c",
   111  			"start_line": 19,
   112  			"end_line": 19,
   113  			"is_static": true,
   114  			"scopes": [
   115  				{
   116  					"arg": -1
   117  				}
   118  			]
   119  		},
   120  		{
   121  			"name": "foo_mmap2",
   122  			"file": "file_operations.c",
   123  			"start_line": 20,
   124  			"end_line": 20,
   125  			"is_static": true,
   126  			"scopes": [
   127  				{
   128  					"arg": -1
   129  				}
   130  			]
   131  		},
   132  		{
   133  			"name": "foo_open",
   134  			"file": "file_operations.c",
   135  			"start_line": 16,
   136  			"end_line": 16,
   137  			"is_static": true,
   138  			"scopes": [
   139  				{
   140  					"arg": -1
   141  				}
   142  			]
   143  		},
   144  		{
   145  			"name": "foo_read",
   146  			"file": "file_operations.c",
   147  			"start_line": 17,
   148  			"end_line": 17,
   149  			"is_static": true,
   150  			"scopes": [
   151  				{
   152  					"arg": -1
   153  				}
   154  			]
   155  		},
   156  		{
   157  			"name": "foo_write",
   158  			"file": "file_operations.c",
   159  			"start_line": 18,
   160  			"end_line": 18,
   161  			"is_static": true,
   162  			"scopes": [
   163  				{
   164  					"arg": -1
   165  				}
   166  			]
   167  		},
   168  		{
   169  			"name": "from_kuid",
   170  			"file": "include/fs.h",
   171  			"start_line": 21,
   172  			"end_line": 23,
   173  			"is_static": true,
   174  			"scopes": [
   175  				{
   176  					"arg": -1
   177  				}
   178  			]
   179  		},
   180  		{
   181  			"name": "proc_ioctl",
   182  			"file": "file_operations.c",
   183  			"start_line": 57,
   184  			"end_line": 57,
   185  			"is_static": true,
   186  			"scopes": [
   187  				{
   188  					"arg": -1
   189  				}
   190  			]
   191  		},
   192  		{
   193  			"name": "proc_open",
   194  			"file": "file_operations.c",
   195  			"start_line": 54,
   196  			"end_line": 54,
   197  			"is_static": true,
   198  			"scopes": [
   199  				{
   200  					"arg": -1
   201  				}
   202  			]
   203  		},
   204  		{
   205  			"name": "proc_read",
   206  			"file": "file_operations.c",
   207  			"start_line": 55,
   208  			"end_line": 55,
   209  			"is_static": true,
   210  			"scopes": [
   211  				{
   212  					"arg": -1
   213  				}
   214  			]
   215  		},
   216  		{
   217  			"name": "proc_write",
   218  			"file": "file_operations.c",
   219  			"start_line": 56,
   220  			"end_line": 56,
   221  			"is_static": true,
   222  			"scopes": [
   223  				{
   224  					"arg": -1
   225  				}
   226  			]
   227  		},
   228  		{
   229  			"name": "unused_ioctl",
   230  			"file": "file_operations.c",
   231  			"start_line": 73,
   232  			"end_line": 78,
   233  			"is_static": true,
   234  			"scopes": [
   235  				{
   236  					"arg": -1
   237  				},
   238  				{
   239  					"arg": 1,
   240  					"values": [
   241  						"UNUSED_IOCTL1",
   242  						"UNUSED_IOCTL2"
   243  					],
   244  					"start_line": 75,
   245  					"end_line": 77
   246  				}
   247  			]
   248  		}
   249  	],
   250  	"consts": [
   251  		{
   252  			"name": "FOO_IOCTL1",
   253  			"filename": "include/uapi/file_operations.h",
   254  			"value": 25345
   255  		},
   256  		{
   257  			"name": "FOO_IOCTL10",
   258  			"filename": "include/uapi/file_operations.h",
   259  			"value": 2147771146
   260  		},
   261  		{
   262  			"name": "FOO_IOCTL11",
   263  			"filename": "include/uapi/file_operations.h",
   264  			"value": 2147771147
   265  		},
   266  		{
   267  			"name": "FOO_IOCTL12",
   268  			"filename": "file_operations.c",
   269  			"value": 2147771148
   270  		},
   271  		{
   272  			"name": "FOO_IOCTL2",
   273  			"filename": "include/uapi/file_operations.h",
   274  			"value": 2147771138
   275  		},
   276  		{
   277  			"name": "FOO_IOCTL3",
   278  			"filename": "include/uapi/file_operations.h",
   279  			"value": 2148033283
   280  		},
   281  		{
   282  			"name": "FOO_IOCTL4",
   283  			"filename": "include/uapi/file_operations.h",
   284  			"value": 1074291460
   285  		},
   286  		{
   287  			"name": "FOO_IOCTL5",
   288  			"filename": "include/uapi/file_operations.h",
   289  			"value": 3221775109
   290  		},
   291  		{
   292  			"name": "FOO_IOCTL6",
   293  			"filename": "include/uapi/file_operations.h",
   294  			"value": 25350
   295  		},
   296  		{
   297  			"name": "FOO_IOCTL7",
   298  			"filename": "include/uapi/file_operations.h",
   299  			"value": 25351
   300  		},
   301  		{
   302  			"name": "UNUSED_IOCTL1",
   303  			"filename": "include/uapi/unused_ioctl.h",
   304  			"value": 25345
   305  		},
   306  		{
   307  			"name": "UNUSED_IOCTL2",
   308  			"filename": "file_operations.c",
   309  			"value": 25346
   310  		}
   311  	],
   312  	"structs": [
   313  		{
   314  			"name": "foo_ioctl_arg",
   315  			"byte_size": 8,
   316  			"align": 4,
   317  			"fields": [
   318  				{
   319  					"name": "a",
   320  					"counted_by": -1,
   321  					"type": {
   322  						"int": {
   323  							"byte_size": 4,
   324  							"name": "int",
   325  							"base": "int"
   326  						}
   327  					}
   328  				},
   329  				{
   330  					"name": "b",
   331  					"counted_by": -1,
   332  					"type": {
   333  						"int": {
   334  							"byte_size": 4,
   335  							"name": "int",
   336  							"base": "int"
   337  						}
   338  					}
   339  				}
   340  			]
   341  		}
   342  	],
   343  	"file_ops": [
   344  		{
   345  			"name": "foo_file_operations",
   346  			"open": "foo_open",
   347  			"read": "foo_read",
   348  			"write": "foo_write",
   349  			"mmap": "foo_mmap",
   350  			"ioctl": "foo_ioctl",
   351  			"source_file": "file_operations.c"
   352  		},
   353  		{
   354  			"name": "proc_ops_file_operations",
   355  			"open": "proc_open",
   356  			"read": "proc_read",
   357  			"write": "proc_write",
   358  			"mmap": "proc_open",
   359  			"source_file": "file_operations.c"
   360  		},
   361  		{
   362  			"name": "proc_ops_file_operations1",
   363  			"open": "proc_open",
   364  			"mmap": "proc_open",
   365  			"ioctl": "proc_ioctl",
   366  			"source_file": "file_operations.c"
   367  		},
   368  		{
   369  			"name": "unused_file_operations",
   370  			"ioctl": "unused_ioctl",
   371  			"source_file": "file_operations.c"
   372  		}
   373  	],
   374  	"ioctls": [
   375  		{
   376  			"name": "FOO_IOCTL1",
   377  			"type": {
   378  				"int": {
   379  					"byte_size": 1,
   380  					"is_const": true
   381  				}
   382  			}
   383  		},
   384  		{
   385  			"name": "FOO_IOCTL2",
   386  			"type": {
   387  				"ptr": {
   388  					"elem": {
   389  						"int": {
   390  							"byte_size": 4,
   391  							"name": "int",
   392  							"base": "int"
   393  						}
   394  					},
   395  					"is_const": true
   396  				}
   397  			}
   398  		},
   399  		{
   400  			"name": "FOO_IOCTL3",
   401  			"type": {
   402  				"ptr": {
   403  					"elem": {
   404  						"struct": "foo_ioctl_arg"
   405  					},
   406  					"is_const": true
   407  				}
   408  			}
   409  		},
   410  		{
   411  			"name": "FOO_IOCTL4",
   412  			"type": {
   413  				"ptr": {
   414  					"elem": {
   415  						"struct": "foo_ioctl_arg"
   416  					}
   417  				}
   418  			}
   419  		},
   420  		{
   421  			"name": "FOO_IOCTL5",
   422  			"type": {
   423  				"ptr": {
   424  					"elem": {
   425  						"struct": "foo_ioctl_arg"
   426  					}
   427  				}
   428  			}
   429  		},
   430  		{
   431  			"name": "FOO_IOCTL6",
   432  			"type": {
   433  				"int": {
   434  					"byte_size": 1,
   435  					"is_const": true
   436  				}
   437  			}
   438  		},
   439  		{
   440  			"name": "FOO_IOCTL7",
   441  			"type": {
   442  				"int": {
   443  					"byte_size": 1,
   444  					"is_const": true
   445  				}
   446  			}
   447  		},
   448  		{
   449  			"name": "UNUSED_IOCTL1",
   450  			"type": {
   451  				"int": {
   452  					"byte_size": 1,
   453  					"is_const": true
   454  				}
   455  			}
   456  		},
   457  		{
   458  			"name": "UNUSED_IOCTL2",
   459  			"type": {
   460  				"int": {
   461  					"byte_size": 1,
   462  					"is_const": true
   463  				}
   464  			}
   465  		}
   466  	]
   467  }