mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
On >= 2.6.11 check that the pages are present and readable before reading
Fri Apr 22 00:09:16 2005 Soeren Sandmann <sandmann@redhat.com> * sysprof-module.c (read_user_space): On >= 2.6.11 check that the pages are present and readable before reading them.
This commit is contained in:
committed by
Søren Sandmann Pedersen
parent
61430f6b96
commit
7b67e2c6b9
@ -157,8 +157,13 @@ read_user_space (userspace_reader *reader,
|
||||
{
|
||||
unsigned long cache_address = reader->cache_address;
|
||||
int index, r;
|
||||
|
||||
|
||||
if (!cache_address || cache_address != (address & PAGE_MASK)) {
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION (2,6,11)
|
||||
if (!check_user_page_readable (reader->task->mm, address))
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
cache_address = address & PAGE_MASK;
|
||||
|
||||
r = x_access_process_vm (reader->task, cache_address,
|
||||
@ -258,7 +263,7 @@ static void
|
||||
do_generate (void *data)
|
||||
{
|
||||
struct task_struct *task = data;
|
||||
|
||||
|
||||
generate_stack_trace(task, head);
|
||||
wake_up_process (task);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user