From: Rusty Russell <rusty@rustcorp.com.au>

Change the permissions on /proc/kallsyms.  As David M-T points out,
it's nice for analysis tools not to need root.  Place
cond_resched() to avoid starvation problems on non-preempt.



 kernel/kallsyms.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff -puN kernel/kallsyms.c~proc-kallsyms-permission-fix kernel/kallsyms.c
--- 25/kernel/kallsyms.c~proc-kallsyms-permission-fix	2003-08-27 01:09:35.000000000 -0700
+++ 25-akpm/kernel/kallsyms.c	2003-08-27 01:11:07.000000000 -0700
@@ -189,9 +189,11 @@ static int update_iter(struct kallsym_it
 	if (pos < iter->pos)
 		reset_iter(iter);
 
-	/* We need to iterate through the previous symbols. */
-	for (; iter->pos != pos; iter->pos++)
+	/* We need to iterate through the previous symbols: can be slow */
+	for (; iter->pos != pos; iter->pos++) {
 		get_ksymbol_core(iter);
+		cond_resched();
+	}
 	return 1;
 }
 
@@ -280,8 +282,7 @@ int __init kallsyms_init(void)
 {
 	struct proc_dir_entry *entry;
 
-	/* root-only: could chew up lots of cpu by read, seek back, read... */
-	entry = create_proc_entry("kallsyms", 0400, NULL);
+	entry = create_proc_entry("kallsyms", 0444, NULL);
 	if (entry)
 		entry->proc_fops = &kallsyms_operations;
 	return 0;

_