Re: [PATCH] Make /proc/slabinfo 0400

Dave Hansen
2011-03-03T18:17:50Z

On Thu, 2011-03-03 at 12:50 -0500, Dan Rosenberg wrote:
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -4691,7 +4691,7 @@ static const struct file_operations proc_slabinfo_operations = {
>
> static int __init slab_proc_init(void)
> {
> - proc_create("slabinfo", S_IRUGO, NULL, &proc_slabinfo_operations);
> + proc_create("slabinfo", S_IRUSR, NULL, &proc_slabinfo_operations);
> return 0;
> }
> module_init(slab_proc_init);

Please don't. In reality, it'll just mean that more data collection
things will have to get done as root, and I'll wear my keyboard out more
often sudo'ing.

If you really want this on particularly pedantic systems, why not chmod?

-- Dave