Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp29839iob; Tue, 3 May 2022 10:59:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxL6hCW7oLcqsyhWNExpvGPx78Z3WkIb3Gomezmd6BbBsmTGpTPxs9EKnlyg3n7gBfqIv2N X-Received: by 2002:a17:902:eb87:b0:15e:be95:a3f3 with SMTP id q7-20020a170902eb8700b0015ebe95a3f3mr1925423plg.38.1651600790856; Tue, 03 May 2022 10:59:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651600790; cv=none; d=google.com; s=arc-20160816; b=nn8PT6cLMKKsp9bCNSq4RfVoVHY4DiehGpXp/hrDQaA1zHcGkqGsZiGYiJL+LYauKl WsOwi6XRfiNOeTmhPuqFeWaoCkdd7m49dioihdUjc0gFwewNXIaVe8pqDQZowgoeiXBb N3L+vqfBpXJg0R+CJmoxIW63rJ7Oc6MqT7WWh5W2VawBm/oioih2DCP/8W4Ag9mTP2az UnsXCEVr6+q2ww2/Pynhz5XwzS3U5UbkuTkasd2vs8JihvuTf+WCwKHdL70DkzjzwOMr k3+3bSjlWYf3QVtwB8Kx4YqEWKGmen5mi09Kuq+n7VqbiLFazRwkOZfj/leji+o6Aynp gUhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=j50Hj8tQeVhAw3UmlHVgCe3j3gT0Gu2X85okQiDa4t8=; b=lj87AOQCLqvddi61OWn+o5ojf0x9yRXwwMZrLJsLW3oPaI3ZEIY0RWhgr1noQTnTW5 PfmnpUPK97oSu2CAfcG3nF28BKnTs7e8s5lPcwAgH4R8Ny7sD6SXiuuu76JX+ivEic94 DDsFRAswfQtMzcIzhpv1bw9+QJW+p4G2izcxGysKL8CMJyi3Wd2XZfQuaiEd1bGIvN4N 5cxi7sM4zXq0pi2WEivD5GaT8mt1m9IfvJLMFBNLlEnGIOqUzlyA7dzrcWvsqhUF6v6c fAGWu2+/UqiB8ysw2nTJu0QKTJbV+9Ra2uqFa7wNyJBmwM6ZD4zZDFfhHuF3xWPtBlav XTgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IIah3cKI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q9-20020a656249000000b003ab54545cd9si17359622pgv.56.2022.05.03.10.58.58; Tue, 03 May 2022 10:59:50 -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=@redhat.com header.s=mimecast20190719 header.b=IIah3cKI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238504AbiECPcE (ORCPT + 99 others); Tue, 3 May 2022 11:32:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236374AbiECPcD (ORCPT ); Tue, 3 May 2022 11:32:03 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0919A22B38 for ; Tue, 3 May 2022 08:28:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651591710; 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=j50Hj8tQeVhAw3UmlHVgCe3j3gT0Gu2X85okQiDa4t8=; b=IIah3cKIpzLg1XhNGjdv4uJiD6E1So0flN40r1k/kmkY2JL31EOm/7d3GSSFVKv3CLfVs4 SGreuHNOpp9oyBdFKyzyFx/lO30KWupIg24UcH9L3TBYe5XQ0oj+9+KzO6VoI5sFSCf2XU vCpD1g/P+hXOT0wOreUisT7HZiOn5iI= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-361-U3_A3T8GNeStRrs9KVoCAw-1; Tue, 03 May 2022 11:28:13 -0400 X-MC-Unique: U3_A3T8GNeStRrs9KVoCAw-1 Received: by mail-wm1-f70.google.com with SMTP id r186-20020a1c44c3000000b00393f52ed5ceso1503913wma.7 for ; Tue, 03 May 2022 08:28:12 -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:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=j50Hj8tQeVhAw3UmlHVgCe3j3gT0Gu2X85okQiDa4t8=; b=apRB6coDrc/jvXY+L1/QPKEVXHhTBq58MO1BkBfaFLQi9omfV6Ka9D82QUq847hlkc O1umrePIDGIt3LlUBh7bm3IAmlR0a4nrnVjcjCC05U23ZqoRNs/ztclih4OLe3hpmihg 9/lOsOA0Hrtyi7OicvLPGe2NvCVh1jTgNTS/j9pS+2sWQyXFtXuCm2U6U5dbYdlpzwCb 5qQgjC9myVzcsdQTLHAtUtHYHycQjbU+jgXjqmVYbNCduuC6G9Gc+QKcJ/6rfEQI1R1f G+0V6M1+WWPMPTwVT+Xgqs5/SgPCA4dt9kDLlSr2me+Y6EigMYAhz+ENrqQdqd3DRqiG LNcA== X-Gm-Message-State: AOAM5315pVB73KjaC0KD2UpQ1sLFfJfMCmsxHV4cv9UJrn54foe2Iiy7 cOpPogFdSuczXLOdnL9W5j3+ixo+fIYRpBcUZOVFXIV9ptHOR3Osmj3cU88a3XDqYCeOuiiOFjz Mw5R6O0f6g1qCT4D1PG/XC7s7xfRBlxVOFAowg6SuhgYpcSFnDSo0wxubQJ1ZDv0HzZXdu++zId o= X-Received: by 2002:a05:600c:3c8d:b0:38e:4bc6:abde with SMTP id bg13-20020a05600c3c8d00b0038e4bc6abdemr3770034wmb.13.1651591691511; Tue, 03 May 2022 08:28:11 -0700 (PDT) X-Received: by 2002:a05:600c:3c8d:b0:38e:4bc6:abde with SMTP id bg13-20020a05600c3c8d00b0038e4bc6abdemr3769995wmb.13.1651591690935; Tue, 03 May 2022 08:28:10 -0700 (PDT) Received: from [10.201.33.11] ([195.166.127.210]) by smtp.gmail.com with ESMTPSA id u21-20020adfa195000000b0020c5253d8c4sm9568792wru.16.2022.05.03.08.28.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 May 2022 08:28:10 -0700 (PDT) Message-ID: Date: Tue, 3 May 2022 17:28:09 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH v2] fbdev: Make fb_release() return -ENODEV if fbdev was unregistered Content-Language: en-US To: linux-kernel@vger.kernel.org Cc: 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 References: <20220502135014.377945-1-javierm@redhat.com> From: Javier Martinez Canillas In-Reply-To: <20220502135014.377945-1-javierm@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 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). -- Best regards, Javier Martinez Canillas Linux Engineering Red Hat