[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m1r5z5jt63.fsf@fess.ebiederm.org>
Date: Sun, 03 May 2009 23:09:24 -0700
From: ebiederm@...ssion.com (Eric W. Biederman)
To: James Morris <jmorris@...ei.org>
Cc: linux-security-module@...r.kernel.org, Jake Edge <jake@....net>,
Arjan van de Ven <arjan@...radead.org>,
Eric Paris <eparis@...hat.com>,
Alan Cox <alan@...rguk.ukuu.org.uk>,
Roland McGrath <roland@...hat.com>, mingo@...hat.com,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] proc: avoid leaking eip, esp, or wchan to non-privileged processes (fwd)
James Morris <jmorris@...ei.org> writes:
> diff --git a/fs/proc/base.c b/fs/proc/base.c
> index aa763ab..cd3c0d7 100644
> --- a/fs/proc/base.c
> +++ b/fs/proc/base.c
> @@ -319,6 +319,9 @@ static int proc_pid_wchan(struct task_struct *task, char
> *buffer)
> unsigned long wchan;
> char symname[KSYM_NAME_LEN];
>
> + if (!ptrace_may_access(task, PTRACE_MODE_READ))
> + return 0;
> +
> wchan = get_wchan(task);
>
> if (lookup_symbol_name(wchan, symname) < 0)
If the symbol is in the kernel it should be safe to return it's
name, all that is an information leak of a different sort.
Overall I expect we should return -EPERM here and not simply
an empty file.
Have you tested these patches against ps top and similar common
tools?
Eric
--
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