Re: [git pull] kgdb light, v5

From: Ingo Molnar
Date: Sun Feb 10 2008 - 15:41:59 EST



* Ingo Molnar <mingo@xxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/