Re: [PATCH v2 7/11] Uprobes Implementation

From: Linus Torvalds
Date: Thu May 13 2010 - 16:02:58 EST




On Thu, 13 May 2010, Oleg Nesterov wrote:
>
> But I still think this doesn't actually matter, replace_page() shouldn't
> preserve the mapping, it should always install the anonymous page. I can
> be wrong, of course.

Well, if I reasd the patches right, uprobes will use "copy_to_user()" for
the self-probing case. So that would definitely just modify a shared
mapping.

Of course, arguably, who really cares? As long as it's not a security
issue (and it isn't - since the person could just have written to the
thing directly instead), I guess it doesn't much matter. But it's a bit
sad when a probing feature either

- changes a global mapping that may be executed by other non-related
processes that the prober isn't even _aware_ of.

- changes semantics by creating a non-coherent private page

so arguably it would be good to just make the rule be that you cannot
probe a shared mapping. Because whatever you do, it's always the wrong
thing.

Linus
--
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/