-
Notifications
You must be signed in to change notification settings - Fork 10
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
Dictionaries as a way to guide dfuzzer? #81
Comments
@mrc0mmand issues like systemd/systemd#23381 could be caught by |
systemd/systemd#20933 would be another example where json dictionaries with basic mutations could have helped probably. FWIW there is another project where json is converted to dbus messages: https://github.com/elrafoon/json-dbus-bridge |
So I tried to collect valid dbus messages that can be used to populate dictionaries automatically using the systemd testsuite and it didn't work out unfortunately. For example the DBus interfaces provided by machined aren't covered by a lot of tests judging from machine-dbus.c (8.1%) and machined-dbus.c (26.34%). I'm not sure what to do about it. Another issue is that for example |
Do you have any example how such message looks like? Or is it something like #75 (comment)?
This could be, maybe, solvable to some degree by sometimes opening a valid file descriptor, for example via fmemopen() or something similar. |
Yes it is. I just ran
Agreed. I think it should be possible to pass valid file descriptors. It's just that |
I see. Would it make sense to begin with a "dumb" implementation first - i.e. accepting a file with a list of JSON objects, and if the service/object/interface/method* matches, use the payload instead of generating a random one? I'm still not completely sure how all the pieces would fit together, so this might be a good starting point :-) * this could use the same rules as the suppression stuff, if needed, i.e. a missing interface means "all interfaces"
I see, that make sense. Could you, please, open an issue about this, since the solution might not be as straightforward as I originally thought? (And this is something we should definitely fix/implement.) |
I've been thinking about this and I think that maybe instead of json it would be easier to use pcaps. Wireshark can dissect dbus messages so it should be easy to turn them into something human-friendly if necessary. It should also make it easier to replay messages to get services to reach certain points before starting throwing gibberish. |
I haven't figured out what to do with file descriptors though :-) |
It was discussed in https://github.com/matusmarhefka/dfuzzer/pull/80#discussion_r867525573
More generally it would be great to come up with more heuristics allowing dfuzzer to cover as much code as possible (preferably automatically)
The text was updated successfully, but these errors were encountered: