oprofile 2.5.38 patch
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 3 lines · John Levon
At :
+ 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
Quoted 1 line · Andi Kleen
wouldn't an on stack buffer do nicely to format a single number ?
Yes, this was a lazy adaption of other code. Will fix.
Quoted 2 lines
it doesn't length limit count before passing to kmalloc - hole. Also has overflow bugs (consider someone passing 0xffffffff-1).
Thanks.
Quoted 1 line
The
sys_lookup_dcookiecall looks like a security hole to me. After
I'll make it CAP_SYS_ADMIN ?
Quoted 3 lines
Adding a
list_headtotask_structlooks 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.
Well, if I'm going to "hard code" the unregister I can just remove the registration and let the oprofile code call dcookie_init/exit on event buffer open/release.
thanks
john