intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 5.10] gpu/i915: fix error return in mmap_offset_attach()
@ 2025-10-02  8:48 Alexandr Sapozhnkiov
  2025-10-02 13:35 ` ✗ LGCI.VerificationFailed: failure for gpu/i915: fix error return in mmap_offset_attach() (rev2) Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Alexandr Sapozhnkiov @ 2025-10-02  8:48 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, intel-gfx, dri-devel, linux-kernel
  Cc: Alexandr Sapozhnikov, linux-media, lvc-project

From: Alexandr Sapozhnikov <alsp705@gmail.com>

In the drm_vma_node_allow function, kmalloc may 
return NULL, in which case the file element will not be 
added to the mmo->vma_node list. It would be good to 
not ignore this event, but at least log an error message.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Alexandr Sapozhnikov <alsp705@gmail.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_mman.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
index a2195e28b625..adaef8f09d59 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
@@ -706,8 +706,11 @@ mmap_offset_attach(struct drm_i915_gem_object *obj,
 	mmo = insert_mmo(obj, mmo);
 	GEM_BUG_ON(lookup_mmo(obj, mmap_type) != mmo);
 out:
-	if (file)
-		drm_vma_node_allow_once(&mmo->vma_node, file);
+	if (file) {
+		err = drm_vma_node_allow_once(&mmo->vma_node, file);
+		if (err)
+			goto err;
+	}
 	return mmo;
 
 err:
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [PATCH 5.10] gpu/i915: fix error return in mmap_offset_attach()
@ 2025-09-22 14:43 Alexandr Sapozhnkiov
  2025-09-23  9:07 ` Krzysztof Karas
  0 siblings, 1 reply; 10+ messages in thread
From: Alexandr Sapozhnkiov @ 2025-09-22 14:43 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, intel-gfx, dri-devel, linux-kernel
  Cc: Alexandr Sapozhnikov, linux-media, lvc-project

From: Alexandr Sapozhnikov <alsp705@gmail.com>

Return value of function 'drm_vma_node_allow', called 
at i915_gem_mman.c:670, is not checked, but it is usually 
checked for this function

Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Alexandr Sapozhnikov <alsp705@gmail.com>

---
 drivers/gpu/drm/i915/gem/i915_gem_mman.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
index a2195e28b625..adaef8f09d59 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
@@ -706,8 +706,11 @@ mmap_offset_attach(struct drm_i915_gem_object *obj,
 	mmo = insert_mmo(obj, mmo);
 	GEM_BUG_ON(lookup_mmo(obj, mmap_type) != mmo);
 out:
-	if (file)
-		drm_vma_node_allow_once(&mmo->vma_node, file);
+	if (file) {
+		err = drm_vma_node_allow_once(&mmo->vma_node, file);
+		if (err)
+			goto err;
+	}
 	return mmo;
 
 err:
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-10-07 21:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-02  8:48 [PATCH 5.10] gpu/i915: fix error return in mmap_offset_attach() Alexandr Sapozhnkiov
2025-10-02 13:35 ` ✗ LGCI.VerificationFailed: failure for gpu/i915: fix error return in mmap_offset_attach() (rev2) Patchwork
2025-10-02 13:55 ` [PATCH 5.10] gpu/i915: fix error return in mmap_offset_attach() Rodrigo Vivi
2025-10-02 15:20   ` Ville Syrjälä
2025-10-02 16:59     ` Ville Syrjälä
2025-10-07 10:14 ` Andi Shyti
2025-10-07 21:23   ` Petr Vorel
  -- strict thread matches above, loose matches on Subject: below --
2025-09-22 14:43 Alexandr Sapozhnkiov
2025-09-23  9:07 ` Krzysztof Karas
2025-09-24 11:31   ` Александр C

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).