From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFAD7C433EF for ; Tue, 7 Jun 2022 07:15:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3100C8D0003; Tue, 7 Jun 2022 03:15:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2BFC68D0002; Tue, 7 Jun 2022 03:15:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1AE3D8D0003; Tue, 7 Jun 2022 03:15:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 0747C8D0002 for ; Tue, 7 Jun 2022 03:15:25 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id CA8A8203B2 for ; Tue, 7 Jun 2022 07:15:24 +0000 (UTC) X-FDA: 79550578968.26.0352433 Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by imf07.hostedemail.com (Postfix) with ESMTP id EB4904004F for ; Tue, 7 Jun 2022 07:15:09 +0000 (UTC) Received: by mail-lf1-f49.google.com with SMTP id be31so26882762lfb.10 for ; Tue, 07 Jun 2022 00:15:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YtcjALjI2RZjsiofJNrRsd8EXD975AiTacZTv5laD3A=; b=f19PMMaVtX+BpJFFtU0Q2VO6fMGbOuJgz1c/nFXb3jADKHD6RE8bc/7KA/pI+rkX00 ybDIVaW11W0wAoniwtNsqCLG/50GCtvMU8/n4twyfDCbZ8cjJRj4a7qRSeyqA1vLLLrZ 7GTNTZmnzfob0R++KIEhuymJltw9rPlWjAm7GHHK8n+bICqn7KRgKh1VAvOdmrIH25rL 226hoidniZOStstv09tB6xTZVHpwYC795Ig5R1HrELOOmPC6MFGVJ0m0tnle7VE2/4oG ejvQQGfLuvOGSSUrsZPjtQ6CM3cdp7Gfd6V8Cg29vyhLqnFbV6fEUQ7p+YYNkjXCc0Xw eEUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YtcjALjI2RZjsiofJNrRsd8EXD975AiTacZTv5laD3A=; b=axReZfZuAzH3r6z+d4EspoaNeohQMofVNaChhREbH4t4ep8+/gcm/5MyrTiZXo3Z/I KuMrtqdAVYN7tpSUwmhKLIlWLJ4cREIqJauKxO3e0dMey7+ASs5jT/VCj9pBcVAeQHw6 zc3JYUb0fKyYLc6SqrA9k7N1V4KFCuOqfwh5m43BqoASW/NLwMnPkKy1BzEtMNQD/EYP f7k6Ec7tqvWFPrcxd60dxfnLurA26NXB8dBnzPuWVEZPI7ABvrs216OlvXoBmOdK8dcb DBZkV5coUX2+OZC3wxilH50bY0Gf+MO+ycXNJj88T9WF508UT9KHNtt1nnKlMFspiuD/ +c8Q== X-Gm-Message-State: AOAM533XZDqMFFSGfHPzfjw78epdr7csqP9zT+tffSAfs0QYIr6cFB7I 05hZ0QZA3bp88duoxj94G5+MKHLqW9sU+X5tEo7CRA== X-Google-Smtp-Source: ABdhPJz4O8/a80YWrP8iHg32QGtqg64ZDJWv3CN+Yh1UTo6DQ30IJZeQhx92HsCuaD0TO7q46mPTTeT7H0VNqwLKbBg= X-Received: by 2002:a05:6512:1085:b0:479:478b:d2cc with SMTP id j5-20020a056512108500b00479478bd2ccmr5934514lfg.540.1654586122236; Tue, 07 Jun 2022 00:15:22 -0700 (PDT) MIME-Version: 1.0 References: <000000000000bb7f1c05da29b601@google.com> <00000000000010b7d305e08837c8@google.com> <20220606123839.GW2146@kadam> In-Reply-To: <20220606123839.GW2146@kadam> From: Dmitry Vyukov Date: Tue, 7 Jun 2022 09:15:09 +0200 Message-ID: Subject: Re: [syzbot] general protection fault in __device_attach To: Dan Carpenter Cc: Greg KH , Alan Stern , Andy Shevchenko , syzbot , hdanton@sina.com, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, rafael.j.wysocki@intel.com, rafael@kernel.org, rjw@rjwysocki.net, syzkaller-bugs@googlegroups.com, linux-usb@vger.kernel.org, Linux-MM Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=f19PMMaV; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf07.hostedemail.com: domain of dvyukov@google.com designates 209.85.167.49 as permitted sender) smtp.mailfrom=dvyukov@google.com X-Stat-Signature: jczsii39gbbsubih7cu4kmy68p4yxhhc X-Rspam-User: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: EB4904004F X-HE-Tag: 1654586109-644129 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, 6 Jun 2022 at 14:39, Dan Carpenter wrote: > > On Sat, Jun 04, 2022 at 10:32:46AM +0200, 'Dmitry Vyukov' via syzkaller-bugs wrote: > > On Fri, 3 Jun 2022 at 18:12, Greg KH wrote: > > > > > > But again, is this a "real and able to be triggered from userspace" > > > problem, or just fault-injection-induced? > > > > Then this is something to fix in the fault injection subsystem. > > Testing systems shouldn't be reporting false positives. > > What allocations cannot fail in real life? Is it <=page_size? > > > > Apparently in 2014, anything less than *EIGHT?!!* pages succeeded! > > https://lwn.net/Articles/627419/ > > I have been on the look out since that article and never seen anyone > mention it changing. I think we should ignore that and say that > anything over PAGE_SIZE can fail. Possibly we could go smaller than > PAGE_SIZE... +linux-mm for GFP expertise re what allocations cannot possibly fail and should be excluded from fault injection. Interesting, thanks for the link. PAGE_SIZE looks like a good start. Once we have the predicate in place, we can refine it later when/if we have more inputs. But I wonder about GFP flags. They definitely have some impact on allocations. If GFP_ACCOUNT is set, all allocations can fail, right? If GFP_DMA/DMA32 is set, allocations can fail, right? What about other zones? If GFP_NORETRY is set, allocations can fail? What about GFP_NOMEMALLOC and GFP_ATOMIC? What about GFP_IO/GFP_FS/GFP_DIRECT_RECLAIM/GFP_KSWAPD_RECLAIM? At least some of these need to be set for allocations to not fail? Which ones? Any other flags are required to be set/unset for allocations to not fail? FTR here is quick link to flags list: https://elixir.bootlin.com/linux/v5.19-rc1/source/include/linux/gfp.h#L32