[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101129163308.GA2383@xanatos>
Date: Mon, 29 Nov 2010 08:33:24 -0800
From: Sarah Sharp <sarah.a.sharp@...ux.intel.com>
To: Ingo Molnar <mingo@...e.hu>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Marcus Meissner <meissner@...e.de>,
linux-kernel@...r.kernel.org, tj@...nel.org,
akpm@...ux-foundation.org, hpa@...or.com, w@....eu,
alan@...rguk.ukuu.org.uk
Subject: Re: [PATCH] kernel: make /proc/kallsyms mode 400 to reduce ease of
attacking
On Fri, Nov 26, 2010 at 08:48:09AM +0100, Ingo Molnar wrote:
>
> * Linus Torvalds <torvalds@...ux-foundation.org> wrote:
>
> > On Fri, Nov 19, 2010 at 11:19 AM, Sarah Sharp
> > <sarah.a.sharp@...ux.intel.com> wrote:
> > >
> > > .config and dmesg are attached. The box is running klogd 1.5.5ubuntu3
> > > (from Jaunty). Yes, I know that's old. I read the bit in the commit
> > > about changing the permissions of kallsyms after boot, but if I can't
> > > boot that doesn't help. Perhaps this can be made a configuration
> > > option?
> >
> > It's not worth a config option.
> >
> > If it actually breaks user-space, I think we should just revert it.
>
> Sarah,
>
> Does your system boot fine if we make /proc/kallsyms simply an empty file to
> unprivileged users? Something like the (untested ...) patch below.
Yes, that works. The system boots as normal. `cat /proc/kallsyms`
returns an empty file, and `sudo cat /proc/kallsyms` does not.
Sarah Sharp
> diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
> index 6f6d091..d54c993 100644
> --- a/kernel/kallsyms.c
> +++ b/kernel/kallsyms.c
> @@ -465,7 +465,7 @@ static int s_show(struct seq_file *m, void *p)
> struct kallsym_iter *iter = m->private;
>
> /* Some debugging symbols have no name. Ignore them. */
> - if (!iter->name[0])
> + if (!iter->name[0] || !capable(CAP_SYS_ADMIN))
> return 0;
>
> if (iter->module_name[0]) {
--
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