Using define in syzcall description

82 views
Skip to first unread message

funkii

unread,
Jan 31, 2022, 1:23:31 PM1/31/22
to syzkaller
Hi,
I'm trying to fuzz a kernel module using syzkaller following this guide  https://github.com/google/syzkaller/blob/master/docs/syscall_descriptions_syntax.md
I want to use define inside the description file, but syzkaller throws a error after running make extract.
The define in the original header file looks like this:

#define CREATE_E _IOR(MAGIC_NUMBER, 0x00, struct xy)

The struct xy is already in the description file, I parsed it using headerparser.

All my attempts led to this error message:
dev_mymodule.txt: CREATE_E is unsupported on all arches (typo?)

How can I define this inside the syscall description file file using syzlang?

I'd be very thankful for any help.
Cheers

Aleksandr Nogikh

unread,
Jan 31, 2022, 1:39:23 PM1/31/22
to funkii, syzkaller
Hi,

> The struct xy is already in the description file, I parsed it using headerparser.

For `make extract` this really makes no difference, that tool just
generates C files that include all the specified headers and that
mention the required constants, then compiles those files and extracts
const values from the resulting executables. If compilation fails, the
tools disables some of the constants and then tries again.

So it seems that it just did not manage to compile a program with the
CREATE_E constant and so skipped it. With so few details it's
impossible to say why.
Just in case - did you add all the necessary includes to the description file?

You can also try to add some debug info to this code and see how
exactly the compilation fails, this may give you a hint at what the
actual problem is.
https://github.com/google/syzkaller/blob/master/sys/syz-extract/fetch.go#L56

--
Best Regards,
Aleksandr
> --
> You received this message because you are subscribed to the Google Groups "syzkaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller/db236a76-a5a5-43cc-b256-8199c8a1e9efn%40googlegroups.com.

funkii

unread,
Feb 1, 2022, 5:50:11 AM2/1/22
to syzkaller
Hi,
thanks for your fast answer. I fixed the problem. I guess my fault was trying to reference the struct xy that I added to the description file in the define.
If I use the define like `define CREATE_E _IOR(Magic_nr, 0x00, struct{int id; int id2;})` and not like `CREATE_E _IOR(Magic_nr, 0x00, struct xy)` it works.

Thank you!

Reply all
Reply to author
Forward
0 new messages