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:
Soeren Sandmann
2005-04-22 04:14:37 +00:00
committed by Søren Sandmann Pedersen
parent 61430f6b96
commit 7b67e2c6b9
3 changed files with 15 additions and 3 deletions

View File

@ -1,3 +1,8 @@
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.
Tue Apr 19 23:26:45 2005 Kristian Høgsberg <krh@bitplanet.net>
* Makefile (check): Add simple check target that runs a sanity

4
TODO
View File

@ -39,7 +39,8 @@ Before 1.2:
- when you click something in the main list and we don't respond
within 50ms (or perhaps when we expect to not be able to do
so (can we know the size in advance?))
- instead of as we do now: set the busy cursor unconditionally
- instead of what we do now: set the busy cursor unconditionally
- Reorganise stackstash and profile
- stackstash should just take traces of addresses without knowing
@ -82,6 +83,7 @@ Before 1.2:
- Consider adding KDE-style nested callgraph view
- Add support for line numbers within functions
- consider caching [filename => bin_file]
- rethink caller list, not terribly useful at the moment.
- Have kernel module report the file the address was found in
Should avoid a lot of potential broken/raciness with dlopen etc.

View File

@ -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);