From 1170210d9cb103aa346ce7260db1c1819cb3c41f Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 1 Oct 2020 12:12:29 +0200 Subject: tools/create-gce-image.sh: drop rodata=n There is suspicion that the random programs corrupt .text segment: https://groups.google.com/g/syzkaller-bugs/c/d5GC1V8S34k/m/6LTarP8mBAAJ which leads to a number of assorted confusing crashes: https://syzkaller.appspot.com/bug?extid=ce179bc99e64377c24bc Turns out we disable text ro protection with rodata=n. The comment says that's because it's slow with KASAN, but most likely what was slow is actually additional debug checking due to CONFIG_DEBUG_WX. If we don't enable CONFIG_DEBUG_WX (which we don't), rodata itself should be fine and desirable. My experiment with the latest kernel does not show any noticable slowdown without rodata=n: [ 11.985152][ T1] Freeing unused kernel image (initmem) memory: 3432K [ 11.986129][ T1] Write protecting the kernel read-only data: 147456k [ 11.990863][ T1] Freeing unused kernel image (text/rodata gap) memory: 2012K [ 11.992797][ T1] Freeing unused kernel image (rodata/data gap) memory: 1324K [ 11.993895][ T1] Run /sbin/init as init process [ 11.910396][ T1] Freeing unused kernel image (initmem) memory: 3432K [ 11.911277][ T1] Kernel memory protection disabled. [ 11.911984][ T1] Run /sbin/init as init process --- docs/syzbot.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/syzbot.md b/docs/syzbot.md index f0d56e43e..34f568c29 100644 --- a/docs/syzbot.md +++ b/docs/syzbot.md @@ -255,7 +255,7 @@ qemu-system-x86_64 -smp 2 -m 4G -enable-kvm -cpu host \ -device virtio-scsi-pci,id=scsi \ -device scsi-hd,bus=scsi.0,drive=d0 \ -drive file=stretch.img,format=raw,if=none,id=d0 \ - -append "root=/dev/sda console=ttyS0 earlyprintk=serial rodata=n \ + -append "root=/dev/sda console=ttyS0 earlyprintk=serial \ oops=panic panic_on_warn=1 panic=86400 kvm-intel.nested=1 \ security=apparmor ima_policy=tcb workqueue.watchdog_thresh=140 \ nf-conntrack-ftp.ports=20000 nf-conntrack-tftp.ports=20000 \ -- cgit mrf-deployment