Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp316202rdh; Thu, 23 Nov 2023 05:02:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IEyNmL04rNN6ZtPsKJ1BIs8LpR8H0DWA8KYxGMmz4Gf30Hdiyp0ufAUD7ODLgXiCduQkIZl X-Received: by 2002:a05:6871:4188:b0:1f5:c6f9:b76d with SMTP id lc8-20020a056871418800b001f5c6f9b76dmr6713132oab.49.1700744524163; Thu, 23 Nov 2023 05:02:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700744524; cv=none; d=google.com; s=arc-20160816; b=c0CZy9yRDhabn4yDpYFEmAsYiybZNo6r5rbP4NwuUs4CfP2IjwGXfG+bQdfqQq0WOH 1j6FhB8vOxrfLIS6K4wRKyTFpgSUF4f9RQKiey2/JxYl3BJGsZ0Sg4mDhyNu3od7tHKC NIQLTvdbdXoTFp8ju8vet5H5p3tfRuVcORPYZhsm8aokikGK1mHnHXRr13kSXunsosL+ WWC8JFypqkOOha+EizWM5gcQTaUt+368mi7hz/HfkFyVfkK1X/1Mg9CRnTHZrfcstO7X xj3QQ7q7qS/QuVpl0J0uNMNYjuVaahDoZud1Wp8Dd/0MOPQYMPFNHsNEGXCMSvz8h8yS OFmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=MdrVWYpeMLLan9XzLldkaOs9Yy4nhd18byFDpb1aZHs=; fh=DFMi30PyWpgG/2UwKcC19sutdUg/IWnNKM/Ml7jcI+U=; b=ZV9NgvEQE6BZFG4UYFNCKZVzF+ixPc0XmKDYvsqVI7c+U5lKTd9bbGCI6GakFUpNZ8 gVFNngp+alH1ifteQaDx9s0J6jWK//C9e/5p0oVH5E/e3J5yImDSHUJfiaGkSzi4nwje I2TGZznLdOAlbtA04ElK2LAFwaPhLv1E+PHJDHbopMKw3V0WyaGLSpWEpfyguzeGluE/ AwATddyJCl51JqL6XCaVdU9AuYLbsxvwNPZMq9IrktUEg2npcQBwE6tOlGrYHBKkDnEg gheUjaaKd0JghhLtU/+7m/uw6T6hAqLXWzp2uWvQD+PEKOOuvuOePMqQ3i+0VLm9BX74 o2hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LayZ13Sf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id w14-20020a056870a2ce00b001f96d7a766csi466677oak.183.2023.11.23.05.01.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 05:02:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LayZ13Sf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 2C116804393B; Thu, 23 Nov 2023 05:01:58 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345384AbjKWNBr (ORCPT + 99 others); Thu, 23 Nov 2023 08:01:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345271AbjKWNBq (ORCPT ); Thu, 23 Nov 2023 08:01:46 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57CBD9E for ; Thu, 23 Nov 2023 05:01:53 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4233BC433C8; Thu, 23 Nov 2023 13:01:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1700744513; bh=xIAMhuapJVQQBjY6+y+mVTC4wodPKLPUym8Oy9dNMIc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LayZ13SfX5yYFn7u+DOBREPibRs5rznBZ2ADm190tgXMZhfAVrBEhDBe9OrTOdNHF mzXHIfc0IqapnZFNymtQOqlZcHEjn3FLTsLGNtIbj4+DJ7MT1nXe5w+L7tRz0kz6e7 nvsqWT8xIJyDH3mdMC1jXNjNR8JDFRyNwPi8EDLk= Date: Thu, 23 Nov 2023 12:54:25 +0000 From: "gregkh@linuxfoundation.org" To: Aleksandr Nogikh Cc: xingwei lee , "syzbot+786b124fe4ce4dc99357@syzkaller.appspotmail.com" , "linux-kernel@vger.kernel.org" , "rafael@kernel.org" , "syzkaller-bugs@googlegroups.com" , Dmitry Vyukov , Alexander Potapenko , Akinobu Mita Subject: Re: [syzbot] [kernel?] general protection fault in joydev_connect Message-ID: <2023112308-manhandle-defection-c551@gregkh> References: <2023112332-award-fanciness-2bcf@gregkh> <2023112306-diner-jawline-c7dc@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 23 Nov 2023 05:01:58 -0800 (PST) On Thu, Nov 23, 2023 at 01:42:26PM +0100, Aleksandr Nogikh wrote: > On Thu, Nov 23, 2023 at 10:41 AM gregkh@linuxfoundation.org > wrote: > > > > On Thu, Nov 23, 2023 at 10:32:26AM +0100, Aleksandr Nogikh wrote: > > > On Thu, Nov 23, 2023 at 9:55 AM gregkh@linuxfoundation.org > > > wrote: > > > > > > > > On Wed, Nov 22, 2023 at 07:55:50PM +0800, xingwei lee wrote: > > > > > Hi. I have reproduced this bug with repro.txt and repro.c below: > > > > > > > > > > repro.txt > > > > > r0 = openat$uinput(0xffffffffffffff9c, &(0x7f0000000500), 0x802, 0x0) > > > > > ioctl$UI_DEV_SETUP(r0, 0x405c5503, &(0x7f0000000080)={{0x0, 0xffff, > > > > > 0x3}, 'syz0\x00'}) > > > > > ioctl$UI_DEV_CREATE(r0, 0x5501) (fail_nth: 51) > > > > > > > > You are using fault injection, which, by it's very name, causes faults :) > > > > > > But those injected failures (that do not break the kernel, but just > > > emulate an error returned from a function that should be expected to > > > sometimes return an error) still should not lead to general protection > > > fault panics, shouldn't they? > > > > It all depends on what exactly the fault is happening for. Some > > allocations in the kernel just "will not fail ever" so when you add > > fault injection testing, you are doing things that really can not ever > > happen. > > Just in case - are you aware of any specific examples where fault > injection injects failures that should never ever happen? Yes, many places, it's come up in the past, but I can't find the specifics as some of us get 1000+ emails a day :) Search the archives? > All > automatic kernel testing would benefit by making it not do this then. I agree, so take a look at the allocation paths and see the ones that just can not fail and then do not cause a fault on them? As an example, any "small" allocation that can be done in a way that can sleep (i.e. GFP_KERNEL) will never fail, right? So don't add failures there. Or any allocation at boot time, that's never going to fail as there's no memory pressure yet. Look at the system and make smart faults, don't just blindly go poking at things and expect it all to work. good luck! greg k-h