+ uml-fix-off-by-one-bug-in-vm-file-creation.patch added to -mm tree

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

 



The patch titled

     uml: fix off-by-one bug in VM file creation

has been added to the -mm tree.  Its filename is

     uml-fix-off-by-one-bug-in-vm-file-creation.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 off-by-one bug in VM file creation
From: Jeff Dike <jdike@xxxxxxxxxxx>

Fix an off-by-one bug in temp file creation.  Seeking to the desired length
and writing a byte resulted in the file being one byte longer than expected.

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 |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff -puN arch/um/os-Linux/mem.c~uml-fix-off-by-one-bug-in-vm-file-creation arch/um/os-Linux/mem.c
--- a/arch/um/os-Linux/mem.c~uml-fix-off-by-one-bug-in-vm-file-creation
+++ a/arch/um/os-Linux/mem.c
@@ -210,8 +210,11 @@ int create_tmp_file(unsigned long long l
 		exit(1);
 	}
 
-        if (lseek64(fd, len, SEEK_SET) < 0) {
- 		perror("os_seek_file");
+	/* Seek to len - 1 because writing a character there will
+	 * increase the file size by one byte, to the desired length.
+	 */
+	if (lseek64(fd, len - 1, SEEK_SET) < 0) {
+		perror("os_seek_file");
 		exit(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