+ libfs-make-simple_read_from_buffer-conventional-fix-2.patch added to -mm tree

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

 



The patch titled
     libfs-make-simple_read_from_buffer-conventional-fix-2
has been added to the -mm tree.  Its filename is
     libfs-make-simple_read_from_buffer-conventional-fix-2.patch

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/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: libfs-make-simple_read_from_buffer-conventional-fix-2
From: "H. Peter Anvin" <hpa@xxxxxxxxx>

Looking at the whole function, the code nowhere else looks for the case
count == 0, and as a result we end up returning -EFAULT for count == 0.

However, rather than backing out the above I think this is the better fix
for that problem.

Signed-off-by: H. Peter Anvin <hpa@xxxxxxxxx>
Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
Cc: Steven Rostedt <srostedt@xxxxxxxxxx>
Cc: Theodore Ts'o <tytso@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 fs/libfs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN fs/libfs.c~libfs-make-simple_read_from_buffer-conventional-fix-2 fs/libfs.c
--- a/fs/libfs.c~libfs-make-simple_read_from_buffer-conventional-fix-2
+++ a/fs/libfs.c
@@ -530,7 +530,7 @@ ssize_t simple_read_from_buffer(void __u
 
 	if (pos < 0)
 		return -EINVAL;
-	if (pos >= available)
+	if (pos >= available || !count)
 		return 0;
 	if (count > available - pos)
 		count = available - pos;
_

Patches currently in -mm which might be from hpa@xxxxxxxxx are

linux-next.patch
x86-oqo-depends-on-input_polldev.patch
thinkpad-acpi-split-delayed-leds-stuff-clean-up-code.patch
x86-simplify-highmem-related-kconfig-entries.patch
libfs-make-simple_read_from_buffer-conventional.patch
libfs-make-simple_read_from_buffer-conventional-fix.patch
libfs-make-simple_read_from_buffer-conventional-fix-2.patch
tty-pty-lookup-retval-fixup.patch
x86-dmi_scan_machine-uses-uninitialized-address-on-x86-efi.patch
page_fault-retry-with-nopage_retry.patch
page_fault-retry-with-nopage_retry-fix.patch
introduce-pr_cont-macro.patch
signals-remove-handler-parameter-to-tracehook-functions.patch
sgi-gru-exclude-uv-definitions-on-32-bit-x86.patch
sgi-gru-add-definitions-of-x86_64-gru-mmrs.patch
sgi-gru-add-macros-for-using-the-uv-hub-to-send-interrupts.patch
preadv-pwritev-add-preadv-and-pwritev-system-calls.patch
arch-x86-kernel-cpu-mcheck-mce_amd_64c-avoid-using-work_on_cpu.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