Re: [PATCH][RFC] oprofile 2.5.38 patch

From: Andi Kleen (ak@suse.de)
Date: Tue Sep 24 2002 - 07:43:47 EST


John Levon <movement@marcelothewonderpenguin.com> writes:

> At :
>
> http://oprofile.sourceforge.net/oprofile-2.5.html

+ page = (unsigned char *)__get_free_page(GFP_KERNEL);
+ if (!page)
+ return -ENOMEM;
+
+ spin_lock(&oprofilefs_lock);
+ len = sprintf(page, "%lu\n", *value);
+ spin_unlock(&oprofilefs_lock);

wouldn't an on stack buffer do nicely to format a single number ?

ulong_write_file:

it doesn't length limit count before passing to kmalloc - hole.
Also has overflow bugs (consider someone passing 0xffffffff-1).

The sys_lookup_dcookie call looks like a security hole to me. After
all it could allow everybody to lookup random paths by trying all
dcookies, even though the directories may be unreadable for him. It should
be probably made root only

Adding a list_head to task_struct looks quite ugly to me. Is there
surely no better way ? e.g. you could just put it in a file private
structure and the daemon keeps the file open.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Sep 30 2002 - 22:00:18 EST