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 56B6E3090C6 for ; Sun, 1 Mar 2026 01:53:40 +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=1772330020; cv=none; b=ABIsvlQUxCbLITQByyYCyn3DsCICJ6PypLoxaQxkJ9aaicVaTnqIzjRSJW9Beex8ZNt6+/ZnjzvUuqPMKlC8wCpxb2xXF2gpeTfpqqh+o+0Bg2QXCfHZtXBrkE/lK+/H2M4hHStb+rn/CzLt0yxjinseR2LBIm7JLjYbvtkNPsE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772330020; c=relaxed/simple; bh=xin4LD1zkcTUk3xfa5v9+DBki7RWsCYixy+PVV9CGZo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=dehCiqMsAGoNlib6LY52Bz/f3d+/C43M4T3nWwFyb/SKKhmKx8TzGQW80+0SmmaPr2WHV6/jz4yH2qkR2h954CbWcGmnIBoDhLWWOynqLmdNsaOGVbq374Pee8YGvjOOh+YYlPu4DN/vepeiS4Gz4KD1B3EWzVp0G+fCE0R7Rhk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=psnmTdVg; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="psnmTdVg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88FB8C19421; Sun, 1 Mar 2026 01:53:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772330020; bh=xin4LD1zkcTUk3xfa5v9+DBki7RWsCYixy+PVV9CGZo=; h=From:To:Cc:Subject:Date:From; b=psnmTdVghd7fgVBnGTUmeID2sKs0dnSkdXicoffOBIpCxLoMBDPibfhyKbOYhMahK DZwsKduTehduGvTOq6bSMB65dV1A9JvJdr//vq54ley2rIY+D4ADAeAAVsO0t194Xy o2HA/RsgZ+RW3PC0wFg0UhkERUmtkP8fLMG4cfOj/YM4jVdgrDoMFAJyku0zvFbfmt bI3b4Jzm5uFtk2+9msCeulul9/AbQfV1GDoGuHuz30HovIw59XPAB2WnKgRq3kIiaQ wLxi8BQ+j7pOcWHNg4V/o53tFe4dL0yUyQUxohiIhqPmlgP3DK8PIYZwmXfcX4bYD/ Z2ztvnfv87PIg== From: Sasha Levin To: stable@vger.kernel.org, Sunday.Clement@amd.com Cc: Alexander Deucher , Alex Deucher , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: FAILED: Patch "drm/amdkfd: Fix out-of-bounds write in kfd_event_page_set()" failed to apply to 5.15-stable tree Date: Sat, 28 Feb 2026 20:53:38 -0500 Message-ID: <20260301015338.1720466-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Hint: ignore X-stable: review Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.15-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 . Thanks, Sasha ------------------ original commit in Linus's tree ------------------ From 8a70a26c9f34baea6c3199a9862ddaff4554a96d Mon Sep 17 00:00:00 2001 From: Sunday Clement Date: Mon, 2 Feb 2026 12:41:39 -0500 Subject: [PATCH] drm/amdkfd: Fix out-of-bounds write in kfd_event_page_set() The kfd_event_page_set() function writes KFD_SIGNAL_EVENT_LIMIT * 8 bytes via memset without checking the buffer size parameter. This allows unprivileged userspace to trigger an out-of bounds kernel memory write by passing a small buffer, leading to potential privilege escalation. Signed-off-by: Sunday Clement Reviewed-by: Alexander Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org --- drivers/gpu/drm/amd/amdkfd/kfd_events.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_events.c b/drivers/gpu/drm/amd/amdkfd/kfd_events.c index 1ad312af8ff0c..13416bff77636 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_events.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_events.c @@ -331,6 +331,12 @@ static int kfd_event_page_set(struct kfd_process *p, void *kernel_address, if (p->signal_page) return -EBUSY; + if (size < KFD_SIGNAL_EVENT_LIMIT * 8) { + pr_err("Event page size %llu is too small, need at least %lu bytes\n", + size, (unsigned long)(KFD_SIGNAL_EVENT_LIMIT * 8)); + return -EINVAL; + } + page = kzalloc(sizeof(*page), GFP_KERNEL); if (!page) return -ENOMEM; -- 2.51.0