Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp737912iob; Wed, 4 May 2022 07:04:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWvY0PwcloZW7eO84bJd11GS9CtNqgGd3mPC0vMIrY9PZqulCg9Ekl5TM2f2PJtUJX13sW X-Received: by 2002:a17:902:9307:b0:154:78ba:ed40 with SMTP id bc7-20020a170902930700b0015478baed40mr21787154plb.92.1651673080044; Wed, 04 May 2022 07:04:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651673080; cv=none; d=google.com; s=arc-20160816; b=FMyhZqyjq66PjYcW6IVJLeTvpgrNurQ9ejRI4YN6InzU6vVPVBPvUW86A7WVrfN5Ln VOoBhJTNg2fs5QbJsBbr6BbQ2UEkjRZ5q74x3i2/YVWaCEr+I2bYnOEF6K61C2KT9n/6 LcIf4MiIPr9VhLy4/pdjm2JbOl5m2QjxQnj+1D8mKqQmdX0ZW0cRIF2PI0CVpHAugeW8 iJYK0y20mIfX7tnJIVeJmafRGZp3XoyE+2OLQxdB+FW98AVI56sanqEwhmuC0S3FljPQ PNthhKWrE29UM53599OqUXM3RslJPaRjFO33xW0RAqBvAZN/yrSrbEOv2RX4slQiBIG8 gNdQ== 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:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=EudcOykdh5aF3kNmm/3lXVh2DihzLVkHLlOi3J/9ZD4=; b=MpEKUs/KXFo+bxRODdTEGc+JmoYlmxJwDpGhMJmLx5Ya9MWLMMNwBw9+qGoIy0avUi pAKlEEUtOvlqqWVDMCcjGAt6NmvIsDg3cZdOZJ8vcaVZmGV93klUKlTftsPpAzVeR4LK D43/pYEUyXcUQ8kPiwe7bz6LT7yNVXy+QupY2l26+TXlYuhL9+EYnEyO6vhUo24QqiFW 9SRYhzWTadEKxqlquAVQ3PfWeRoEINGXY+JZjOFZW+eYLulDhrdPcDE/8js+5BrG/4mp A7t2B2YrCiMDI/I36XsVLvvy4LS014RSyhEIw0vEggA7T/t35HGeGyeJ9D/pEaked/Z6 syaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=UYqTEsH9; 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 n38-20020a635926000000b003ab24258fa6si18367442pgb.720.2022.05.04.07.04.22; Wed, 04 May 2022 07:04:40 -0700 (PDT) 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=@ffwll.ch header.s=google header.b=UYqTEsH9; 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 S1347745AbiEDJxK (ORCPT + 99 others); Wed, 4 May 2022 05:53:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343988AbiEDJxI (ORCPT ); Wed, 4 May 2022 05:53:08 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF71C27B2F for ; Wed, 4 May 2022 02:49:32 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id z2so251244ejj.3 for ; Wed, 04 May 2022 02:49:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=EudcOykdh5aF3kNmm/3lXVh2DihzLVkHLlOi3J/9ZD4=; b=UYqTEsH9NrVsDIxj7cqtPQKsKoAFsKesTKV8JGP5cfNWi9H9IWF7GiaMTJivacY/E/ DZw50ypWFZO19EHJdqPJkem1R1XqPfRD3lWpdKXC07Cyupfde5jGkog9CLi2kdUpeNwI vVDflmlAQxBz8ijf9tR6yMCK3L3lHKuhx1yBI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=EudcOykdh5aF3kNmm/3lXVh2DihzLVkHLlOi3J/9ZD4=; b=nP6ZlU2/Xyja69VducqvnckKgl6jnFertCSMSmpPKPDHfYV3eN6/rPXcyDBM0IdzMg BoMfTZhIigHdN6vJ5S0Kba06Xsw0EdgHvmWoEX2/uMTQK2fUVe+kQPlf/xmunPbgiycy i724oRFrMi8zuclp99ZgduK0hhyekPDca8laJ022MndoxFWKZCLPgJAw9f2T0rWfATK0 +QyRvQbhC28w5UVITrq4N2HRgGq7NJLazg4aYFhYTsF+E0IFx9r+vAvRClPeQCgBR5Y6 DEhatt4NtE7ggzvPAmZAiE/MCsXPa2n9Bl5dMhKi9l7OUn6THsmOW43o3RSrFKLR+61t db3Q== X-Gm-Message-State: AOAM5310iCgZTcIBMYvF+2f6V1AvoiwcYcr7Og8F8hpe8CRNBBYvU2mP redca3tOEWBt8eJ0orhxt3CAYg== X-Received: by 2002:a17:907:7fa2:b0:6f4:408a:5216 with SMTP id qk34-20020a1709077fa200b006f4408a5216mr14248720ejc.564.1651657771422; Wed, 04 May 2022 02:49:31 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id h20-20020a1709070b1400b006f3ef214db8sm5431393ejl.30.2022.05.04.02.49.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 02:49:30 -0700 (PDT) Date: Wed, 4 May 2022 11:49:29 +0200 From: Daniel Vetter To: Javier Martinez Canillas Cc: linux-kernel@vger.kernel.org, Maxime Ripard , Thomas Zimmermann , Junxiao Chang , Alex Deucher , Changcheng Deng , Daniel Vetter , Hans de Goede , Helge Deller , Sam Ravnborg , Xiyu Yang , Zack Rusin , Zhen Lei , Zheyu Ma , Zhouyi Zhou , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org Subject: Re: [PATCH v2] fbdev: Make fb_release() return -ENODEV if fbdev was unregistered Message-ID: Mail-Followup-To: Javier Martinez Canillas , linux-kernel@vger.kernel.org, Maxime Ripard , Thomas Zimmermann , Junxiao Chang , Alex Deucher , Changcheng Deng , Hans de Goede , Helge Deller , Sam Ravnborg , Xiyu Yang , Zack Rusin , Zhen Lei , Zheyu Ma , Zhouyi Zhou , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org References: <20220502135014.377945-1-javierm@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux phenom 5.10.0-8-amd64 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Tue, May 03, 2022 at 05:28:09PM +0200, Javier Martinez Canillas wrote: > On 5/2/22 15:50, Javier Martinez Canillas wrote: > > A reference to the framebuffer device struct fb_info is stored in the file > > private data, but this reference could no longer be valid and must not be > > accessed directly. Instead, the file_fb_info() accessor function must be > > used since it does sanity checking to make sure that the fb_info is valid. > > > > This can happen for example if the registered framebuffer device is for a > > driver that just uses a framebuffer provided by the system firmware. In > > that case, the fbdev core would unregister the framebuffer device when a > > real video driver is probed and ask to remove conflicting framebuffers. > > > > The bug has been present for a long time but commit 27599aacbaef ("fbdev: > > Hot-unplug firmware fb devices on forced removal") unmasked it since the > > fbdev core started unregistering the framebuffers' devices associated. > > > > Fixes: 27599aacbaef ("fbdev: Hot-unplug firmware fb devices on forced removal") > > Reported-by: Maxime Ripard > > Reported-by: Junxiao Chang > > Signed-off-by: Javier Martinez Canillas > > Reviewed-by: Thomas Zimmermann > > --- > Applied to drm-misc (drm-misc-fixes). See my other reply, but how does this not result in leaks? -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch