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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 207E7C433F5 for ; Sat, 7 May 2022 16:40:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1446600AbiEGQoN (ORCPT ); Sat, 7 May 2022 12:44:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1446654AbiEGQoJ (ORCPT ); Sat, 7 May 2022 12:44:09 -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 07E6C2650 for ; Sat, 7 May 2022 09:40:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651941620; 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=inhGipBUDTXnB2qKEYfxvYqIWIZ4u692zATmOyojLEY=; b=DGn71tS+FTNn/jiB0hJwTlqvs9YOZI8QMMY1QOVJNj4fotIs7SLOf5GdbYTrb3dW5eGedF BSojKAUMzEQBoplguA7fb1XOvrU2U+xqAdWYTkCPufXJV2VbzR1Gs89K6IKq5MnLANV5tV Dz1WyURenHTzXLFWgoybeG1ehnq4P8o= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-319-dA8vIxHVMaGFce8Rzal_1A-1; Sat, 07 May 2022 12:40:19 -0400 X-MC-Unique: dA8vIxHVMaGFce8Rzal_1A-1 Received: by mail-wm1-f71.google.com with SMTP id n26-20020a1c721a000000b003941ea1ced7so2978205wmc.7 for ; Sat, 07 May 2022 09:40:19 -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=inhGipBUDTXnB2qKEYfxvYqIWIZ4u692zATmOyojLEY=; b=gkjDi1FXtCEr66SHlpBuvEHLfNTbrG66AQ0K/Ejc6WQnd7B+c93S117dypPbpGzjG+ xTyq5BzFsKku7+FhrQAxP1300/VyH3eHcKhYbp4xDBGjR8w5k4UBnyGX31SPTvXsU2fZ 6n81NEyUVO9kk7EgYs0GAO0QvcvcYY3LK2RconZGWUDcld0zbeI76DZKKpol//R/FBmo Hsexz7rM5YsD6tJHBLjRJtw5xxeL9REJFpVilNCP8C3ya7ENsPvPh9sjnfWEcpDsQzNV u7tPXU2IRsSR/+2Qm8XaSL/eLjPTp5ShZ/d/niO9Ne6h4dReOhofUPI2E4DMyJuWeI+v ouaA== X-Gm-Message-State: AOAM533yKwz/bQS5QciuCzo+DMRJqOsWSfkyMZMnS9aXkTpUmDFdB+70 r74pDkH4QNT3a2AWTOU1DJ9z7X5H28YOtQ/91d52OsKbivSBOT9RPMt1Ur6Lm/PKcAKlMNZXY2e rqPDzxc7V5ArXGuC+34b4LQGS X-Received: by 2002:a1c:f705:0:b0:37d:f2e5:d8ec with SMTP id v5-20020a1cf705000000b0037df2e5d8ecmr15431648wmh.21.1651941618492; Sat, 07 May 2022 09:40:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykhasS4dK4eppFGtBqCb2g0PaleaocuXsAQca/dvV5qInWX6ynRAZXrO0TJxqEd2vidA73gA== X-Received: by 2002:a1c:f705:0:b0:37d:f2e5:d8ec with SMTP id v5-20020a1cf705000000b0037df2e5d8ecmr15431630wmh.21.1651941618195; Sat, 07 May 2022 09:40:18 -0700 (PDT) Received: from [192.168.1.129] (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id e2-20020a5d5942000000b0020c5253d8e1sm7951521wri.45.2022.05.07.09.40.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 07 May 2022 09:40:17 -0700 (PDT) Message-ID: <981d7ed4-8554-73ca-bfd1-2d89e4e91af3@redhat.com> Date: Sat, 7 May 2022 18:40:16 +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] fbdev: efifb: Fix a use-after-free due early fb_info cleanup Content-Language: en-US To: Lucas De Marchi Cc: linux-fbdev@vger.kernel.org, Andrzej Hajda , Daniel Vetter , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Peter Jones , Thomas Zimmermann , Helge Deller References: <20220506132225.588379-1-javierm@redhat.com> <20220507162053.auo2idd5twvnxatj@ldmartin-desk2> From: Javier Martinez Canillas In-Reply-To: <20220507162053.auo2idd5twvnxatj@ldmartin-desk2> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Lucas, On 5/7/22 18:20, Lucas De Marchi wrote: > On Fri, May 06, 2022 at 03:22:25PM +0200, Javier Martinez Canillas wrote: >> Commit d258d00fb9c7 ("fbdev: efifb: Cleanup fb_info in .fb_destroy rather >> than .remove") attempted to fix a use-after-free error due driver freeing >> the fb_info in the .remove handler instead of doing it in .fb_destroy. >> >> But ironically that change introduced yet another use-after-free since the >> fb_info was still used after the free. >> >> This should fix for good by freeing the fb_info at the end of the handler. >> >> Fixes: d258d00fb9c7 ("fbdev: efifb: Cleanup fb_info in .fb_destroy rather than .remove") > > are these patches going through any CI before being applied? Maybe would > be a good idea to cc intel-gfx mailing list on these fixes to have Intel > CI to pick them up for some tests? > I Cc'ed intel-gfx for this particular patch. I should had done it for the previous patches too, but I wasn't aware that Cc'ing that list would make it run on your CI. I tested locally the offending patch on an EFI platform before applying it and I don't know why it didn't fail there. Sorry all for the inconvenience. > pushed to drm-misc-fixes where the previous patch was applied. > Thanks. -- Best regards, Javier Martinez Canillas Linux Engineering Red Hat 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 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 BDBCAC433F5 for ; Sat, 7 May 2022 16:40:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DFA2510E53E; Sat, 7 May 2022 16:40:22 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id E25AF10E53E for ; Sat, 7 May 2022 16:40:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651941620; 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=inhGipBUDTXnB2qKEYfxvYqIWIZ4u692zATmOyojLEY=; b=DGn71tS+FTNn/jiB0hJwTlqvs9YOZI8QMMY1QOVJNj4fotIs7SLOf5GdbYTrb3dW5eGedF BSojKAUMzEQBoplguA7fb1XOvrU2U+xqAdWYTkCPufXJV2VbzR1Gs89K6IKq5MnLANV5tV Dz1WyURenHTzXLFWgoybeG1ehnq4P8o= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-153-H0XNsmYWPkuYKl5Ag6M4Vw-1; Sat, 07 May 2022 12:40:19 -0400 X-MC-Unique: H0XNsmYWPkuYKl5Ag6M4Vw-1 Received: by mail-wm1-f72.google.com with SMTP id z23-20020a05600c221700b003942fd37764so7694146wml.8 for ; Sat, 07 May 2022 09:40:19 -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=inhGipBUDTXnB2qKEYfxvYqIWIZ4u692zATmOyojLEY=; b=3PDKJNZsCWT1+tDCI66GUAxd+JcfMEu1chFBFnd44mw5YurOxhqeEg1sMoICLg8aNy R2q6CKta4kYKz68mE6Cal6Rj8axZiGdFAzmGLN7UkbykjvSZN98I6wHnYC4JymXxPqtw slbUZUmdnxTwQNQMas60nGj05CsEb3J5RZtW6HjrXYWc8JzfvgDbzLRP+yJD5yzqT75J pH5kRr9rugT/BjS+H3Bs1D1JK9TUR7jsEnprWA/CZsq5Csf4YMT9UOhhgZjgv+trcLOU dq9g1GyEKkuNK9cXOr/9l3Sswbd40p9VOBwXO8Ddk0/IwHveukiXRuagqtbmv8KYJvfx n8ng== X-Gm-Message-State: AOAM533lCqj+47GAH30QU8AJj8pOFF0qohZVfxLRCVD9hF5convAqCUn n57oFUdca9+M3HxgY9M7HU+nQd/5PLksPTNdxovH23mUdDzoFIyzttXBpoRLnf7H2KBLzrArUSH i/lvkoXpfFhAkUGPDtdmHpFrrBz2T X-Received: by 2002:a1c:f705:0:b0:37d:f2e5:d8ec with SMTP id v5-20020a1cf705000000b0037df2e5d8ecmr15431649wmh.21.1651941618510; Sat, 07 May 2022 09:40:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykhasS4dK4eppFGtBqCb2g0PaleaocuXsAQca/dvV5qInWX6ynRAZXrO0TJxqEd2vidA73gA== X-Received: by 2002:a1c:f705:0:b0:37d:f2e5:d8ec with SMTP id v5-20020a1cf705000000b0037df2e5d8ecmr15431630wmh.21.1651941618195; Sat, 07 May 2022 09:40:18 -0700 (PDT) Received: from [192.168.1.129] (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id e2-20020a5d5942000000b0020c5253d8e1sm7951521wri.45.2022.05.07.09.40.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 07 May 2022 09:40:17 -0700 (PDT) Message-ID: <981d7ed4-8554-73ca-bfd1-2d89e4e91af3@redhat.com> Date: Sat, 7 May 2022 18:40:16 +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] fbdev: efifb: Fix a use-after-free due early fb_info cleanup To: Lucas De Marchi References: <20220506132225.588379-1-javierm@redhat.com> <20220507162053.auo2idd5twvnxatj@ldmartin-desk2> From: Javier Martinez Canillas In-Reply-To: <20220507162053.auo2idd5twvnxatj@ldmartin-desk2> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=javierm@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, Thomas Zimmermann , Daniel Vetter , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Peter Jones , Andrzej Hajda , Helge Deller Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hello Lucas, On 5/7/22 18:20, Lucas De Marchi wrote: > On Fri, May 06, 2022 at 03:22:25PM +0200, Javier Martinez Canillas wrote: >> Commit d258d00fb9c7 ("fbdev: efifb: Cleanup fb_info in .fb_destroy rather >> than .remove") attempted to fix a use-after-free error due driver freeing >> the fb_info in the .remove handler instead of doing it in .fb_destroy. >> >> But ironically that change introduced yet another use-after-free since the >> fb_info was still used after the free. >> >> This should fix for good by freeing the fb_info at the end of the handler. >> >> Fixes: d258d00fb9c7 ("fbdev: efifb: Cleanup fb_info in .fb_destroy rather than .remove") > > are these patches going through any CI before being applied? Maybe would > be a good idea to cc intel-gfx mailing list on these fixes to have Intel > CI to pick them up for some tests? > I Cc'ed intel-gfx for this particular patch. I should had done it for the previous patches too, but I wasn't aware that Cc'ing that list would make it run on your CI. I tested locally the offending patch on an EFI platform before applying it and I don't know why it didn't fail there. Sorry all for the inconvenience. > pushed to drm-misc-fixes where the previous patch was applied. > Thanks. -- Best regards, Javier Martinez Canillas Linux Engineering Red Hat 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 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 C4DBFC433EF for ; Sat, 7 May 2022 16:40:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 45CA410EB00; Sat, 7 May 2022 16:40:23 +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 5337F10E53E for ; Sat, 7 May 2022 16:40:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651941621; 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=inhGipBUDTXnB2qKEYfxvYqIWIZ4u692zATmOyojLEY=; b=P2xdkMOrnlXMmJ2ZZzyFgYr7WSjkqWUx+j3Qib3wqZUx9ChFlbVZMIW4CDgQrCFj1sA8tQ yUCByAcKeVcf4uhttGMjJlrLkisWHKlesBgltXvx9ThLIHt/H5OCV6KuGrL0E+2/Jyycpf zXkBdKbRBZYy1yGKl9bJuS3mkKeQUy0= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-644-iiGXPijQMqGdgcN1HbkzaA-1; Sat, 07 May 2022 12:40:19 -0400 X-MC-Unique: iiGXPijQMqGdgcN1HbkzaA-1 Received: by mail-wm1-f71.google.com with SMTP id k35-20020a05600c1ca300b003946a9764baso3853395wms.1 for ; Sat, 07 May 2022 09:40:19 -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=inhGipBUDTXnB2qKEYfxvYqIWIZ4u692zATmOyojLEY=; b=uhsH1gr1eZtW7j7H4wtB+XUY5+NGjCQaFU39T737CKH48xmKzhabr/P773BbwTZ4rJ tPa+24/n/gB6wNvqXkm8ah2l19Vm9sjmGpIiOW9XQ7VtBdfeN5ClHQIQAFrSgAM8fOal so+u1Si7Xjx7uUvg32Mdxv7ob+jcOKs5ljwHHyXMR3XpEu75wDw0WZdk/URPmVmw5cVQ YwxpsLKBqQuUyIoLFGYMl0pe1kzTvW2eY8vtWz/HCQkqDGHUNSO16PVIlz7qiZ/7phE4 bNszfwYJgaa+ZFpZEbSV0FB3TrVnr9PAFfw7r2nHsjuIMlTYuy4ypSDMLPj1IQCpWuxN H+EQ== X-Gm-Message-State: AOAM531v6eu7t1cNmXK7aYX+yzD1U2VnHq44Oe5hXhRpH6ZTQ46WLdUe 2QYqcEdMKYbH75Nar+cEF6NRwzRBGoSP4pmQs2iZmyi9bSq35GwmsbZoVRGeQZspz9ORTDLGHI6 V2KVl51tAqR/afkAZ8ccrgtTOHM6A X-Received: by 2002:a1c:f705:0:b0:37d:f2e5:d8ec with SMTP id v5-20020a1cf705000000b0037df2e5d8ecmr15431654wmh.21.1651941618626; Sat, 07 May 2022 09:40:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykhasS4dK4eppFGtBqCb2g0PaleaocuXsAQca/dvV5qInWX6ynRAZXrO0TJxqEd2vidA73gA== X-Received: by 2002:a1c:f705:0:b0:37d:f2e5:d8ec with SMTP id v5-20020a1cf705000000b0037df2e5d8ecmr15431630wmh.21.1651941618195; Sat, 07 May 2022 09:40:18 -0700 (PDT) Received: from [192.168.1.129] (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id e2-20020a5d5942000000b0020c5253d8e1sm7951521wri.45.2022.05.07.09.40.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 07 May 2022 09:40:17 -0700 (PDT) Message-ID: <981d7ed4-8554-73ca-bfd1-2d89e4e91af3@redhat.com> Date: Sat, 7 May 2022 18:40:16 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 To: Lucas De Marchi References: <20220506132225.588379-1-javierm@redhat.com> <20220507162053.auo2idd5twvnxatj@ldmartin-desk2> From: Javier Martinez Canillas In-Reply-To: <20220507162053.auo2idd5twvnxatj@ldmartin-desk2> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=javierm@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Intel-gfx] [PATCH] fbdev: efifb: Fix a use-after-free due early fb_info cleanup X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, Thomas Zimmermann , Daniel Vetter , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Peter Jones , Andrzej Hajda , Helge Deller Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Hello Lucas, On 5/7/22 18:20, Lucas De Marchi wrote: > On Fri, May 06, 2022 at 03:22:25PM +0200, Javier Martinez Canillas wrote: >> Commit d258d00fb9c7 ("fbdev: efifb: Cleanup fb_info in .fb_destroy rather >> than .remove") attempted to fix a use-after-free error due driver freeing >> the fb_info in the .remove handler instead of doing it in .fb_destroy. >> >> But ironically that change introduced yet another use-after-free since the >> fb_info was still used after the free. >> >> This should fix for good by freeing the fb_info at the end of the handler. >> >> Fixes: d258d00fb9c7 ("fbdev: efifb: Cleanup fb_info in .fb_destroy rather than .remove") > > are these patches going through any CI before being applied? Maybe would > be a good idea to cc intel-gfx mailing list on these fixes to have Intel > CI to pick them up for some tests? > I Cc'ed intel-gfx for this particular patch. I should had done it for the previous patches too, but I wasn't aware that Cc'ing that list would make it run on your CI. I tested locally the offending patch on an EFI platform before applying it and I don't know why it didn't fail there. Sorry all for the inconvenience. > pushed to drm-misc-fixes where the previous patch was applied. > Thanks. -- Best regards, Javier Martinez Canillas Linux Engineering Red Hat