All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "proc: fix -ESRCH error when writing to /proc/$pid/coredump_filter" has been added to the 4.3-stable tree
@ 2016-02-12 21:01 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-02-12 21:01 UTC (permalink / raw)
  To: colin.king, akpm, gregkh, keescook, torvalds; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    proc: fix -ESRCH error when writing to /proc/$pid/coredump_filter

to the 4.3-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     proc-fix-esrch-error-when-writing-to-proc-pid-coredump_filter.patch
and it can be found in the queue-4.3 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 41a0c249cb8706a2efa1ab3d59466b23a27d0c8b Mon Sep 17 00:00:00 2001
From: Colin Ian King <colin.king@canonical.com>
Date: Fri, 18 Dec 2015 14:22:01 -0800
Subject: proc: fix -ESRCH error when writing to /proc/$pid/coredump_filter

From: Colin Ian King <colin.king@canonical.com>

commit 41a0c249cb8706a2efa1ab3d59466b23a27d0c8b upstream.

Writing to /proc/$pid/coredump_filter always returns -ESRCH because commit
774636e19ed51 ("proc: convert to kstrto*()/kstrto*_from_user()") removed
the setting of ret after the get_proc_task call and incorrectly left it as
-ESRCH.  Instead, return 0 when successful.

Example breakage:

  echo 0 > /proc/self/coredump_filter
  bash: echo: write error: No such process

Fixes: 774636e19ed51 ("proc: convert to kstrto*()/kstrto*_from_user()")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/proc/base.c |    1 +
 1 file changed, 1 insertion(+)

--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2484,6 +2484,7 @@ static ssize_t proc_coredump_filter_writ
 	mm = get_task_mm(task);
 	if (!mm)
 		goto out_no_mm;
+	ret = 0;
 
 	for (i = 0, mask = 1; i < MMF_DUMP_FILTER_BITS; i++, mask <<= 1) {
 		if (val & mask)


Patches currently in stable-queue which might be from colin.king@canonical.com are

queue-4.3/proc-fix-esrch-error-when-writing-to-proc-pid-coredump_filter.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-02-12 21:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-12 21:01 Patch "proc: fix -ESRCH error when writing to /proc/$pid/coredump_filter" has been added to the 4.3-stable tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.