From: Greg Kroah-Hartman Date: Mon, 25 Jul 2016 20:26:43 +0000 (-0700) Subject: 3.14-stable patches X-Git-Tag: v4.6.5~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4b3b204bccfbbaddd925d405d49add7e0b3c8ab3;p=thirdparty%2Fkernel%2Fstable-queue.git 3.14-stable patches added patches: s390-seccomp-fix-error-return-for-filtered-system-calls.patch tmpfs-don-t-undo-fallocate-past-its-last-page.patch tmpfs-fix-regression-hang-in-fallocate-undo.patch --- diff --git a/queue-3.14/s390-seccomp-fix-error-return-for-filtered-system-calls.patch b/queue-3.14/s390-seccomp-fix-error-return-for-filtered-system-calls.patch new file mode 100644 index 00000000000..b6c0a969377 --- /dev/null +++ b/queue-3.14/s390-seccomp-fix-error-return-for-filtered-system-calls.patch @@ -0,0 +1,33 @@ +From dc295880c6752076f8b94ba3885d0bfff09e3e82 Mon Sep 17 00:00:00 2001 +From: Jan Willeke +Date: Tue, 22 Jul 2014 16:50:57 +0200 +Subject: s390/seccomp: fix error return for filtered system calls + +From: Jan Willeke + +commit dc295880c6752076f8b94ba3885d0bfff09e3e82 upstream. + +The syscall_set_return_value function of s390 negates the error argument +before storing the value to the return register gpr2. This is incorrect, +the seccomp code already passes the negative error value. +Store the unmodified error value to gpr2. + +Signed-off-by: Jan Willeke +Signed-off-by: Martin Schwidefsky +Signed-off-by: Greg Kroah-Hartman + +--- + arch/s390/include/asm/syscall.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/s390/include/asm/syscall.h ++++ b/arch/s390/include/asm/syscall.h +@@ -54,7 +54,7 @@ static inline void syscall_set_return_va + struct pt_regs *regs, + int error, long val) + { +- regs->gprs[2] = error ? -error : val; ++ regs->gprs[2] = error ? error : val; + } + + static inline void syscall_get_arguments(struct task_struct *task, diff --git a/queue-3.14/series b/queue-3.14/series index dd3dceee8c4..f530e0d71df 100644 --- a/queue-3.14/series +++ b/queue-3.14/series @@ -48,3 +48,6 @@ alsa-ctl-stop-notification-after-disconnection.patch scsi-fix-race-between-simultaneous-decrements-of-host_failed.patch fix-reconnect-to-not-defer-smb3-session-reconnect-long-after-socket-reconnect.patch xen-acpi-allow-xen-acpi-processor-driver-to-load-on-xen-4.7.patch +tmpfs-don-t-undo-fallocate-past-its-last-page.patch +tmpfs-fix-regression-hang-in-fallocate-undo.patch +s390-seccomp-fix-error-return-for-filtered-system-calls.patch diff --git a/queue-3.14/tmpfs-don-t-undo-fallocate-past-its-last-page.patch b/queue-3.14/tmpfs-don-t-undo-fallocate-past-its-last-page.patch new file mode 100644 index 00000000000..5f599063f2c --- /dev/null +++ b/queue-3.14/tmpfs-don-t-undo-fallocate-past-its-last-page.patch @@ -0,0 +1,40 @@ +From b9b4bb26af017dbe930cd4df7f9b2fc3a0497bfe Mon Sep 17 00:00:00 2001 +From: Anthony Romano +Date: Fri, 24 Jun 2016 14:48:43 -0700 +Subject: tmpfs: don't undo fallocate past its last page + +From: Anthony Romano + +commit b9b4bb26af017dbe930cd4df7f9b2fc3a0497bfe upstream. + +When fallocate is interrupted it will undo a range that extends one byte +past its range of allocated pages. This can corrupt an in-use page by +zeroing out its first byte. Instead, undo using the inclusive byte +range. + +Fixes: 1635f6a74152f1d ("tmpfs: undo fallocation on failure") +Link: http://lkml.kernel.org/r/1462713387-16724-1-git-send-email-anthony.romano@coreos.com +Signed-off-by: Anthony Romano +Cc: Vlastimil Babka +Cc: Hugh Dickins +Cc: Brandon Philips +Cc: +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + mm/shmem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/mm/shmem.c ++++ b/mm/shmem.c +@@ -1895,7 +1895,7 @@ static long shmem_fallocate(struct file + /* Remove the !PageUptodate pages we added */ + shmem_undo_range(inode, + (loff_t)start << PAGE_CACHE_SHIFT, +- (loff_t)index << PAGE_CACHE_SHIFT, true); ++ ((loff_t)index << PAGE_CACHE_SHIFT) - 1, true); + goto undone; + } + diff --git a/queue-3.14/tmpfs-fix-regression-hang-in-fallocate-undo.patch b/queue-3.14/tmpfs-fix-regression-hang-in-fallocate-undo.patch new file mode 100644 index 00000000000..180135357e4 --- /dev/null +++ b/queue-3.14/tmpfs-fix-regression-hang-in-fallocate-undo.patch @@ -0,0 +1,44 @@ +From 7f556567036cb7f89aabe2f0954b08566b4efb53 Mon Sep 17 00:00:00 2001 +From: Hugh Dickins +Date: Sun, 10 Jul 2016 16:46:32 -0700 +Subject: tmpfs: fix regression hang in fallocate undo + +From: Hugh Dickins + +commit 7f556567036cb7f89aabe2f0954b08566b4efb53 upstream. + +The well-spotted fallocate undo fix is good in most cases, but not when +fallocate failed on the very first page. index 0 then passes lend -1 +to shmem_undo_range(), and that has two bad effects: (a) that it will +undo every fallocation throughout the file, unrestricted by the current +range; but more importantly (b) it can cause the undo to hang, because +lend -1 is treated as truncation, which makes it keep on retrying until +every page has gone, but those already fully instantiated will never go +away. Big thank you to xfstests generic/269 which demonstrates this. + +Fixes: b9b4bb26af01 ("tmpfs: don't undo fallocate past its last page") +Signed-off-by: Hugh Dickins +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + mm/shmem.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +--- a/mm/shmem.c ++++ b/mm/shmem.c +@@ -1893,9 +1893,11 @@ static long shmem_fallocate(struct file + NULL); + if (error) { + /* Remove the !PageUptodate pages we added */ +- shmem_undo_range(inode, +- (loff_t)start << PAGE_CACHE_SHIFT, +- ((loff_t)index << PAGE_CACHE_SHIFT) - 1, true); ++ if (index > start) { ++ shmem_undo_range(inode, ++ (loff_t)start << PAGE_CACHE_SHIFT, ++ ((loff_t)index << PAGE_CACHE_SHIFT) - 1, true); ++ } + goto undone; + } +