From patchwork Tue Nov 19 17:16:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugene Kobyak X-Patchwork-Id: 13880317 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 CB403D62077 for ; Tue, 19 Nov 2024 17:17:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2092610E690; Tue, 19 Nov 2024 17:17:15 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="SwvBLa+T"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id D319310E690 for ; Tue, 19 Nov 2024 17:17:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732036633; x=1763572633; h=date:from:to:subject:message-id:mime-version; bh=rtLz8/jVG478dqQ+TVV0jcxwG4tTUqQmmI2qdt26hGU=; b=SwvBLa+TuE/HeTlL122n9QGLedoZRrCk0MQoGC+5Vq6gAkRsEnAqZRm2 xGqVGqfGnxR1DhrYAFU53J2B5bEZCcr94ljqvaufG+Emy3lmGVnVivEYS sTe17T8R+wcmuPKJ/48g8R4b2utBpMdnGjYobcMkGlW3voETbEmS8JUlG d67fRATdWKUETSV1qjGpTtYpeTdADd9NThIfvHsrEShlFc47v89800wDf fF60d2MRhcVhqEGUM4bgej1JEGiVOkzLrSnBjZSfTmFuXB8J99IP6tnQw 3c1hYFSyzQc7lpYZ9g93R7jGU0ohoFD7a+yF94Z+nBAnY6WRMhhgj8chd A==; X-CSE-ConnectionGUID: J+/aXwF9TpCOPC/y+A1esg== X-CSE-MsgGUID: 4kYlmES5S+ux0VDfTtmi/A== X-IronPort-AV: E=McAfee;i="6700,10204,11261"; a="35837538" X-IronPort-AV: E=Sophos;i="6.12,166,1728975600"; d="scan'208";a="35837538" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Nov 2024 09:16:53 -0800 X-CSE-ConnectionGUID: 1OjizV+0RxONBHKIPhCSyQ== X-CSE-MsgGUID: JQICxmOUT+WEWb85qvgUSg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,166,1728975600"; d="scan'208";a="127164615" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orviesa001.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 19 Nov 2024 09:16:53 -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; Tue, 19 Nov 2024 09:16:52 -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; Tue, 19 Nov 2024 09:16:52 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.168) 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; Tue, 19 Nov 2024 09:16:52 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ikrudeEO14fAUVtQR8XaiDNvzL1dHrSaWtreN/EFjuF5bal5dc9/8HOqrDWoMnoh/7CMAFv+vQ6H/qPoQRUybJgOBY8rSSD0+uNkF2p5XbY8HW8nZNNpI6v6NAfU++esmeA5gkif9z1Ur90Q2YWo8OcxLE5E2uk8VOjXOxq/Q+2SJNzO4H06TrDK6igravZt6kkVZoFfNSAkjzQJxKlAzZ7giiux/9/cK1+3yf2fw8yLbNv/lhYc4AcuI4OPkiXopEJh4bx1VnTIXF8NmiXlAWybGfMVGk1T4fqcv5HfNvciQvJN6FlHPbSjiRD6KbXjQG8WSDObvMH76t3jsZozxQ== 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=80iIZb+ruvi/krX296MKB8y4dChVUL07Cs2fGxZowD8=; b=crFw6KtvqMvrglO1w+ZhRXatgnBDj8B5blTK5M/gFIoro51JnKmD8w9kkAyRZf89a/FqDLuyEJNmwAMu8qKmIolwXaAhixmWVXRAgnC9/RtVlSVQ9ZAPHng3um6ZaTO5MNciaCroXd5oZSgehAxztQwhpjWU+PfZU1GUj8thunFc5QJfj511l8ly0bM/oxq7MZrIVh1Mx9BEW3lry2lMUY7tN1sIkl0vE9SY6iSRPv+W0sV0cPk9118ojj9YPAVxk8up9KciQWKFfTj8IPDdbM+hZKj/v6PP0t8Qa3NwUMAHmq0cx2cBcldxc9L0nAJGfoqSzUJASfhVV7magBZwBA== 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 SA1PR11MB6685.namprd11.prod.outlook.com (2603:10b6:806:258::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.22; Tue, 19 Nov 2024 17:16:49 +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; Tue, 19 Nov 2024 17:16:49 +0000 Date: Tue, 19 Nov 2024 17:16:44 +0000 From: Eugene Kobyak To: Subject: [PATCH] drm/i915: Fixed NULL pointer dereference in capture_engine Message-ID: <5a42bhkoaoed2mky6343qz35pdyzfz6pqgyczrywqgwb4ezipv@be2aiql3bmih> Content-Disposition: inline X-ClientProxiedBy: MI0P293CA0003.ITAP293.PROD.OUTLOOK.COM (2603:10a6:290:44::9) To SN6PR11MB2640.namprd11.prod.outlook.com (2603:10b6:805:56::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR11MB2640:EE_|SA1PR11MB6685:EE_ X-MS-Office365-Filtering-Correlation-Id: a2c5c1fe-a324-441b-a1b0-08dd08bdf3be X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?q?NOGdaFj3Gol30HU04LyUR+zkKEjrR+D?= =?utf-8?q?cnrIYoJG8zYx9QnQwzdfeZVXgSBz9f6GqT9y68VyO4VcfudmOhCttcrZ9ZMQj/4Xu?= =?utf-8?q?RjEMoFs59TIJ2IbmIjMXJ4W5hpRkJAv/M4XzdJUyeT2OjxbQzzCxG6s85oqhsuvlk?= =?utf-8?q?pB5SxC8OZvpLNcngMOG8I1sstn09BzLV4OcWjNmiDXx43wMe/IxhcxaLnIMiqTNg1?= =?utf-8?q?HuVmcfN6RG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ZRItHteqlyTvSZTuL7q3WxEdx6nnQhBTdaPXq4P+MBln5oUV016?= =?utf-8?q?QSAhITwk1CWeZVSIH5NkUjoWaL26iQSzoGPW67BT/Bo7AmHPeRF+YZnbdE6IY8U6s?= =?utf-8?q?Z/Mii1sn2n5iwd?= 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)(1800799024)(376014)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?JXBNTa0fB3NAD9t/wc+xEs56gLlu?= =?utf-8?q?j19aFmTn85+BZnqp2ZGRG2TpQg39enoX/24N73XetafyszjjFbSeGo4m3BhmvggbM?= =?utf-8?q?6Zk0MWKKhZgmbxTzUjhC/nT0YTSLdb62iG37SVkCBKBPM2I66yvG4k3S8+zGow3yD?= =?utf-8?q?taYoSzkJ3lZfiypm4k5e7XSlYyax+bMTh0VkN990YJCdWorIsGvU+9Nv6Ydc1I/Dc?= =?utf-8?q?29mXRzdwoP/6k132wqaw4BEO7NnGb7hwRTpe7UuYJZNOQwKqmvAJ9MltENj51lGhO?= =?utf-8?q?0lojn83DSlDRuXGWcF+XSuYqInYlSU5vPJHQ6y4x/PA5szhqkZa2kpQisU1v6elhr?= =?utf-8?q?i8RTwbmG/k6o5+zpu5LOLiX12TKfP6v9OGO0684o+xWmuEbI7GFi/COL18g8OjKf0?= =?utf-8?q?pOHKY3bhThbebYqXnp5Loo12j/y2zmx0P4Q8x7SyKWiLuYHhpwySI3pJyCx26Zxmw?= =?utf-8?q?0gc8P7OaXvxJswtEInmYwUkdy7I0tyog51WdXsgfVGcuR+4wwT73ahGSaZTIQDChI?= =?utf-8?q?QTMGSaCMCPcINTRXv6M54kuFMlG1IB6Z/mCzu77R+Rti314TtxBwXgh8+xEl3F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= =?utf-8?q?ezW8OkKEC4doqTfmRkLgFzc5uolqi2N6jYb5bXFkwkGYqb0RRvGEqqC1BzhWfRXTn?= =?utf-8?q?mngWDFuOoTHy+noLdbGxjbNG7bXJj2NomA=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: a2c5c1fe-a324-441b-a1b0-08dd08bdf3be X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2640.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2024 17:16:48.9908 (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: XwRuFFAgMo3ZV+8EmFzodGDpNQ54lpMr7O/zfVEXvafM0VbPy/qyp+4qEKhKNRBUlamlkQDEhKc/TLsUNSVhfg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB6685 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 Reviewed-by: Andi Shyti --- drivers/gpu/drm/i915/i915_gpu_error.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c index 135ded17334e..b00651ad8515 100644 --- a/drivers/gpu/drm/i915/i915_gpu_error.c +++ b/drivers/gpu/drm/i915/i915_gpu_error.c @@ -1643,11 +1643,13 @@ capture_engine(struct intel_engine_cs *engine, return NULL; intel_engine_get_hung_entity(engine, &ce, &rq); - if (rq && !i915_request_started(rq)) - 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); - if (rq) { + if (!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, guc_id); + } capture = intel_engine_coredump_add_request(ee, rq, ATOMIC_MAYFAIL); i915_request_put(rq); } else if (ce) {