+ uml-fix-proc-mounts-parsing-boundary-condition.patch added to -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 added to the -mm tree.  Its filename is

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

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
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 files 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
fix-the-init_env_arg_limit-dependencies.patch
uml-fix-proc-mounts-parsing-boundary-condition.patch
uml-fix-off-by-one-bug-in-vm-file-creation.patch
uml-remove-pte_mkexec.patch
uml-unregister-useless-console-when-its-not-needed.patch
uml-add-locking-to-xtime-accesses.patch
uml-remove-unneeded-time-definitions.patch
uml-remove-stray-file.patch
uml-fix-biarch-gcc-build-on-x86_64.patch
uml-add-__raw_writeq-definition.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

-
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