lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAGXu5jLK72WgnuveeBDj3RHyxAtCUYVw5BSVAo3myDiyNdtb1g@mail.gmail.com>
Date:	Fri, 11 Dec 2015 14:23:24 -0800
From:	Kees Cook <keescook@...omium.org>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Colin King <colin.king@...onical.com>,
	Alexey Dobriyan <adobriyan@...il.com>,
	Al Viro <viro@...iv.linux.org.uk>,
	Ingo Molnar <mingo@...nel.org>,
	David Howells <dhowells@...hat.com>,
	Joe Perches <joe@...ches.com>,
	"Eric W . Biederman" <ebiederm@...ssion.com>,
	Calvin Owens <calvinowens@...com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] proc: fix -ESRCH error when writing to /proc/$pid/coredump_filter

On Thu, Dec 10, 2015 at 5:04 PM, Colin King <colin.king@...onical.com> wrote:
> From: Colin Ian King <colin.king@...onical.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@...r.kernel.org> [v4.3+]
> Signed-off-by: Colin Ian King <colin.king@...onical.com>

Thanks for catching that!

Acked-by: Kees Cook <keescook@...omium.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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ