Arch specific IOCTLs in syzkaller descriptions

261 views
Skip to first unread message

Vikram Narayanan

unread,
Oct 18, 2021, 3:30:25 PM10/18/21
to syzkaller
Hi,
I am trying to add syzkaller descriptions for msr driver (arch/x86/kernel/msr.c). I was able to add read/write syscalls. However, when adding an IOCTL such as the one below
```
ioctl$X86_IOC_RDMSR_REGS(fd fd_msr, cmd const[X86_IOC_RDMSR_REGS], arg ptr[in, array[int64, 8]])
```
and invoking `make generate` makes `syz-sysgen` unhappy with this error message

```
make descriptions
go list -f '{{.Stale}}' ./sys/syz-sysgen | grep -q false || go install ./sys/syz-sysgen
make .descriptions
bin/syz-sysgen
syscall ioctl$X86_IOC_RDMSR_REGS is unsupported on all arches (typo?)
```

I did look at this thread (https://groups.google.com/g/syzkaller/c/L1PahDEPF0Q/m/_cfC3YObCAAJ) which talks about arch specific IOCTLs implemented in dev_kvm.txt. Even though some of the IOCTLs are arch specific, they seem to be defined in a common header: https://elixir.bootlin.com/linux/v5.15-rc6/source/include/uapi/linux/kvm.h#L1540

In case of msr driver, it is defined in an arch specific header https://elixir.bootlin.com/linux/v5.15-rc6/source/arch/x86/include/uapi/asm/msr.h#L10

I do see a few comments in dev_kvm.txt that says `NEED: arch constraint for syscalls`. Is there a way to specify that an IOCTL is arch-specific?

Thanks,
Vikram

Dmitry Vyukov

unread,
Oct 18, 2021, 3:31:30 PM10/18/21
to Vikram Narayanan, syzkaller
Hi Vikram,

Please send the version you have now as a Pull Request and we will
discuss it on the Pull Request.

Thanks

Vikram Narayanan

unread,
Oct 18, 2021, 3:53:44 PM10/18/21
to syzkaller
Thanks Dmitry. Opened a draft PR : https://github.com/google/syzkaller/pull/2822
Reply all
Reply to author
Forward
0 new messages