Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp2857579rwb; Fri, 20 Jan 2023 08:11:12 -0800 (PST) X-Google-Smtp-Source: AMrXdXv/VwcK9nt+16U8/OjoJ2z9bpmB9yUNiYUMUYgujArlrCsq+VXhgr28mRxlZtxiKmq8T3nc X-Received: by 2002:a17:903:32c8:b0:194:58e0:488b with SMTP id i8-20020a17090332c800b0019458e0488bmr21519104plr.30.1674231072377; Fri, 20 Jan 2023 08:11:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674231072; cv=none; d=google.com; s=arc-20160816; b=fhRTJdHazfI0n38wwoMByDGN9TqL2GddPZ8SEWRhbgD4y46aeNGL003NXaxW7xDjq7 uNr8MaGKE4lsHcIY0USNvdju106lEEO/SLu1xGnwPfsNmbJA94gT5xCvfMC0w1EaaRG8 yT7TWSlT6OAmOYYwolkKxaylH09uKVsd/28nE2KdmRHcz07z17ymcAlcYjrg4JiGpjri KvMXVAO9655F59urFV6uv63QFrTCHAXXPA10fbZ3NqVOiDjT9GFVwoKA/U82TUtMLT04 dtqbyob352BS6ZVQbla4url0FHFbmYwxtdPtGD6Jzmlj/Xn38oQC7cmDsk0DinNgO9/N Nb8Q== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tWhqBqeds6M5kvB9paMMJ8Ql2m2pownIzTjbJavhOlc=; b=WIBPOxe4oD+XiVaZZ9Brs+eIrRPmNL60ONRhmRvXGztquaJQi5CdUkDA5PrF5g6o4T 2VgAPzTUQoMcrP4eiDabeEuXpmOZd15wthwTFGM2YEWggYmXstNqYTGJRJYdRe5extvo ACU2YuBgGy0GJh8PKPcNwqU8N3d6Mjs09en2yyZGnJOaT8Id9b6+lCyEbYRIZlvcJ8Vp Lbxa/5ySqzQaSu6KZ8qv9wEfuL/REFITBkkMMq7GxJ6IWsFKrXuXjiH/NHzA4Q3CHBjO NnpPzxntZ5XvUy2/NMWLNjhCTjg6X9OFHIsBSgqnZys4HgtQfErN5vr3pAZVmhvSnB4g 5hFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="f7Fu/nIj"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y16-20020a170902b49000b001910f9d152esi39783292plr.271.2023.01.20.08.11.06; Fri, 20 Jan 2023 08:11:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="f7Fu/nIj"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231344AbjATPVY (ORCPT + 49 others); Fri, 20 Jan 2023 10:21:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230506AbjATPVX (ORCPT ); Fri, 20 Jan 2023 10:21:23 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38502DA127 for ; Fri, 20 Jan 2023 07:21:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=tWhqBqeds6M5kvB9paMMJ8Ql2m2pownIzTjbJavhOlc=; b=f7Fu/nIjdc8hxAhFw2solrt8I4 cxb2BlesCm92jZX8/skmtcYPAJgKRS7qV9Fq4J9ox2jmXXsHvmlh7fHvBkScs9JdxLHxIgCDpnvyp doTZIkfLt5VyQ8gIIg/ccb+96ilZaVzjy1ENd7+KcN9px1YdPfd9GGRN7hmgbDX+wTj6sp7Iv1PPb vJ96ZJ1mZDfSAZyUsvN3Ly39bNAK1JM6KVCN5WwRAuhmMkeab0DjmC1gHTuLpm2bgC88xvjVkgNRD TZtYtGnzrp8y6Jw3PrdvktW/FfUlvtZbc6LAMjujpsbPZmDkIF59f7LEMjLWc2kymzMruB8k7k9tC 7CjWPHfQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pItCT-002446-OT; Fri, 20 Jan 2023 15:21:06 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 11C28300033; Fri, 20 Jan 2023 16:21:03 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 35C962016471C; Fri, 20 Jan 2023 16:21:03 +0100 (CET) Date: Fri, 20 Jan 2023 16:21:03 +0100 From: Peter Zijlstra To: Nicholas Piggin Cc: Ingo Molnar , linux-kernel@vger.kernel.org, Michael Ellerman , "Eric W. Biederman" Subject: Re: [PATCH] exit: Detect and fix irq disabled state in oops Message-ID: References: <20230120011820.2664120-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230120011820.2664120-1-npiggin@gmail.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 On Fri, Jan 20, 2023 at 11:18:20AM +1000, Nicholas Piggin wrote: > If a task oopses with irqs disabled, this can cause various cascading > problems in the oops path such as sleep-from-invalid warnings, and > potentially worse. > > Since commit 0258b5fd7c712 ("coredump: Limit coredumps to a single > thread group"), the unconditional irq enable in coredump_task_exit() > will "fix" the irq state to be enabled early in do_exit(), so currently > this may not be triggerable, but that is coincidental and fragile. > > Detect and fix the irqs_disabled() condition in the oops path before > calling do_exit(), similarly to the way in_atomic() is handled. > > Link: https://lore.kernel.org/lkml/20221004094401.708299-1-npiggin@gmail.com/ > Reported-by: Michael Ellerman > Acked-by: "Eric W. Biederman" > Signed-off-by: Nicholas Piggin > --- > Hi Peter, > > Would you consider taking this through the sched tree? Yep, can do, let me go queue it.