Messages in this thread | | | Date | Sun, 10 Feb 2008 21:41:24 +0100 | From | Ingo Molnar <> | Subject | Re: [git pull] kgdb light, v5 |
| |
* Ingo Molnar <mingo@elte.hu> wrote:
> all other places already use probe_kernel_{read|write}. (Now, there > are a few stray TASK_SIZE checks still, i'll double check them and > convert them to access_ok() checks.)
all the TASK_SIZE checks relate to the soft breakpoint write accesses.
and access_ok() does not cut it: it's also a bit dangerous from debug context: uses current->address_space, which is task dependent and can accidentally allow an int3 write to userspace if executed in a kernel thread that has lazy-inherited the TLB from a user task, etc., and it also does not give enough protection on some other architectures.
is_kernel_text() is not good, because it does not cover modules. is_module_address() is not good either, because it also covers module data areas, and is a bit thick (hence crash-risky) as well. So there's no existing facility to cover this.
so i'd say the safest would be to remove the TASK_SIZE check altogether. If someone typoes a raw breakpoint - it is still enumerated by gdb and can still be cleared. It's not like kgdb cannot be used to shoot in one's own foot ...
Ingo
| |