- uml-fix-proc-mounts-parsing-boundary-condition.patch removed from -mm tree

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

 



The patch titled

     uml: fix /proc/mounts parsing boundary condition

has been removed from the -mm tree.  Its filename is

     uml-fix-proc-mounts-parsing-boundary-condition.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
Subject: uml: fix /proc/mounts parsing boundary condition
From: Jeff Dike <jdike@xxxxxxxxxxx>

When parsing /proc/mounts looking for a tmpfs mount on /dev/shm, if a string
that we are looking for if split across reads, then it won't be recognized.

Fix this by refilling the buffer whenever we advance the cursor.

Signed-off-by: Jeff Dike <jdike@xxxxxxxxxxx>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@xxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 arch/um/os-Linux/mem.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff -puN arch/um/os-Linux/mem.c~uml-fix-proc-mounts-parsing-boundary-condition arch/um/os-Linux/mem.c
--- a/arch/um/os-Linux/mem.c~uml-fix-proc-mounts-parsing-boundary-condition
+++ a/arch/um/os-Linux/mem.c
@@ -55,7 +55,7 @@ static void __init find_tempdir(void)
  */
 static int next(int fd, char *buf, int size, char c)
 {
-	int n;
+	int n, len;
 	char *ptr;
 
 	while((ptr = strchr(buf, c)) == NULL){
@@ -69,7 +69,17 @@ static int next(int fd, char *buf, int s
 	}
 
 	ptr++;
-	memmove(buf, ptr, strlen(ptr) + 1);
+	len = strlen(ptr);
+	memmove(buf, ptr, len + 1);
+
+	/* Refill the buffer so that if there's a partial string that we care
+	 * about, it will be completed, and we can recognize it.
+	 */
+	n = read(fd, &buf[len], size - len - 1);
+	if(n < 0)
+		return -errno;
+
+	buf[len + n] = '\0';
 	return 1;
 }
 
_

Patches currently in -mm which might be from jdike@xxxxxxxxxxx are

origin.patch
uml-make-copy__user-atomic.patch
uml-fix-not_dead_yet-when-directory-is-in-bad-state.patch
uml-rename-and-improve-actually_do_remove.patch
uml-remove-pte_mkexec.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

  Powered by Linux