From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: + twist-allow-disabling-k_spec-function-in-drivers-tty-vt-keyboardc.patch added to -mm tree Date: Thu, 23 Apr 2020 20:24:15 -0700 Message-ID: <20200424032415.rtFREkYj6%akpm@linux-foundation.org> References: <20200420181310.c18b3c0aa4dc5b3e5ec1be10@linux-foundation.org> Reply-To: linux-kernel@vger.kernel.org Return-path: Received: from mail.kernel.org ([198.145.29.99]:38530 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725884AbgDXDYR (ORCPT ); Thu, 23 Apr 2020 23:24:17 -0400 In-Reply-To: <20200420181310.c18b3c0aa4dc5b3e5ec1be10@linux-foundation.org> Sender: mm-commits-owner@vger.kernel.org List-Id: mm-commits@vger.kernel.org To: ak@linux.intel.com, arnd@arndb.de, dvyukov@google.com, gregkh@linuxfoundation.org, jslaby@suse.com, mjg59@google.com, mm-commits@vger.kernel.org, penguin-kernel@I-love.SAKURA.ne.jp, peterz@infradead.org, pmladek@suse.com, rostedt@goodmis.org, sergey.senozhatsky@gmail.com, tytso@mit.edu, viro@zeniv.linux.org.uk The patch titled Subject: twist: allow disabling k_spec() function in drivers/tty/vt/keyboard.c has been added to the -mm tree. Its filename is twist-allow-disabling-k_spec-function-in-drivers-tty-vt-keyboardc.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/twist-allow-disabling-k_spec-function-in-drivers-tty-vt-keyboardc.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/twist-allow-disabling-k_spec-function-in-drivers-tty-vt-keyboardc.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Tetsuo Handa Subject: twist: allow disabling k_spec() function in drivers/tty/vt/keyboard.c syzbot is reporting unexpected kernel reboots [1]. This seems to be caused by triggering Ctrl-Alt-Del event via k_spec() function in drivers/tty/vt/keyboard.c file, for the console output includes normal restart sequence. [ 97.727327][ T1] systemd-shutdown[1]: Unmounting file systems. [ 97.734278][ T1] systemd-shutdown[1]: Remounting '/' read-only with options ''. [ 97.747758][ T21] usb 2-1: device descriptor read/8, error -71 [ 97.747850][ T3116] usb 1-1: device descriptor read/8, error -71 [ 97.764818][ T1] EXT4-fs (sda1): re-mounted. Opts: [ 97.777551][ T1] systemd-shutdown[1]: Remounting '/' read-only with options ''. [ 97.785448][ T1] EXT4-fs (sda1): re-mounted. Opts: [ 97.790920][ T1] systemd-shutdown[1]: All filesystems unmounted. [ 97.797352][ T1] systemd-shutdown[1]: Deactivating swaps. [ 97.803451][ T1] systemd-shutdown[1]: All swaps deactivated. [ 97.809626][ T1] systemd-shutdown[1]: Detaching loop devices. [ 97.890294][ T1] systemd-shutdown[1]: All loop devices detached. [ 98.967832][ T3116] usb 1-1: device descriptor read/8, error -71 [ 100.108406][ T1] sd 0:0:1:0: [sda] Synchronizing SCSI cache [ 100.116036][ T1] reboot: Restarting system [ 100.120636][ T1] reboot: machine restart SeaBIOS (version 1.8.2-20200402_173431-google) Total RAM Size = 0x00000001e0000000 = 7680 MiB CPUs found: 2 Max CPUs supported: 2 Comparing RSDP and RSDP Therefore, allow disabling only k_spec() function in order to allow fuzzers to examine the remaining part in that file. [1] https://syzkaller.appspot.com/bug?id=321861b1588b44d064b779b92293c5d55cfe8430 Link: http://lkml.kernel.org/r/20200421131951.4948-2-penguin-kernel@I-love.SAKURA.ne.jp Signed-off-by: Tetsuo Handa Cc: Alexander Viro Cc: Andi Kleen Cc: Arnd Bergmann Cc: Dmitry Vyukov Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: Matthew Garrett Cc: Peter Zijlstra Cc: Petr Mladek Cc: Sergey Senozhatsky Cc: Steven Rostedt Cc: "Theodore Y . Ts'o" Signed-off-by: Andrew Morton --- drivers/tty/vt/keyboard.c | 2 ++ lib/Kconfig.twist | 7 +++++++ 2 files changed, 9 insertions(+) --- a/drivers/tty/vt/keyboard.c~twist-allow-disabling-k_spec-function-in-drivers-tty-vt-keyboardc +++ a/drivers/tty/vt/keyboard.c @@ -633,6 +633,8 @@ static void k_spec(struct vc_data *vc, u kbd->kbdmode == VC_OFF) && value != KVAL(K_SAK)) return; /* SAK is allowed even in raw mode */ + if (IS_ENABLED(CONFIG_TWIST_DISABLE_KBD_K_SPEC_HANDLER)) + return; fn_handler[value](vc); } --- a/lib/Kconfig.twist~twist-allow-disabling-k_spec-function-in-drivers-tty-vt-keyboardc +++ a/lib/Kconfig.twist @@ -10,4 +10,11 @@ menuconfig TWIST_KERNEL_BEHAVIOR if TWIST_KERNEL_BEHAVIOR +config TWIST_DISABLE_KBD_K_SPEC_HANDLER + bool "Disable k_spec() function in drivers/tty/vt/keyboard.c" + help + k_spec() function allows triggering e.g. Ctrl-Alt-Del event. + Such event is annoying for fuzz testing which wants to test + kernel code without rebooting the system. + endif # TWIST_KERNEL_BEHAVIOR _ Patches currently in -mm which might be from penguin-kernel@I-love.SAKURA.ne.jp are info-task-hung-in-generic_file_write_iter.patch info-task-hung-in-generic_file_write-fix.patch add-kernel-config-option-for-twisting-kernel-behavior.patch twist-allow-disabling-k_spec-function-in-drivers-tty-vt-keyboardc.patch twist-add-option-for-selecting-twist-options-for-syzkallers-testing.patch