+ selftests-mm-confirm-va-exhaustion-without-reliance-on-correctness-of-mmap-v2.patch added to mm-unstable branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: selftests-mm-confirm-va-exhaustion-without-reliance-on-correctness-of-mmap-v2
has been added to the -mm mm-unstable branch.  Its filename is
     selftests-mm-confirm-va-exhaustion-without-reliance-on-correctness-of-mmap-v2.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/selftests-mm-confirm-va-exhaustion-without-reliance-on-correctness-of-mmap-v2.patch

This patch will later appear in the mm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Dev Jain <dev.jain@xxxxxxx>
Subject: selftests-mm-confirm-va-exhaustion-without-reliance-on-correctness-of-mmap-v2
Date: Mon, 25 Mar 2024 09:56:53 +0530

replace SZ_1GB with MAP_CHUNK_SIZE, tidy-up

Link: https://lkml.kernel.org/r/20240325042653.867055-1-dev.jain@xxxxxxx
Signed-off-by: Dev Jain <dev.jain@xxxxxxx>
Cc: Anshuman Khandual <anshuman.khandual@xxxxxxx>
Cc: Shuah Khan <shuah@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 tools/testing/selftests/mm/virtual_address_range.c |   15 ++++-------
 1 file changed, 6 insertions(+), 9 deletions(-)

--- a/tools/testing/selftests/mm/virtual_address_range.c~selftests-mm-confirm-va-exhaustion-without-reliance-on-correctness-of-mmap-v2
+++ a/tools/testing/selftests/mm/virtual_address_range.c
@@ -117,19 +117,17 @@ static int validate_complete_va_space(vo
 	prev_end_addr = 0;
 	while (fgets(line, sizeof(line), file)) {
 		unsigned long hop;
-		int ret;
 
-		ret = sscanf(line, "%lx-%lx %s[rwxp-]",
-			     &start_addr, &end_addr, prot);
-		if (ret != 3)
-			ksft_exit_fail_msg("sscanf failed, cannot parse\n");
+		if (sscanf(line, "%lx-%lx %s[rwxp-]",
+			   &start_addr, &end_addr, prot) != 3)
+			ksft_exit_fail_msg("cannot parse /proc/self/maps\n");
 
 		/* end of userspace mappings; ignore vsyscall mapping */
 		if (start_addr & (1UL << 63))
 			return 0;
 
-		/* /proc/self/maps must have gaps less than 1GB only */
-		if (start_addr - prev_end_addr >= SZ_1GB)
+		/* /proc/self/maps must have gaps less than MAP_CHUNK_SIZE */
+		if (start_addr - prev_end_addr >= MAP_CHUNK_SIZE)
 			return 1;
 
 		prev_end_addr = end_addr;
@@ -149,8 +147,7 @@ static int validate_complete_va_space(vo
 		while (start_addr + hop < end_addr) {
 			if (write(fd, (void *)(start_addr + hop), 1) != 1)
 				return 1;
-			else
-				lseek(fd, 0, SEEK_SET);
+			lseek(fd, 0, SEEK_SET);
 
 			hop += MAP_CHUNK_SIZE;
 		}
_

Patches currently in -mm which might be from dev.jain@xxxxxxx are

selftests-mm-virtual_address_range-switch-to-ksft_exit_fail_msg.patch
selftests-mm-confirm-va-exhaustion-without-reliance-on-correctness-of-mmap.patch
selftests-mm-confirm-va-exhaustion-without-reliance-on-correctness-of-mmap-v2.patch
selftests-mm-parse-vma-range-in-one-go.patch





[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux