Open xairy opened 4 years ago
Is there any simple way to prevent this? Turn off some config?
I don't see one. We could disable CONFIG_VT
, but that will affect fuzzing of virtual terminals.
This may be another candidate for the "fuzzing lockdown" feature that Tetsuo proposed on kernel mailing lists. I think we need to start collecting all these cases in a single issue, they are spread across random mailing lists.
Let's re-purpose this as a broader issues since we don't have a simple solution anyway.
Amusingly this was already discovered before and forgotten. You may see this patch from Tetsuo mentions k_spec: https://lkml.org/lkml/2019/12/16/212
@xairy Initial patches for this purpose arrived at linux-next-20200428 . Please add CONFIG_TWIST_KERNEL_BEHAVIOR=y and CONFIG_TWIST_FOR_SYZKALLER_TESTING=y to your kernel config, and let's check whether the frequency of "unexpected kernel reboot (3)" and "lost connection to test machine (5)" on linux-next is reduced.
A number of cases come up over time where we crash/reboot/corrupt kernel, but it's working-as-intended and it's hard/impossible to filter out such cases statically. The idea is to introduce a "fuzzing lockdown" config that will very selectively disable these bits of kernel logic. Originally proposed by Tetsuo Handa. A proposed patch and a discussion: https://lkml.org/lkml/2019/12/16/212 A lengthy discussion on kernel mailing lists: https://lore.kernel.org/lkml/20190825104858.GA119494@gmail.com/T/ Another one: https://groups.google.com/d/msg/syzkaller-bugs/1rVENJf9P4U/QtGpapRxAgAJ
Here is list of concrete cases:
k_spec()->fn_boot_it()->ctrl_alt_del()
indrivers/tty/vt/keyboard.c
can trigger a kernel reboot (detected aslost connection to test machine
). Can be reached over a USB connected tty and presumably usingevdev
as well.audit_panic
). syzbot bug and context.serial_port_out_sync
). Context is lost, but it's mentioned in the patch.