Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp472563ybg; Wed, 3 Jun 2020 05:46:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwed89qIEpdhH7pKDc03pL+WYkAiDpNBrNAcLCMrq6DS6veVcLqZQfSEy4bMMjLJTdX3IP6 X-Received: by 2002:aa7:da8c:: with SMTP id q12mr9976084eds.385.1591188385794; Wed, 03 Jun 2020 05:46:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591188385; cv=none; d=google.com; s=arc-20160816; b=VSUmfFRf09FNu462/Ma5+BBZbiKxhFgRbjCTbA5/wSQfDRnLhYsanPjkmvDE6CDxfN qcdtShTZXgtAloENeQA8tr5ibBHbfOJHOlO/Lsn11YotRvY1phoMq7X1vn6N5yWFBd66 BktM7MZXSfy7e83L2RUJ5zD6DkW4GmN9CuBfB5maz+5OBcCZNYRL3wxLhJk/TbwiOiIF VZJWs6Dd9Y9nBx4og1yg3OcJ7Mx7iTEUl4wLJj+1sD0N2QufreTuXox3jJxaPaIb+JGv dm5DLaXZ8DS25VlnDm3NE5H1yX6IsPGCjfb+CrGG4r1mNZS/uHSYoxb4WtLsZnjHBd3E De5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=VOdlfAi47BX0VEfy+eN1DKpp7bWdS9AfT0Gk5R26zOo=; b=n4aQfFuIlhrNawA/pVu++NCAa49HKiQiVrscv1f7/PB8QGrlEV0LvNU9sZ5FsfI30B uZ+dLUnIUZgZVlgVob/6RxHS353okylGDY8aEMXDzOVQxuSoeVKm9QZx68HrC6ctWIwb UaOSItilfNI8n3fPRPYLEZBz65SK5QPkHPkNsmVg/TMV86KrPHWJJL1QkKohOO7fatRN UT17TtUdrNNKoBjQWrYBOJD8ZtN73WLRr0qQ8Wummc3/l1K+Bp81HeXu1Nc2D5B6LdsP Mb0QKse/QSh0z11W6vtXPZ/TOLuKFDYaJRXpMks1x6EGeAWcSk6AUHgpyWSM7JqhnHiF tx9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dk3si1053066edb.580.2020.06.03.05.46.02; Wed, 03 Jun 2020 05:46:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725981AbgFCMoJ (ORCPT + 99 others); Wed, 3 Jun 2020 08:44:09 -0400 Received: from mx2.suse.de ([195.135.220.15]:45058 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725881AbgFCMoJ (ORCPT ); Wed, 3 Jun 2020 08:44:09 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 195EDAE96; Wed, 3 Jun 2020 12:44:10 +0000 (UTC) Date: Wed, 3 Jun 2020 14:44:05 +0200 From: Petr Mladek To: Tetsuo Handa Cc: Dmitry Vyukov , syzkaller , Linus Torvalds , Andrew Morton , Linux Kernel Mailing List , Ondrej Mosnacek , Sergey Senozhatsky , Steven Rostedt Subject: Re: twist: allow disabling reboot request Message-ID: <20200603124405.GA22497@linux-b0ei> References: <13b0a475-e70e-c490-d34d-0c7a34facf7c@i-love.sakura.ne.jp> <6116ed2e-cee1-d82f-6b68-ddb1bbb6abe2@i-love.sakura.ne.jp> <19d377d3-8037-8090-0f99-447f72cc1d8c@i-love.sakura.ne.jp> <38df9737-3c04-dca2-0df4-115a9c1634e5@i-love.sakura.ne.jp> <51eaa6cd-33ce-f9d8-942c-c797c0ec6733@i-love.sakura.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51eaa6cd-33ce-f9d8-942c-c797c0ec6733@i-love.sakura.ne.jp> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 2020-06-03 20:03:28, Tetsuo Handa wrote: > On 2020/05/29 22:26, Tetsuo Handa wrote: > > By the way, I do worry that people forget to perform these steps when they do > > their tests without asking syzbot... > > Here is a draft of boot-time switching. Since kconfig can handle string variable up to > 2048 characters, we could hold the content of the "your-config" file inside .config file > in order to avoid relying on external file in "syzkaller tree". But since only one kconfig > option is used, basically the way to temporarily include/exclude specific options (under > automated testing by syzbot) seems to remain directly patching apply_twist_flags(), for > https://github.com/google/syzkaller/blob/master/dashboard/config/util.sh will automatically > overwrite CONFIG_DEFAULT_TWIST_FLAGS settings. If each twist flag were using independent > kconfig option, the way to temporarily include/exclude specific options will become directly > patching Kconfig file. > > diff --git a/include/linux/kernel.h b/include/linux/kernel.h > index 82d91547d122..78fdbb4f17b1 100644 > --- a/include/linux/kernel.h > +++ b/include/linux/kernel.h > @@ -1038,4 +1038,12 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { } > /* OTHER_WRITABLE? Generally considered a bad idea. */ \ > BUILD_BUG_ON_ZERO((perms) & 2) + \ > (perms)) > + > +/* Flags for twisting kernel behavior. */ > +struct twist_flags { > + bool disable_kbd_k_spec_handler; > + bool disable_reboot_request; > +}; > +extern struct twist_flags twist_flags; Why all these options have to be in a single structure? > diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug > index 498d344ea53a..41cfabc74ad7 100644 > --- a/lib/Kconfig.debug > +++ b/lib/Kconfig.debug > @@ -2338,4 +2338,9 @@ config HYPERV_TESTING > > endmenu # "Kernel Testing and Coverage" > > +menuconfig DEFAULT_TWIST_FLAGS > + string "Default twist options (DANGEROUS)" > + help > + Don't specify anything unless you know what you are doing. > + > endmenu # Kernel hacking Why such a crazy build configure option? I think that the only way to get this upstream is to: + Add separate boot options that might theoretically be used also by other people. + Use boot parameters and not build configuration. + Avoid the meaningless word "twist" !!! Best Regards, Petr