diff options
author | Colin Ian King <colin.king@canonical.com> | 2015-12-18 17:22:01 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-12-18 17:25:40 -0500 |
commit | 41a0c249cb8706a2efa1ab3d59466b23a27d0c8b (patch) | |
tree | 46e4739253a5199799a9f4b7daa634f4217f06ad /fs/proc | |
parent | 73796d8bf27372e26c2b79881947304c14c2d353 (diff) |
proc: fix -ESRCH error when writing to /proc/$pid/coredump_filter
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>
Cc: <stable@vger.kernel.org> [4.3+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/base.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index bd3e9e68125b..4bd5d3118acd 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -2494,6 +2494,7 @@ static ssize_t proc_coredump_filter_write(struct file *file, | |||
2494 | mm = get_task_mm(task); | 2494 | mm = get_task_mm(task); |
2495 | if (!mm) | 2495 | if (!mm) |
2496 | goto out_no_mm; | 2496 | goto out_no_mm; |
2497 | ret = 0; | ||
2497 | 2498 | ||
2498 | for (i = 0, mask = 1; i < MMF_DUMP_FILTER_BITS; i++, mask <<= 1) { | 2499 | for (i = 0, mask = 1; i < MMF_DUMP_FILTER_BITS; i++, mask <<= 1) { |
2499 | if (val & mask) | 2500 | if (val & mask) |