From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 453797083C for ; Mon, 27 Apr 2026 16:37:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777307869; cv=none; b=u+cXHlJ0gRK5/V7h0OPi5sDeKBypWCT/0KnuXtccKyZVsshuWHXLTMDC9nk7nIB9IFRLfw+X7r1zKfov+9DsU6T7/lT+SwohUJyRS1vT6eEEsnGF6o9EEoDqYtI2xmPrDzb86ehfsXJFb0CVAS3h9deyOkXMZjubgYALZeUl+DI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777307869; c=relaxed/simple; bh=1zPHfrVMHA7wFmNJXcsWLC8g9Pa6cpkdfSEI5HoBwl4=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=AXjMX60kjdBWImnDF+Vy0Zi5PQYyoiHaBeUpO+ZvLHgaT16bfwELY7TIKSOlKBqH3ZRj3v/R8U6OXL+n33v+A1CZpZqFRZN+Y+qdc5xwzfw5SSm3P8rXkoIu6ZIMzFSqffnp561zm5fHHXYQiPgb0USxCdlM+1GZJgpsGTNSxGs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=wstXqnZA; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="wstXqnZA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F383CC19425; Mon, 27 Apr 2026 16:37:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777307869; bh=1zPHfrVMHA7wFmNJXcsWLC8g9Pa6cpkdfSEI5HoBwl4=; h=Subject:To:Cc:From:Date:From; b=wstXqnZACSBf4SUDvelo8jXvHUclpqtdulivdYn6Xcv1DVPQsh+UA3Z6uf27cfdM9 N+6PQEgsOjSwIcJgtO7koOkYEWaaAlm+nUiqAz/p+6l1N1X6r6c7awgZwsZOvwL0ed ON2gCJavzOfIB1wqYhYaHV9vUWahQ5Hkw9zN04Qk= Subject: FAILED: patch "[PATCH] drm/nouveau: fix u32 overflow in pushbuf reloc bounds check" failed to apply to 5.10-stable tree To: gregkh@linuxfoundation.org,airlied@gmail.com,dakr@kernel.org,lyude@redhat.com,maarten.lankhorst@linux.intel.com,mripard@kernel.org,simona@ffwll.ch,stable@kernel.org,tzimmermann@suse.de Cc: From: Date: Mon, 27 Apr 2026 10:37:12 -0600 Message-ID: <2026042712-extrovert-oblong-a615@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.10-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y git checkout FETCH_HEAD git cherry-pick -x 2fc87d37be1b730a149b035f9375fdb8cc5333a5 # git commit -s git send-email --to '' --in-reply-to '2026042712-extrovert-oblong-a615@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 2fc87d37be1b730a149b035f9375fdb8cc5333a5 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 20 Apr 2026 21:16:09 +0200 Subject: [PATCH] drm/nouveau: fix u32 overflow in pushbuf reloc bounds check nouveau_gem_pushbuf_reloc_apply() validates each relocation with if (r->reloc_bo_offset + 4 > nvbo->bo.base.size) but reloc_bo_offset is __u32 (uapi/drm/nouveau_drm.h) and the integer literal 4 promotes to unsigned int, so the addition is performed in 32 bits and wraps before the comparison against the size_t bo size. Cast to u64 so the addition happens in 64-bit arithmetic. Cc: Lyude Paul Cc: Danilo Krummrich Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Simona Vetter Reported-by: Anthropic Cc: stable Assisted-by: gkh_clanker_t1000 Fixes: a1606a9596e5 ("drm/nouveau: new gem pushbuf interface, bump to 0.0.16") Signed-off-by: Greg Kroah-Hartman [ Add Fixes: tag. - Danilo ] Signed-off-by: Danilo Krummrich diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index 82621ede42e1..20dba02d6175 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c @@ -686,7 +686,7 @@ nouveau_gem_pushbuf_reloc_apply(struct nouveau_cli *cli, } nvbo = (void *)(unsigned long)bo[r->reloc_bo_index].user_priv; - if (unlikely(r->reloc_bo_offset + 4 > + if (unlikely((u64)r->reloc_bo_offset + 4 > nvbo->bo.base.size)) { NV_PRINTK(err, cli, "reloc outside of bo\n"); ret = -EINVAL;