Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1246831ybh; Sat, 7 Mar 2020 22:54:27 -0800 (PST) X-Google-Smtp-Source: ADFU+vujsUNWCgYBs4GFNK/jH7z0ynJnkWYCtRxgyb9ybGKItmowfoUuD1ZVGD6/i3XKrwcMJr5O X-Received: by 2002:aca:b03:: with SMTP id 3mr7851053oil.1.1583650467412; Sat, 07 Mar 2020 22:54:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583650467; cv=none; d=google.com; s=arc-20160816; b=EgLZUIu55HuPK7p588oqRa7X6ybwAfAcsngXn0vbBUlbFBDttXfAC+z3TBMJ62Q3om RhtWkMuaCtI0YbKar7rf51hJFQZSar7lXO/nWAVxDm9W3mOMM+APIymYKNAlSKA46ckz W0QxGliOVG+1MVNDTYNqotl33SR05/tUk7/7Al3Yiq6dCYeQLVE0PwfOXezscpz4tzEK t9IEXF30TQSdcLhSe2t9cvog5qHYWCcGBwJxS042H+KBuvIEjxQSUMMlFbMFu/ZHVvx4 LddykcVngg9BpNj5dU3C2CBGnKPtKQhzwT8xGYGTMFPmgTg05cMaKZAa3ZM0bz+pchgI bMRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=if1EPweZx4wgDDVIslqJNPb7s9mzDNxLL1bRGsddID8=; b=mX6jHRFMagnhu8WEjRce1zRAZrlLsNHV0gk15gWUdrg+Cg165euTO653ZmPKUXLSUS +Y1I7oRSCHax4HitQ5msUgTLJMwT4yGsx/X6gDFX0RayDL45ZVQb0hw/4zqG3g2paiSz anwEB0fGCnw5OY8HgbJlb3IfZCcJtD9qbQkNFpPXGpQYIhTeeE2molMDaXO8JcQqulv5 jAJn3ImCErZUvaea/5Y3p/vQeENgpp5HjwHBHB95F0/S3jTndlGyKp0BfKZTpVy2Tp40 FhBOTWgu/ugHjFDJP6srdy8SfB8NeJuzK+joKtngL5RgRNLalUZbtUgHUtaQDFuVbICA 5QEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="pJ7Ma/y7"; 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 f6si4689116otq.50.2020.03.07.22.54.16; Sat, 07 Mar 2020 22:54:27 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b="pJ7Ma/y7"; 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 S1726266AbgCHGxD (ORCPT + 99 others); Sun, 8 Mar 2020 01:53:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:60166 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725992AbgCHGxD (ORCPT ); Sun, 8 Mar 2020 01:53:03 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5CC8920828; Sun, 8 Mar 2020 06:53:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583650382; bh=hBDQFgPtphwwSawhrbt7C7AkzAT18PpDYg22vxfvIAQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pJ7Ma/y7bJJ6Y2DrIql2rks56aF+JKzf7WAiUVdvSNlbJm1GniWdEuxlCuqixFiXN fi56OmdZPmgXmU3LZEbHfIESZx3JwbLBHHAMf4zx1tX13CwUTm3roMX5qKnxcRAmeh /i6rcWPH0nKZXSEOQsYpujnVKrXQkOwRz/sD0lLE= Date: Sun, 8 Mar 2020 07:52:58 +0100 From: Greg Kroah-Hartman To: Jiri Slaby 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 Subject: Re: [PATCH v2] Add kernel config option for fuzz testing. Message-ID: <20200308065258.GE3983392@kroah.com> References: <20200307135822.3894-1-penguin-kernel@I-love.SAKURA.ne.jp> <6f2e27de-c820-7de3-447d-cd9f7c650add@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6f2e27de-c820-7de3-447d-cd9f7c650add@suse.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. thanks, greg k-h