[lkml]   [2002]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: weirdness with ->mm vs ->active_mm handling

On Thu, 29 Aug 2002, Benjamin LaHaise wrote:
> In trying to track down a bug, I found routines like generic_file_read
> getting called with current->mm == NULL. This seems to be a valid state
> for lazy tlb tasks, but the code throughout the kernel doesn't seem to
> assume that.

Hmm.. Have you actually ever seen this?

When tsk->mm is NULL, you should never EVER get a page fault, except for
the one special case of the vmalloc'ed area (which is tested for in
do_page_fault() before we even _look_ at "tsk->mm").

In fact, do_page_fault() very much checks

if (in_atomic() || !mm)
goto no_context;

which says that a page fault when in a lazy TLB context should always
cause a trap, killing the thing (or, if the access has a fixup, calling
the fixup - although I don't think that should happen in any normal code)

In other words: I think your patch is "functionally correct", in that it
should work fine, but on the other hand having a NULL tsk->mm and trying
to do any user-level access is _so_ wrong that I'd much rather take a NULL
pointer fault than try to do something "sane" about it.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:28    [W:0.036 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site