Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2580007ybh; Mon, 9 Mar 2020 08:42:14 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtH2sYfxDfajoRDHme5yPMbvRL5RtJ3EQY3UAKZo7d5WUA7T40M02GZk+1Djl9XH4ZRxc59 X-Received: by 2002:a05:6808:14b:: with SMTP id h11mr11267201oie.118.1583768533954; Mon, 09 Mar 2020 08:42:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583768533; cv=none; d=google.com; s=arc-20160816; b=ds5zBwrISxO+nvCo2yxow/hARAoUv8zWI9eSiaZP+z/qH41CCwqeSVrLskoLUng1Ko 7yU8jxfHpN/RKz8f6hr4sjdJBP+QEBrQDN0OSyuwPY2j+1eJmmZq2pjlgYRO0HTNUjKi MNEs4dzlZ1kKyzTgEiMgWZSZlJzP8REHwn/bLl1kUCBySItXMJ15MqLc85i1qSp5FQXP is8u0uBO0KNQGGX8pwQmpKeBQ3BmDKsXDMRkbc1puxXxBmTDO9mnpF5Z2PprBzhjXVWw rM/3fBGtFecud7QCm9Ps5Zy9d+30bwcPWoyspS35BePLoL3r1LLFbLEBDtD2yA279zKp y4Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject; bh=GDE/7BbnQ7IForlFYSvnjh+5CK2BxRo7x2gr95keouw=; b=XzKz19rfevx1CZT/0/LVEZK8KNT9zppXL8HCkQJeKtKcIpI/ZSFffQ+fwoJHKeTOrE KYp+ceeZxX1OjIoQkvTlc0PDlzAykorty/f6LAOfaA8ocVTGceMbJnxUFJAeTIJ6Ul6a +De3b4Vd1q0Bo9luLmHqnzTA9OD6N3XolaJoDGR+0F/Zp7rdaCFC78POAvr4V3MJP71z smHIvrVTNkf2YoTbv+n2kYU7MCp372vMSET0g+ThACxw8Qxt3L8Aw3omkAi9soZul1Uf 3cuG40TZHCDahPjdJucVQ80EM9pSYfHLFcbAy9p4yrikDYKjpTF2Sq4KFNL2h5DlMEqQ IjDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k17si3695985oij.141.2020.03.09.08.42.01; Mon, 09 Mar 2020 08:42:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727030AbgCIPjx (ORCPT + 99 others); Mon, 9 Mar 2020 11:39:53 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:36911 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726776AbgCIPjx (ORCPT ); Mon, 9 Mar 2020 11:39:53 -0400 Received: by mail-wr1-f65.google.com with SMTP id 6so11802980wre.4 for ; Mon, 09 Mar 2020 08:39:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=GDE/7BbnQ7IForlFYSvnjh+5CK2BxRo7x2gr95keouw=; b=RoqTp4tR/lOJyOwAxWHLG/I/FlEllfwTVnOuC20XLgIaV58HvMECe6cPoZD4TBKjw4 HwsNNX6H06PMFp8MzHErMZIlEOPhzbk3swvOZDqm0aEjOChhFgxQEphYpyJL1SvO5YEA qgIKoWapQmlXQ/dhAbeVDjtP8gfNNS4kOaiu7vD8KFOFizBMY9j2tXOpvvSR3M2hDnSj ka93DOdBRZLo/yZFL6Fs5SeGkN6HRwE2uW3URXQ9/1YBrzR5c+olm3dkpPkqyQdorMU9 n6b9saa1ztjEi5IE2X0GhpDL2ge0e/FtBw0O0mjD9ZlaxvmK+Xr+NrXDV1jdVPmgH3sB 2qXA== X-Gm-Message-State: ANhLgQ3bv1Gi9RdJiNgulkuYpZLAi5IDHCodkClDFMsTRGw5Ew9+yojX Nxhn78I3nfPp7BQYBu5kLSc= X-Received: by 2002:a5d:522c:: with SMTP id i12mr2206532wra.176.1583768390122; Mon, 09 Mar 2020 08:39:50 -0700 (PDT) Received: from ?IPv6:2a0b:e7c0:0:107::49? ([2a0b:e7c0:0:107::49]) by smtp.gmail.com with ESMTPSA id k12sm1994759wrv.88.2020.03.09.08.39.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Mar 2020 08:39:49 -0700 (PDT) Subject: Re: [PATCH v2] Add kernel config option for fuzz testing. To: Greg Kroah-Hartman Cc: Tetsuo Handa , Andrew Morton , Matthew Garrett , Andi Kleen , "Theodore Y . Ts'o" , Alexander Viro , Petr Mladek , Sergey Senozhatsky , Arnd Bergmann , Steven Rostedt , Linus Torvalds , LKML , Dmitry Vyukov References: <20200307135822.3894-1-penguin-kernel@I-love.SAKURA.ne.jp> <6f2e27de-c820-7de3-447d-cd9f7c650add@suse.com> <20200308065258.GE3983392@kroah.com> From: Jiri Slaby Autocrypt: addr=jslaby@suse.com; prefer-encrypt=mutual; keydata= mQINBE6S54YBEACzzjLwDUbU5elY4GTg/NdotjA0jyyJtYI86wdKraekbNE0bC4zV+ryvH4j rrcDwGs6tFVrAHvdHeIdI07s1iIx5R/ndcHwt4fvI8CL5PzPmn5J+h0WERR5rFprRh6axhOk rSD5CwQl19fm4AJCS6A9GJtOoiLpWn2/IbogPc71jQVrupZYYx51rAaHZ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S1ppYqQCOSQYBPuYPVDk+IuvTpj/4rN2v3R5RW d6ozZNRBBsr4qHsnCYZWtEY2pCsOT6BE28qcbAU15ORMq0nQ/yNh3s/WBlv0XCP1gvGOGf+x UiE2YQEsGgjs8v719sguok8eADBbfmumerh/8RhPKRuTWxrXdNq/pu0n7hA6Btx7NYjBnnD8 lV8Qlb0lencEUBXNFDmdWussMAlnxjmKhZyb30m1IgjFfG30UloZzUGCyLkr/53JMovAswmC IHNtXHwb58Ikn1i2U049aFso+WtDz4BjnYBqCL1Y2F7pd8l2HmDqm2I4gubffSaRHiBbqcSB lXIjJOrd6Q66u5+1Yv32qk/nOL542syYtFDH2J5wM2AWvfjZH1tMOVvVMu5Fv7+0n3x/9shY ivRypCapDfcWBGGsbX5eaXpRfInaMTGaU7wmWO44Z5diHpmQgTLOrN9/MEtdkK6OVhAMVenI w1UnZnA+ZfaZYShi5oFTQk3vAz7/NaA5/bNHCES4PcDZw7Y/GiIh/JQR8H1JKZ99or9LjFeg HrC8YQ1nzkeDfsLtYM11oC3peHa5AiXLmCuSC9ammQ3LhkfET6N42xTu2A== Message-ID: <3e9f47f7-a6c1-7cec-a84f-e621ae5426be@suse.com> Date: Mon, 9 Mar 2020 16:39:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200308065258.GE3983392@kroah.com> Content-Type: text/plain; charset=iso-8859-2 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08. 03. 20, 7:52, Greg Kroah-Hartman wrote: > On Sat, Mar 07, 2020 at 05:28:22PM +0100, Jiri Slaby wrote: >> On 07. 03. 20, 14:58, Tetsuo Handa wrote: >>> While syzkaller is finding many bugs, sometimes syzkaller examines >>> stupid operations. Currently we prevent syzkaller from examining >>> stupid operations by blacklisting syscall arguments and/or disabling >>> whole functionality using existing kernel config options, but it is >>> a whack-a-mole approach. We need cooperation from kernel side [1]. >>> >>> This patch introduces a kernel config option which allows disabling >>> only specific operations. This kernel config option should be enabled >>> only when building kernels for fuzz testing. >>> >>> We discussed possibility of disabling specific operations at run-time >>> using some lockdown mechanism [2], but conclusion seems that build-time >>> control (i.e. kernel config option) fits better for this purpose. >>> Since patches for users of this kernel config option will want a lot of >>> explanation [3], this patch provides only kernel config option for them. >>> >>> [1] https://github.com/google/syzkaller/issues/1622 >>> [2] https://lkml.kernel.org/r/CACdnJutc7OQeoor6WLTh8as10da_CN=crs79v3Fp0mJTaO=+yw@mail.gmail.com >>> [3] https://lkml.kernel.org/r/20191216163155.GB2258618@kroah.com >>> >>> Signed-off-by: Tetsuo Handa >>> Cc: Dmitry Vyukov >>> --- >>> lib/Kconfig.debug | 10 ++++++++++ >>> 1 file changed, 10 insertions(+) >>> >>> Changes since v1: >>> Drop users of this kernel config option. >>> Update patch description. >>> >>> diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug >>> index 53e786e0a604..e360090e24c5 100644 >>> --- a/lib/Kconfig.debug >>> +++ b/lib/Kconfig.debug >>> @@ -2208,4 +2208,14 @@ config HYPERV_TESTING >>> >>> endmenu # "Kernel Testing and Coverage" >>> >>> +config KERNEL_BUILT_FOR_FUZZ_TESTING >>> + bool "Build kernel for fuzz testing" >> >> If we really want to go this way, I wouldn't limit it for fuzz testing >> only. Static analyzers, symbolic executors, formal verifiers, etc. -- >> all of them should avoid the paths. > > No, anything that just evaluates the code should be fine, we want static > analyzers to be processing those code paths. Just not to run them as > root on a live system. Even static analyzers generate real-world counter-examples in .c. They are ran dynamically to check if the issue is real or if it's only a shortcoming of static analysis. Klee is one of those and I used to run it on the kernel some time ago. Throwing such generated input results in the same weird behavior as using fuzzy testing, while it's still not fuzzy testing, but accurate testing. thanks, -- js suse labs