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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 68CA3C433FE for ; Tue, 17 May 2022 22:33:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BDCB910FA0C; Tue, 17 May 2022 22:33:43 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4F08F1125D7 for ; Tue, 17 May 2022 22:33:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652826821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xsgZD2xN95jcvNsVYdiJpz1wstzqtrmwvWpl/rt8mrs=; b=Js7VkRPvMV+8h8BvFZkIWA8fL+QpIRmFtzMGbFF2kJ9C10qfnE7qupz7k40TC2opmf826f xVXlD3XofEG0mXu1Iy77i37jAqYHAgk8kkl9DFv/l2trd1QhzPd7iGTMYw5FMW7flp2Mzw SJ2SpCbt/jwvmqsrT8hHqZ1Mbw/7m6E= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-240-iEk4T0eIM7-2sMPZiqYYbQ-1; Tue, 17 May 2022 18:33:40 -0400 X-MC-Unique: iEk4T0eIM7-2sMPZiqYYbQ-1 Received: by mail-qv1-f72.google.com with SMTP id cf3-20020a05621403e300b00461d0bc91c3so202983qvb.22 for ; Tue, 17 May 2022 15:33:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:organization:user-agent:mime-version :content-transfer-encoding; bh=xsgZD2xN95jcvNsVYdiJpz1wstzqtrmwvWpl/rt8mrs=; b=ndwSTbFvLPN41ztV3w+jhWi5yNm0tJF2lMA+z1BRAawj46Ox7WNh9JjM111w5i1jh5 wbLVYQ4LBZ2j3k0G4tCoDbyp9nHqxV7QRGMxR4LFKHc2PazMjQwNvG/rUCnMpb9twh1B QyKSueUfOJFgoBD0DzBWFsBbkiVRTrrYyyYTIKJ9TpWRkbNkEphoPr1uTbO7JXSwvTEK tGkrj8klAaG9ai97I0LkOgabpaWaJMIe2g7c5lSttTbOpmAMhGX/D1ZKpQOyfLQ3RVOK UDGxIj8DI/MNipWIBFz+Ci1omSHGrELd7KYg2aRSsw0K/uDCCiBDf7vBUFlk0P7PISOC b1nQ== X-Gm-Message-State: AOAM5322fb4N0UO+23pqSxSuSB9Q0q2BaiyiwPHqpk3PGZ7r3BhiOW9X 98cazOScpq0GoL800pQfj48GXXPBFYTrDIzNfG8yUeXIDj+RmHS54LiJeM98fhyhtRYJLhDrTkU 8RlTjdgW1Kcrys5qfc5S4vwyXpQ== X-Received: by 2002:a05:622a:4d4:b0:2f3:c529:5f89 with SMTP id q20-20020a05622a04d400b002f3c5295f89mr22472719qtx.158.1652826820080; Tue, 17 May 2022 15:33:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNH3lIfhXQ3QcRjAYZSIHBy4cUOe+o8UjX9lacQqYYbq3FNnSKIvDUgOrGldFFWLAX52lxvw== X-Received: by 2002:a05:622a:4d4:b0:2f3:c529:5f89 with SMTP id q20-20020a05622a04d400b002f3c5295f89mr22472711qtx.158.1652826819889; Tue, 17 May 2022 15:33:39 -0700 (PDT) Received: from [192.168.8.138] (static-71-184-137-158.bstnma.ftas.verizon.net. [71.184.137.158]) by smtp.gmail.com with ESMTPSA id g12-20020ac8070c000000b002f39b99f69csm114858qth.54.2022.05.17.15.33.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 15:33:39 -0700 (PDT) Message-ID: <4382925e2e4174598214f3a9f74b373a5fca40fd.camel@redhat.com> From: Lyude Paul To: Mark Menzynski , linux-kernel@vger.kernel.org Date: Tue, 17 May 2022 18:33:38 -0400 In-Reply-To: <20220516133103.324365-1-mmenzyns@redhat.com> References: <20220516133103.324365-1-mmenzyns@redhat.com> Organization: Red Hat Inc. User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lyude@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Subject: Re: [Nouveau] [PATCH v2] drm/nouveau: reorder nouveau_drm_device_fini X-BeenThere: nouveau@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Nouveau development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Ben Skeggs , Daniel Vetter Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" So I think you forgot to update the subject of the patch. If you can send a respin of this patch with a corrected patch title, then you can consider this: Reviewed-by: Lyude Paul I'll push once you get the respin out On Mon, 2022-05-16 at 15:31 +0200, Mark Menzynski wrote: > Resources needed for output poll workers are destroyed in > nouveau_fbcon_fini() before output poll workers are cleared in > nouveau_display_fini(). This means there is a time between fbcon_fini() > and display_fini(), where if output poll happens, it crashes. > > This makes output poll workers cleared right before fbcon resources are > destroyed. > > BUG: KASAN: use-after-free in > __drm_fb_helper_initial_config_and_unlock.cold+0x1f3/0x291 > [drm_kms_helper] > > Cc: Ben Skeggs > Cc: Karol Herbst > Cc: Lyude Paul > Cc: David Airlie > Cc: Daniel Vetter > Cc: dri-devel@lists.freedesktop.org > Cc: nouveau@lists.freedesktop.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Mark Menzynski > --- >  drivers/gpu/drm/nouveau/nouveau_fbcon.c | 2 ++ >  1 file changed, 2 insertions(+) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c > b/drivers/gpu/drm/nouveau/nouveau_fbcon.c > index 4f9b3aa5deda..5226323e55d3 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c > +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c > @@ -39,6 +39,7 @@ >   >  #include >  #include > +#include >  #include >  #include >  #include > @@ -605,6 +606,7 @@ nouveau_fbcon_fini(struct drm_device *dev) >         if (!drm->fbcon) >                 return; >   > +       drm_kms_helper_poll_fini(dev); >         nouveau_fbcon_accel_fini(dev); >         nouveau_fbcon_destroy(dev, drm->fbcon); >         kfree(drm->fbcon); -- Cheers, Lyude Paul (she/her) Software Engineer at Red Hat