From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796380641; b=XQhNMXvvndpQNjWl6FFxxRovaePJDNfQl5kmp9UX/Iy1Wffjd3CByk2NQT/IjiA42ZeW KVe7BRKsT3E4WQvEbzoYHNOTJQXjnHJkrHfQRYf5H4PbCFfP6vhDNFO4Mt6X/qNftVRhB 38FDUnMJVFxgoZLQBeG7MHNSWmLMt7ka1G+0esIBmqQp1cEjOYlv52lC7EZiaFgyZgMzp iKpOXlIPEd7/AXKLY5IksP5Cy3SgiLBI/EPAJJhMg5tJlBdtTvRmaB7mHf3W5eB+pTsVI jLg5pCt5FW//jME80aV0RxGpa0oPtE9vSBmlmorPmTcW2uX59F4o2277sXvDwsYLDtQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380641; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=go8wgNInJQUMw/UDn33if/EhdnQ1sYwHiAQnA54Ky68=; b=TWM+OST6F2ycFIlj4M8zUsbklEe+BkNqnitNanwcXOBrtQRC4u6XFJLnireqwQPAVTj1 2DxvgQf7bEdk19IUYdhiTLvoAUUpaFYXT+BypYL++MZA565TOVr8NJzbq41OaZpYBNz0T +EWUQLQ0+do1cL2bPRDOkHZ0KR/3n3WKhiLdKIVZayxJvon6O9EO/1jVtXB8Y22rV2BNA ekfCK4MasQ7HeEH5IVAhLdU58ru90paHV/7mco95apayV4mzaxdWLYbutaJlTCNRUthWP TQSTkjB+DOnQmt1tHKW9oFsgb4oRPsMhrTwOgMc05VvvUCrg0LrXZhaHXxrfj+YJ5oQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=mbblL7xD; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D52E606A33F; Fri, 4 Dec 2026 10:37:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=mbblL7xD Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D8C61F000CE; Fri, 4 Dec 2026 10:37:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380640; bh=go8wgNInJQUMw/UDn33if/EhdnQ1sYwHiAQnA54Ky68=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=mbblL7xDq+N8OJKo9GtiI0NhScE2fDRnATZwszGIUUQxvh6dtUTVctYqs+UbESCGw BeEQ3h/IhmBXfnFhLJY2ZOF1BkZGVPsa3uZidFYnW3E2ikDrFgjsc5PqykoxbOioY3 Hc1vVRTA0ImEUu/tvq9CUCcPi0S+iqtpdx8LOADw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sashiko , Matthew Auld , Alan Previn , Tejas Upadhyay , Matthew Brost , Dave Airlie Subject: [PATCH 7.3 363/742] drm/xe/madvise: use already clamped pat_index Date: Fri, 4 Dec 2026 19:03:47 +0900 Message-ID: <20261204100644.725412156@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Matthew Auld commit eeae08f98bda4350baa5a76f37b23fab4fa426f7 upstream. Pass the nospec-clamped pat_index to check_pat_args_are_sane() instead of the raw args->pat_index.val, and fold into the preceding DRM_XE_MEM_RANGE_ATTR_PAT block. Assisted-by: LLM Reported-by: Sashiko Closes: https://sashiko.dev/#/message/sashiko-outbox-172627%40kernel.org Fixes: 016ccdb674b8 ("drm/xe/uapi: Reject coh_none PAT index for CPU cached memory in madvise") Signed-off-by: Matthew Auld Cc: Alan Previn Cc: Tejas Upadhyay Cc: # v7.2+ Reviewed-by: Matthew Brost Reviewed-by: Tejas Upadhyay Link: https://patch.msgid.link/20261015103415.442931-2-matthew.auld@intel.com (cherry picked from commit 3be1bd59ced603d2e6a6ba9a4fe274308cea9965) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/xe/xe_vm_madvise.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/drivers/gpu/drm/xe/xe_vm_madvise.c +++ b/drivers/gpu/drm/xe/xe_vm_madvise.c @@ -659,11 +659,8 @@ int xe_vm_madvise_ioctl(struct drm_devic err = -EINVAL; goto free_vmas; } - } - if (args->type == DRM_XE_MEM_RANGE_ATTR_PAT) { - if (!check_pat_args_are_sane(xe, &madvise_range, - args->pat_index.val)) { + if (!check_pat_args_are_sane(xe, &madvise_range, pat_index)) { err = -EINVAL; goto free_vmas; }