Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1289962
| From | Kees Cook <keescook@chromium.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] proc: fix -ESRCH error when writing to /proc/$pid/coredump_filter |
| Date | 2015-12-11 23:30 +0100 |
| Message-ID | <qEEmm-21X-19@gated-at.bofh.it> (permalink) |
| References | <qEknE-5Bz-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, Dec 10, 2015 at 5:04 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> echo 0 > /proc/self/coredump_filter
> bash: echo: write error: No such process
>
> 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.
>
> Fixes: 774636e19ed51 ("proc: convert to kstrto*()/kstrto*_from_user()")
> Cc: <stable@vger.kernel.org> [v4.3+]
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Thanks for catching that!
Acked-by: Kees Cook <keescook@chromium.org>
-Kees
> ---
> fs/proc/base.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fs/proc/base.c b/fs/proc/base.c
> index bd3e9e6..4bd5d31 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,
> 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)
> --
> 2.6.3
>
--
Kees Cook
Chrome OS & Brillo Security
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] proc: fix -ESRCH error when writing to /proc/$pid/coredump_filter Colin King <colin.king@canonical.com> - 2015-12-11 02:10 +0100 Re: [PATCH] proc: fix -ESRCH error when writing to /proc/$pid/coredump_filter Kees Cook <keescook@chromium.org> - 2015-12-11 23:30 +0100
csiph-web