Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syz-declextract: some assorted improvements #5491

Merged
merged 11 commits into from
Nov 11, 2024

Conversation

dvyukov
Copy link
Collaborator

@dvyukov dvyukov commented Nov 7, 2024

  • sys/linux: regenerate const files
  • tools/syz-declextract: fix header includes
  • tools/syz-declextract: provoke non-determinism
  • tools/syz-declextract: fix non-determinism and syscall selection
  • tools/syz-declextract: restructure for better scalability

@dvyukov dvyukov changed the title dvyukov declextract some syz-declextract: some assorted improvements Nov 7, 2024
@dvyukov dvyukov requested review from a-nogikh and removed request for a-nogikh November 7, 2024 14:56
@dvyukov dvyukov marked this pull request as draft November 7, 2024 14:57
The additional includes we add must be at the top (added after sorting),
because other kernel headers are broken and won't compile without
these additional ones included first.
Provoke any non-determinism caused by file order early.
Currently syscall selection is non-deterministic and we frequently
choose wrond ones. This leads to flaky argument names/types,
and wrong argument types (e.g. int16 instead of uid,
old_utimbuf32 instead of utimbuf, etc).

Make syscall selection robust and correct.
Move AST matcher setup to each interface extractor.
This keeps related things together.
Factor it out into a easier to use function,
and improve encapsulation.
Currently we select one non-deterministic interfaces from all
source files that produce it. This results in non-determinism,
and limited set of files.
Merge files/subsystems from all source files that produce it.
Currently we have a number of hacks to deal with unused bits:
 - remove some netlink syscalls if no policy union present
 - generate the huge union for unused policies
 - manually remove 1 struct
But we still got more unused structs after recent changes.

Properly remove all unused bits using the compiler knowledge.
This is both simpler and more reliable.
@dvyukov dvyukov force-pushed the dvyukov-declextract-some branch from 78a1cd1 to 8320ec3 Compare November 11, 2024 09:27
@dvyukov dvyukov marked this pull request as ready for review November 11, 2024 14:16
@dvyukov dvyukov requested a review from tarasmadan November 11, 2024 14:16
@dvyukov dvyukov added this pull request to the merge queue Nov 11, 2024
Merged via the queue into google:master with commit 7cf9ef5 Nov 11, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants