Skip to contentSkip to conversation

oprofile 2.5.38 patch

RFC PATCH Andi Kleen 2 participants 2 messages Sep 24, 2002 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Andi Kleen

author
#1 lore raw
Quoted 3 lines · John Levon

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

#2 lore raw
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_dcookie call looks like a security hole to me. After

I'll make it CAP_SYS_ADMIN ?

Quoted 3 lines

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.

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