aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/declextract/typing.go
Commit message (Collapse)AuthorAgeFilesLines
* pkg/clangtool: make more genericDmitry Vyukov2025-11-171-1/+3
| | | | Make it possible to use pkg/clangtool with other types than declextract.Output.
* pkg/declextract: add a TODODmitry Vyukov2025-04-151-0/+4
|
* pkg/declextract: add open fileops callback to interface listDmitry Vyukov2025-04-151-0/+5
| | | | | | Add open callback if there are no other unique callbacks. This happens for e.g. seq files which only have unique open, while read is a common seq_read callback.
* pkg/declextract: export syscall variants as separate interfacesDmitry Vyukov2025-04-101-16/+23
| | | | | | Export each syscall variant (e.g. fcnt$*) as a separate interface. Effectively these are separate syscalls. We will want this for ioctl as well (it's not 1 interface).
* tools/syz-declextract: refine arg types for syscall variantsDmitry Vyukov2025-04-091-27/+91
| | | | | | Use scope-based dataflow analysis for syscall variants (including ioctls). As the result we only consider code that relates to a partiuclar command/ioctl, and can infer arguments/return types for each command/ioctl independently.
* tools/syz-declextract: support function scopesDmitry Vyukov2025-01-221-8/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extract info about function scopes formed by switch'es on function arguments. For example if we have: void foo(..., int cmd, ...) { ... switch (cmd) { case FOO: ... block 1 ... case BAR: ... block 2 ... } ... } We record that any data flow within block 1 is only relevant when foo's arg cmd has value FOO, similarly for block 2 and BAR. This allows to do 3 things: 1. Locate ioctl commands that are switched on within transitively called functions. 2. Infer return value for each ioctl command. 3. Infer argument type when it's not specified in _IO macro. This will also allow to infer other multiplexed syscalls. Descriptions generated on Linux commit c4b9570cfb63501.
* tools/syz-declextract: infer argument/field typesDmitry Vyukov2024-12-171-0/+268
Use data flow analysis to infer syscall argument, return value, and struct field types. See the comment in pkg/declextract/typing.go for more details.