All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/1] munmap04: Fix 'base' overflow
@ 2025-07-31 14:35 Petr Vorel
  2025-07-31 14:44 ` Ricardo B. Marlière via ltp
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Petr Vorel @ 2025-07-31 14:35 UTC (permalink / raw)
  To: ltp; +Cc: Ricardo B . Marlière, Andrea Cervesato

Lower down a base to fix overflow on 32 bit:

munmap04.c:18:25: warning: conversion from ‘long long unsigned int’ to
‘uintptr_t’ {aka ‘unsigned int’} changes value from ‘4294967296’ to ‘0’ [-Woverflow]
   18 | static uintptr_t base = 0x100000000UL;
      |                         ^~~~~~~~~~~~~

Fixes: 1e2c98e3af ("Add munmap04 to check ENOMEM")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Hi,

I'm not sure how this influences recent fixes. And how the base address
was actually chosen (just random memory location?).

Kind regards,
Petr

 testcases/kernel/syscalls/munmap/munmap04.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/munmap/munmap04.c b/testcases/kernel/syscalls/munmap/munmap04.c
index 987a7c7e7a..e1b67aeee3 100644
--- a/testcases/kernel/syscalls/munmap/munmap04.c
+++ b/testcases/kernel/syscalls/munmap/munmap04.c
@@ -15,7 +15,7 @@
 #define MEMSIZE 3
 #define MAP_MAX_COUNT 65530
 
-static uintptr_t base = 0x100000000UL;
+static uintptr_t base = 0x10000000UL;
 static size_t page_sz;
 static unsigned long vma_size;
 static int map_count;
-- 
2.50.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2025-08-01 13:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-31 14:35 [LTP] [PATCH 1/1] munmap04: Fix 'base' overflow Petr Vorel
2025-07-31 14:44 ` Ricardo B. Marlière via ltp
2025-07-31 17:16 ` Andrea Cervesato via ltp
2025-08-01 13:01 ` Petr Vorel

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.