Received: by 2002:a19:651b:0:0:0:0:0 with SMTP id z27csp3658180lfb; Mon, 9 May 2022 01:01:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWt+zidoJrCJ3jfjRv0N1PbRts0cyghOwIc1z+PiDTjyowcizAuE44n6qK82IGR+wyKVXd X-Received: by 2002:a17:902:c404:b0:15e:9aa2:3abc with SMTP id k4-20020a170902c40400b0015e9aa23abcmr15060683plk.172.1652083261794; Mon, 09 May 2022 01:01:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652083261; cv=none; d=google.com; s=arc-20160816; b=lXNVlXA53xbCzp8Sv/yfuHg1jt3GgOTJ5ep2Db6iYffK+M98n+xufuQOiPFYLTmIJ8 3Ow/C2kmbO/1TxeSjhmn8AahOyyuvytGnx+f2PW+ZXGwXNy1aM82+3hEQimyN3/GUwWA zO0JV7wWLLOEF9KTksZoFzXjcTtMkTQqazpo3yuXrEn6hfq/aMVDIoNBMmg8k4VPHvBv 4gRaxC+l9EbnE7O8P5eaRiO0qpW3Dv2z3T0av5jRZtUqwzpYLCtqu8oR9z5C+YaEEc6V OLXSJjpwTMPaTA5PyRGzktW493T8xaA7FgiDdeE4NzNXZLju0kdMLvVz2pOL13d07Mir ZPug== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=M1gPuU5PNJFEA6NNEnilQYEQ9qiD41TeXO5khrcVesg=; b=VsYf1fFNqq54CQIuCdD1rMGHLTednjgwOi67NJDJSWw0wAikfrQ6Ap3vfvZWwdtW+X CFeviprA1XeX60oAMLroZ4ZfPSlPbHCcotylUYwqpI6Z+sh2nuZjEZRMDudcQCCaHbIm kMEiOCLQE7iQ606W3QYpT0yezQku2PbVfri8uAEaTr8eXF4AxsO3YNqgtPtbwbtBpnjJ tizYoohwfTdMIlKTdFq5hws9EH0CeMxnDtnGXqVD45kFB8PZzDoAWrceYGOT9fXySx4m E3XwleRfDvIfEQcResZ1z2t5GOL7aZ/ncbwCvdBb+7K2sdDMqYgEhladPdN/dMZkZ8zK XW1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=j0QDWj1u; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id c1-20020a63ef41000000b0039db476db86si13659475pgk.453.2022.05.09.01.01.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 01:01:01 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=j0QDWj1u; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C0B23190D14; Mon, 9 May 2022 00:51:30 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443121AbiEFPsg (ORCPT + 99 others); Fri, 6 May 2022 11:48:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442930AbiEFPsf (ORCPT ); Fri, 6 May 2022 11:48:35 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDD356D85F; Fri, 6 May 2022 08:44:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651851891; x=1683387891; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=nyZ5t8pD3rFxQXXz8gDpvzek8yDDoj/KX1ArnB2/pcM=; b=j0QDWj1uqgYKDMPFQDudQ4+fqP3w1GcWSbxWyATSAgDkpJDmivBZb/k6 EHoJ83AdhIpRWIacYPKMn8YnpIO4GqknJCsxKSp+pamCHwuONvF2L9Pnp ndP8egJrqnvafGr8iFcWfJUe+8+h+NcrEEmTQSKgSmwRllOylp5ElznnK UFkqS6OUiY/xiMS6hVuI65MEbo6rTJwiPjtyf+vy/sICRc5kF2Op0sGo8 qVOF0ZeoneuxPUWAWLRkdKHTnJhBX1jJj3W+u0zix3twyLYJ1/HXCElOA nLAsFIvoVbTIKWk8BzVrx0dGsqTV9mCSKegiFCih6Opy4H+N5cCPD9pAs A==; X-IronPort-AV: E=McAfee;i="6400,9594,10339"; a="255984466" X-IronPort-AV: E=Sophos;i="5.91,203,1647327600"; d="scan'208";a="255984466" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2022 08:44:51 -0700 X-IronPort-AV: E=Sophos;i="5.91,203,1647327600"; d="scan'208";a="586039009" Received: from hbourgeo-mobl2.ger.corp.intel.com (HELO intel.com) ([10.249.35.81]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2022 08:44:48 -0700 Date: Fri, 6 May 2022 17:44:44 +0200 From: Andi Shyti To: Javier Martinez Canillas Cc: linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, Thomas Zimmermann , Daniel Vetter , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Peter Jones , Andrzej Hajda , Helge Deller Subject: Re: [Intel-gfx] [PATCH] fbdev: efifb: Fix a use-after-free due early fb_info cleanup Message-ID: References: <20220506132225.588379-1-javierm@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220506132225.588379-1-javierm@redhat.com> X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_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 Hi Javier, 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") > Reported-by: Ville Syrj?l? > Reported-by: Andrzej Hajda > Signed-off-by: Javier Martinez Canillas Reviewed-by: Andi Shyti Andi