From patchwork Wed Nov 20 15:03:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugene Kobyak X-Patchwork-Id: 13881327 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 B8C5ED711AA for ; Wed, 20 Nov 2024 15:03:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4B93C10E769; Wed, 20 Nov 2024 15:03:42 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="DV5IDLxI"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id 983C310E769 for ; Wed, 20 Nov 2024 15:03:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732115022; x=1763651022; h=date:from:to:cc:subject:message-id:mime-version; bh=dYUHMaArepv9a/Tj76ig2d4ekJw924UCmvSSfnTDZqc=; b=DV5IDLxIcdHo79QndpMYQeX/iOsrrzQdJsCDoGXF7/fp9QOaYyFvG5nM ZnPENDMZGjPg338p26La8kzzyzm61QpZA/od80UYglVpNDwiUKfxC+7sk TT99LkvSl7j4VR+ftBfjOJ1R0Otkneo8UEYgQmqm6fXw6lLpRwnLvcR7w vwCjROy7awPQR6pDzwqlhRt8NU/mLxwYkSTaWke6NIOi4nzqe0SuNB9vi t5fAAfudhtYNcug7XMr+vZh3UZ6lgIZB76zu+GsTSxp1WsrEWq9pa4mTQ /Lp07NTNX6f9Z2ULbvg65eF6bswDQoFl9hKppvJU9PIZ6u4EfwLTl5JWv Q==; X-CSE-ConnectionGUID: 1u10HPDEROukuyl03fpipw== X-CSE-MsgGUID: a7v/oKlRSIy8hfYsHWm/iQ== X-IronPort-AV: E=McAfee;i="6700,10204,11262"; a="32038719" X-IronPort-AV: E=Sophos;i="6.12,170,1728975600"; d="scan'208";a="32038719" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2024 07:03:42 -0800 X-CSE-ConnectionGUID: 5BzEBK30TzyGRy3V28+nwA== X-CSE-MsgGUID: GFGnlHAeTqSzuMXt7ssAXA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,170,1728975600"; d="scan'208";a="94003939" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmviesa003.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 20 Nov 2024 07:03:41 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 20 Nov 2024 07:03:40 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Wed, 20 Nov 2024 07:03:40 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.175) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 20 Nov 2024 07:03:40 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VvISlXui7gSQ51cfKbrjRWPJfvqziYbULIZhR4jRH+LuoqvA2AZUfD24Z/3P4W6E7NDJtjYEKGvu8nivwikIzInnbAIr8gASxK38TqyyvU0KkH8o1pGy+3+bittwGuoeisqo7wP0elx3A1W4QrTifP0Fez350IhOkSuG3MlY30VXRYT/9ArU5xP4sXmu+w1JxTqGqbiqPJUxp5Izt5oy1wg8haOk1T6EIQRcsvQ2qbEpuCLXKHfxUAnsgc0IlBli+Gkzu8r2vfWD23badrZCfIwiZx/kkwVn9PCmscCIeT8G57atZEWXkrXenbEFsvMitkuZwez0nLnraMpK2kBh4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JgEeQcy5t7FghY8qwTWrY0XesU6JIyFoBzrMnsdJo7E=; b=qWI1WDQefS0h2/ieVvqlQwm09f1+ECmL/auh4h5RaYzew6Ol63LRBNZHVuCLBV4EdHXSdAKeBjCdy/SPT2AVnTo4wKYtYtTjFsGi5qipqy8xkBE/xSjpzISsC+p3oNgKaMtlhSxHZWL/a0JPCstZATsqocC5xMiDpNCDXBy+HLv+0EHGQniRxJSyFyEE0reXo5+FAHccBiZZgkCA8UKWGXujTjSKQYAwWn7M0AiRj4vRIqgngSlcKGC5hPVF08TtfyneRVuHCHCsidPK/tEL0yanx5H55MYTm8O1JbG3a1Fcf94lRZftoHMAzcvmFrT6/bHeJxVfm3XOBCHTq6ZR7Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from SN6PR11MB2640.namprd11.prod.outlook.com (2603:10b6:805:56::11) by SJ0PR11MB7701.namprd11.prod.outlook.com (2603:10b6:a03:4e4::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.23; Wed, 20 Nov 2024 15:03:34 +0000 Received: from SN6PR11MB2640.namprd11.prod.outlook.com ([fe80::4b8:af61:4cfe:d6fa]) by SN6PR11MB2640.namprd11.prod.outlook.com ([fe80::4b8:af61:4cfe:d6fa%2]) with mapi id 15.20.8158.023; Wed, 20 Nov 2024 15:03:34 +0000 Date: Wed, 20 Nov 2024 15:03:29 +0000 From: Eugene Kobyak To: CC: , Subject: [PATCH v2] drm/i915: Fixed NULL pointer dereference in capture_engine Message-ID: Content-Disposition: inline X-ClientProxiedBy: ZRAP278CA0009.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:10::19) To SN6PR11MB2640.namprd11.prod.outlook.com (2603:10b6:805:56::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR11MB2640:EE_|SJ0PR11MB7701:EE_ X-MS-Office365-Filtering-Correlation-Id: c37cd30a-e304-4cef-541a-08dd097480da X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?q?Zx+i8qcy6eb/HDYr89I3RNFdrWyKu2K?= =?utf-8?q?kpcFSxsgJf7pFfVdHmWFqOZdcddZMX/Iad1tfS8i4GUUtvY5zOmORZsgvu0XJsWEZ?= =?utf-8?q?qKEBU+BfuJxembuO1/EqSeqEZJSdClGZ1ttTF7VXvR1ql1BKnzltRsqbRAYg5yx9m?= =?utf-8?q?a53QTCcdmIXA3oLSm4s3def+ykcFEEqCXHVpZh/vZFjwt9YkvzW2qs8d7de6+H6ir?= =?utf-8?q?JtvV9PX3Isg6Nls4YDuO2iS7vkeBknnD/62woQNtU+YoSBsd7B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7mYAoU9kZXmnwgvS4vdRVts2eLQSEy/Egze3Lf2sL?= =?utf-8?q?2rZGNKuPXxmnHzbmf8uGoEeKlQa3sacO1+T5C7MhOZHFB3hMpaTXXt3+1qk7yZvYR?= =?utf-8?q?n035KXZDRhqtoG?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB2640.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?mnK7PNYUTBpdR6YJuuKsRGnrQjuo?= =?utf-8?q?5hZ1dj/clZs0dFbqdFjGwEKkW+IKC5mps65g8HK4PIDRp0CZB07Hg8X7QBttmhfWA?= =?utf-8?q?xo5pNelCYJph9iXlc6pVrQZWVQlUtCo1lVe98M/oiayFIvj+kkAZYccMo5l7JG8P+?= =?utf-8?q?N4DVf4W53mJJ37OobKYso8A9n+DpuE0Bo5gPX4tjY2SgYE28QnicOq20kcdMYRDXk?= =?utf-8?q?YzxyGCYZqWnpPhgaMISvCXZR4rTL8bb/H1tNdkoKsGsMQ661Q5VqsJNRdtcE3hwWe?= =?utf-8?q?6ujewj77Fohz8VuOyncmwRwA1nilbw0Xhh5JVhG7nsiGqrXAPgrTeIttpRjmom9hv?= =?utf-8?q?L9qvcpYs8ON6XzgiLJv63In0IbXZ+8g1yrxHYYyHFbYNaHtOlFp2vmUK/DNsqjEO9?= =?utf-8?q?ctHfOk3eHpfsuTnBFhIg1GExfa1+NqQUvkO1b/WuPEwZg5QaA38W2httFPzbChbGm?= =?utf-8?q?Zae2iPvs4lgCUm+jqmFD8Hv+JF/lp7HuZhEzdR2ATVgpQEIAsX4edALcUsZMql1Dq?= =?utf-8?q?sbEdxLxa6UQc1J6+hqe1SX4EaXuTUpx4/fC33zGEqYUqZJD4nn6eJp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nlGGC?= =?utf-8?q?7YPTMhVlMSFgOFWX2s8rR0f6kPGiiiNZz2qdusaAyOVG/8Sa3dDN44n0P0uIAS80h?= =?utf-8?q?9Zv97w1sHEm6n8POwSjJkK8424zfytzujA=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: c37cd30a-e304-4cef-541a-08dd097480da X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2640.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2024 15:03:34.1848 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 54LzNyBWGGdyUuM/9wES/5HZSFBPPd/ye0MRFP73YY5ptUZzW4bJFbcbhRI/MPIYUp52aaSCT2oZHHt+/GacQA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB7701 X-OriginatorOrg: intel.com 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" When the intel_context structure contains NULL, it raises a NULL pointer dereference error in drm_info(). This patch aims to resolve issue: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12309 Signed-off-by: Eugene Kobyak --- drivers/gpu/drm/i915/i915_gpu_error.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c index 135ded17334e..acf403e4e5d6 100644 --- a/drivers/gpu/drm/i915/i915_gpu_error.c +++ b/drivers/gpu/drm/i915/i915_gpu_error.c @@ -1643,9 +1643,12 @@ capture_engine(struct intel_engine_cs *engine, return NULL; intel_engine_get_hung_entity(engine, &ce, &rq); - if (rq && !i915_request_started(rq)) + if (rq && !i915_request_started(rq)) { + u16 guc_id = ce ? ce->guc_id.id : 0; + drm_info(&engine->gt->i915->drm, "Got hung context on %s with active request %lld:%lld [0x%04X] not yet started\n", - engine->name, rq->fence.context, rq->fence.seqno, ce->guc_id.id); + engine->name, rq->fence.context, rq->fence.seqno, guc_id); + } if (rq) { capture = intel_engine_coredump_add_request(ee, rq, ATOMIC_MAYFAIL);