FAILED: patch "[PATCH] accel/amdxdna: reject command submission on devices without a" failed to apply to 6.18-stable tree
[email protected]
maintainerThe patch below does not apply to the 6.18-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 <[email protected]>.
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-6.18.y
git checkout FETCH_HEAD
git cherry-pick -x 38953513d7313992676d4136cd425cdb70c6278e
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026072030-chastity-composed-e7c9@gregkh' --subject-prefix 'PATCH 6.18.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 38953513d7313992676d4136cd425cdb70c6278e Mon Sep 17 00:00:00 2001
From: Doruk Tan Ozturk <[email protected]>
Date: Mon, 13 Jul 2026 19:30:29 +0200
Subject: [PATCH] accel/amdxdna: reject command submission on devices without a
submit op
amdxdna_cmd_submit() calls xdna->dev_info->ops->cmd_submit() unconditionally, but only aie2_dev_ops defines that callback. aie4_vf_ops (the AIE4 SR-IOV virtual function) does not, so a user AMDXDNA_EXEC_CMD ioctl on an AIE4 device reaches a NULL function-pointer call and oopses the kernel. AIE4 submits work through a mapped user queue and doorbell, not this ioctl path.
Reject the submission early with -EOPNOTSUPP when the device provides no cmd_submit op, so the shared EXEC ioctl is a clean no-op on such devices.
Found by 0sec automated security-research tooling (https://0sec.ai).
drivers/accel/amdxdna/amdxdna_ctx.c +4 -0
@@ -590,6 +590,10 @@ int amdxdna_cmd_submit(struct amdxdna_client *client,int ret, idx;XDNA_DBG (xdna,"Command BO hdl %d, Arg BO count %d" , cmd_bo_hdl, arg_bo_cnt); + +if (!xdna->dev_info->ops->cmd_submit) +return -EOPNOTSUPP ; + job =kzalloc_flex (*job, bos, arg_bo_cnt);if (!job)return -ENOMEM ;
Sasha Levin
maintainerPATCH 1/1 accel/amdxdna: reject command submission on devices without a submit op
From: Doruk Tan Ozturk <[email protected]>
[ Upstream commit 38953513d7313992676d4136cd425cdb70c6278e ]
amdxdna_cmd_submit() calls xdna->dev_info->ops->cmd_submit() unconditionally, but only aie2_dev_ops defines that callback. aie4_vf_ops (the AIE4 SR-IOV virtual function) does not, so a user AMDXDNA_EXEC_CMD ioctl on an AIE4 device reaches a NULL function-pointer call and oopses the kernel. AIE4 submits work through a mapped user queue and doorbell, not this ioctl path.
Reject the submission early with -EOPNOTSUPP when the device provides no cmd_submit op, so the shared EXEC ioctl is a clean no-op on such devices.
Found by 0sec automated security-research tooling (https://0sec.ai).
--- drivers/accel/amdxdna/amdxdna_ctx.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/accel/amdxdna/amdxdna_ctx.c +4 -0
@@ -405,6 +405,10 @@ int amdxdna_cmd_submit(struct amdxdna_client *client,int ret, idx;XDNA_DBG (xdna,"Command BO hdl %d, Arg BO count %d" , cmd_bo_hdl, arg_bo_cnt); + +if (!xdna->dev_info->ops->cmd_submit) +return -EOPNOTSUPP ; + job =kzalloc (struct_size (job, bos, arg_bo_cnt),GFP_KERNEL );if (!job)return -ENOMEM ;
Signature · 1 line
2.53.0