From: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
To: lucas.demarchi@intel.com, thomas.hellstrom@linux.intel.com,
rodrigo.vivi@intel.com
Cc: airlied@gmail.com, simona@ffwll.ch,
intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org,
Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
Subject: [PATCH] drm/xe: Fix uninitialized pointer read in xe_vm_bind_kernel_bo
Date: Thu, 6 Feb 2025 19:17:06 +0530 [thread overview]
Message-ID: <20250206134706.60200-1-dheeraj.linuxdev@gmail.com> (raw)
xe_vm_bind_kernel_bo() declares the variable fence without initializing
it. If an error occurs before fence is assigned a valid value, the
function may return an uninitialized pointer.
Specifically, this can happen if:
- vm_bind_ioctl_ops_create() fails, leading to release_vm_lock error
path
Initialize fence to NULL at declaration.
Fixes: dcdd6b84d9ac ("drm/xe/pxp: Allocate PXP execution resources")
Signed-off-by: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
---
drivers/gpu/drm/xe/xe_vm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
index d664f2e418b2..b6ca53ede904 100644
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -3184,7 +3184,7 @@ struct dma_fence *xe_vm_bind_kernel_bo(struct xe_vm *vm, struct xe_bo *bo,
{
struct xe_vma_ops vops;
struct drm_gpuva_ops *ops = NULL;
- struct dma_fence *fence;
+ struct dma_fence *fence = NULL;
int err;
xe_bo_get(bo);
--
2.34.1
next reply other threads:[~2025-02-06 15:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-06 13:47 Dheeraj Reddy Jonnalagadda [this message]
2025-02-06 16:33 ` [PATCH] drm/xe: Fix uninitialized pointer read in xe_vm_bind_kernel_bo Cavitt, Jonathan
2025-02-06 16:58 ` Lucas De Marchi
2025-02-06 17:17 ` ✓ CI.Patch_applied: success for " Patchwork
2025-02-06 17:18 ` ✓ CI.checkpatch: " Patchwork
2025-02-06 17:19 ` ✓ CI.KUnit: " Patchwork
2025-02-06 17:35 ` ✓ CI.Build: " Patchwork
2025-02-06 17:38 ` ✓ CI.Hooks: " Patchwork
2025-02-06 17:39 ` ✓ CI.checksparse: " Patchwork
2025-02-06 17:58 ` ✓ Xe.CI.BAT: " Patchwork
2025-02-06 19:25 ` ✓ Xe.CI.Full: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250206134706.60200-1-dheeraj.linuxdev@gmail.com \
--to=dheeraj.linuxdev@gmail.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lucas.demarchi@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=simona@ffwll.ch \
--cc=thomas.hellstrom@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox