All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH i-g-t] [RFC] tests/drm_read: Fix subtest invalid-buffer
@ 2021-05-28  4:32 ` Vidya Srinivas
  0 siblings, 0 replies; 11+ messages in thread
From: Vidya Srinivas @ 2021-05-28  4:32 UTC (permalink / raw)
  To: intel-gfx, igt-dev; +Cc: markyacoub, charlton.lin

Using (void *)-1 directly in read is aborting on chrome systems.
Following message is seen.

Starting subtest: invalid-buffer
*** buffer overflow detected ***: terminated
Received signal SIGABRT.
Stack trace:
Aborted (core dumped)

Patch just adds a pointer variable and uses it in read.

Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
---
 tests/drm_read.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/drm_read.c b/tests/drm_read.c
index ccf9d822fd8d..2fdec5be4078 100644
--- a/tests/drm_read.c
+++ b/tests/drm_read.c
@@ -103,10 +103,11 @@ static void teardown(int fd)
 static void test_invalid_buffer(int in)
 {
 	int fd = setup(in, 0);
+	void *add = (void *)-1;
 
 	alarm(1);
 
-	igt_assert_eq(read(fd, (void *)-1, 4096), -1);
+	igt_assert_eq(read(fd, add, 4096), -1);
 	igt_assert_eq(errno, EFAULT);
 
 	teardown(fd);
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2021-06-21 12:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-28  4:32 [Intel-gfx] [PATCH i-g-t] [RFC] tests/drm_read: Fix subtest invalid-buffer Vidya Srinivas
2021-05-28  4:32 ` [igt-dev] " Vidya Srinivas
2021-05-28 13:54 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2021-05-28 23:56 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2021-06-04 18:42 ` [Intel-gfx] [PATCH i-g-t] [RFC] " Mark Yacoub
2021-06-04 18:42   ` [igt-dev] " Mark Yacoub
2021-06-05  5:46   ` [Intel-gfx] " Srinivas, Vidya
2021-06-05  5:46     ` [igt-dev] " Srinivas, Vidya
2021-06-21 10:28 ` [Intel-gfx] " Petri Latvala
2021-06-21 10:28   ` [igt-dev] " Petri Latvala
2021-06-21 12:12   ` Srinivas, Vidya

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.