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 A645DCD4F39 for ; Thu, 14 May 2026 20:52:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4BFE510E009; Thu, 14 May 2026 20:52:15 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="KwX0tmBP"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5612010E009 for ; Thu, 14 May 2026 20:52:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1778791934; x=1810327934; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=qRPMPcdaD5MDxeOvbNbUuXwVQgynW4oqc7x3m8bax/8=; b=KwX0tmBPY/q+b30u1uG8vVf/tc08XZkmsVfq/tDbinVGvrVlQybDgbqM tnbzqBI4HPzbKSbMyp0Yjw7CzM9LZHwGOXJ46dCsGg2JJLM0MZ2HhAGMD TLHmT8KHg6tIpBEr2eL3ajK2TXmhLvLS3tSXjYZToBSblGpFJTIa7lCqv rLnW211mwtqQBYu8ud1S+zastQwjtJDsR30i1jk+kySK5QqAeo+joGDGA c3jaL3SFHj5j/S2CFpqpNtvXJYV0f4iZapOTfS/aauNCZoieM2dH4OVhX jC/68AwoDR3i63VFRTyyfw9geaH0dVWrHmY+LnP0gQYE1GaD3tauInMuS w==; X-CSE-ConnectionGUID: MIIj75+6Rh+FIcy9VXMbXg== X-CSE-MsgGUID: R87q6ZKTTa6dTYrFCf1/+g== X-IronPort-AV: E=McAfee;i="6800,10657,11786"; a="79460070" X-IronPort-AV: E=Sophos;i="6.23,235,1770624000"; d="scan'208";a="79460070" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 May 2026 13:52:13 -0700 X-CSE-ConnectionGUID: D2HZ9XYQSxyCetSY2TjVGg== X-CSE-MsgGUID: apxEILbpQyKFCNOdf9HsSg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,235,1770624000"; d="scan'208";a="232097468" Received: from chussx-mobl.amr.corp.intel.com (HELO adixit-MOBL3.intel.com) ([10.125.35.95]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 May 2026 13:52:12 -0700 Date: Thu, 14 May 2026 13:52:11 -0700 Message-ID: <87mry1u32c.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Shuicheng Lin Cc: , Umesh Nerlige Ramappa Subject: Re: [PATCH] drm/xe/oa: Fix exec_queue leak on width check in stream open In-Reply-To: <20260514203210.593488-1-shuicheng.lin@intel.com> References: <20260514203210.593488-1-shuicheng.lin@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" On Thu, 14 May 2026 13:32:10 -0700, Shuicheng Lin wrote: > > In xe_oa_stream_open_ioctl(), when param.exec_q->width > 1 the > function returns -EOPNOTSUPP directly, skipping the existing > err_exec_q cleanup path. The exec_queue reference obtained by > xe_exec_queue_lookup() is leaked. > > The exec queue holds a reference on the xe_file, which is only > dropped during queue teardown. The leaked lookup ref is not on > the file's exec_queue xarray, so file close cannot release it. > This keeps both the exec queue and the file private state pinned > indefinitely. > > Jump to err_exec_q instead of returning directly so the reference > is released. > > Fixes: f0ed39830e60 ("xe/oa: Fix query mode of operation for OAR/OAC") > Assisted-by: Claude:claude-opus-4.6 > Signed-off-by: Shuicheng Lin Reviewed-by: Ashutosh Dixit > --- > Cc: Umesh Nerlige Ramappa > Cc: Ashutosh Dixit > --- > drivers/gpu/drm/xe/xe_oa.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c > index 7c9071abb44f..4bf4b1f65929 100644 > --- a/drivers/gpu/drm/xe/xe_oa.c > +++ b/drivers/gpu/drm/xe/xe_oa.c > @@ -2051,8 +2051,10 @@ int xe_oa_stream_open_ioctl(struct drm_device *dev, u64 data, struct drm_file *f > if (XE_IOCTL_DBG(oa->xe, !param.exec_q)) > return -ENOENT; > > - if (XE_IOCTL_DBG(oa->xe, param.exec_q->width > 1)) > - return -EOPNOTSUPP; > + if (XE_IOCTL_DBG(oa->xe, param.exec_q->width > 1)) { > + ret = -EOPNOTSUPP; > + goto err_exec_q; > + } > } > > /* > -- > 2.43.0 >