diff options
author | Colin Ian King <colin.king@canonical.com> | 2015-12-19 01:22:01 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-20 01:28:23 +0300 |
commit | 38ff7eb030aaf1dc65a4c00fb322a36fbd6bdbdc (patch) | |
tree | 465b3ed8fd72468551073f35e6ea1f9413e99679 | |
parent | bffecd3844604aa095ed473d75f26028de5202f5 (diff) | |
download | linux-38ff7eb030aaf1dc65a4c00fb322a36fbd6bdbdc.tar.xz |
proc: fix -ESRCH error when writing to /proc/$pid/coredump_filter
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>
-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 29595af32866..4b6fb2cbd928 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -2484,6 +2484,7 @@ static ssize_t proc_coredump_filter_write(struct file *file, 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) |