-
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
fuzz: handle advanced signatures as well #64
Conversation
Oh well, this sort of works, but it's wrapped in another tuple, which makes it a bit useless. After reading through the glib sources I got another idea, but that needs to wait until tomorrow. |
Ah, nevermind, it works as it supposed to, but currently dfuzzer disassembles the signature to arguments, which the new function doesn't like. Let me fix that. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
@evverx so, this should now, hopefully, do what it's supposed to. As this ended up touching a lot of more code than I originally anticipated (along with dropping the libffi dependency completely and a lot of other code) it would be stellar if you could unleash some of your shenanigans on this, since you have the gift for finding interesting issues ;-) There's still some work to do, but the core stuff should work™. |
@mrc0mmand I'll take a look tomorrow I think.
Do you mean issues like
? |
That's exactly what I'm talking about :-) |
Thanks! I'll extend the tests to cover the new stuff in the meanwhile, so no rush :-) |
86e4e4a
to
61fcce5
Compare
08b1db3
to
d953aa9
Compare
This comment was marked as resolved.
This comment was marked as resolved.
3b95511
to
c49b964
Compare
I think it would have helped to unleash |
Also having played with |
It could be I'm missing something here. I'll take a look at the logs to figure out whether |
Maybe renaming the |
Interesting, I'm not aware of any global dfuzzer timeout, but it's definitely something that should get figured out. |
It would cover that particular use case but in general |
Gotcha. To make matters easier, I tweaked the arguments as follows:
That should, hopefully, make everybody happy :-) |
df3bfc0
to
921d4f8
Compare
|
||
subdir('src') | ||
|
||
executable( | ||
'dfuzzer', | ||
dfuzzer_sources, | ||
dependencies : [libgio, libffi], | ||
dependencies : [libgio], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you remove it from README
, Makefile
, .github/workflows/build.yml
and .lgtm.yaml
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Speaking of Makefile
, I got access to the Fedora dfuzzer repo, so once we're finished here, I can update the package and drop the Makefile
altogether.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to know. Thanks!
That would break scripts like https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/c006d814b0776bea492c683d13fb466ffeea4296/tests/security/atsec/dbus_fuzzer.pm#L25-L29 but I guess it should be possible to notify them before dropping Makefile
@@ -1041,6 +1068,13 @@ void df_print_help(const char *name) | |||
" Requires -o and -i to be set as well.\n" | |||
" -b --buffer-limit=SIZE Maximum buffer size for generated strings in bytes.\n" | |||
" Default: 50K, minimum: 256B.\n" | |||
" -x --max-iterations=ITER Maximum number of iterations done for each method.\n" | |||
" By default this value is dynamically calculated from each\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think dfuzzer should default to something more or less meaningful here. Without it -x
would always have to be passed and that's not the best user experience I think. It would also make scripts where dfuzzer -n ...
is already used run for hours. Another option would be not to roll out advanced signatures by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, the current limits are somewhat reasonable (when not run under Valgrind), the first implementation used, for example, 1024 iterations for double, or 512 iterations for string (so one of our custom complex signatures yielded over 12k iterations, which ran almost 5 minutes under Valgrind), whereas now it's 32 and 64 respectively.
The "issue" in our CI is that we run dfuzzer on the whole systemd dbus service twice + a couple of less demanding cases, hence the need of -x
. But I see your point, I'm not completely sure how to make it more "elegant" though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(when not run under Valgrind)
I'm not sure what you're implying :-)
I see your point, I'm not completely sure how to make it more "elegant" though.
Let's get it merged and either wait for bug reports or tune it in the process of integrating systemd/systemd#22547
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(when not run under Valgrind)
I'm not sure what you're implying :-)
Nothing at all, Valgrind is invaluable when hunting down memleaks in the glib stuff, it just doesn't mix well (performance wise) with all the allocations glib does to generate the GVariant objects, but that's not Valgrind's fault :-)
I'll send it to Coverity a bit later |
/** Maximum amount of unimportant exceptions for one method; if reached | ||
* testing continues with a next method */ | ||
#define MAX_EXCEPTIONS 10 | ||
#define MAX_EXCEPTIONS 50 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to prevent Thaw
from really being run 1000 times. It should probably be configurable as well or maybe it should be dropped altogether. I'm not sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just looking into it, let me prep a PR which drops it altogether, so we can give it a try.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
" -y --min-iterations=ITER Minimum number of iterations done for each method.\n" | ||
" Default: 10 iterations; minimum: 1 iteration.\n" | ||
" -I --iterations=ITER Set both the minimum and maximum number of iterations to ITER\n" | ||
" See --max-iterations= and --min-iterations= above\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The man page should have probably been updated as well. I completely forgot it's there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's something I want to do as well, but completely forgot, mainly because writing something directly in troff is quite painful. But I'll update it as part of #71.
@mrc0mmand looks like method names are no longer included in log files:
turned into
It kind of broke |
This got accidentally omitted during the latest rewrite. Addresses: https://github.com/matusmarhefka/dfuzzer/pull/64#issuecomment-1120242055
very much WIP