Commit [1c723e]  Maximize  Restore  History

mm: sigbus instead of abusing oom

commit d99be1a8ecf377c2c9b3372d36411ad6547bbd4c upstream.

When do_nonlinear_fault() realizes that the page table must have been
corrupted for it to have been called, it does print_bad_pte() and returns
... VM_FAULT_OOM, which is hard to understand.

It made some sense when I did it for 2.6.15, when do_page_fault() just
killed the current process; but nowadays it lets the OOM killer decide who
to kill - so page table corruption in one process would be liable to kill

Change it to return VM_FAULT_SIGBUS instead: that doesn't guarantee that
the process will be killed, but is good enough for such a rare
abnormality, accompanied as it is by the "BUG: Bad page map" message.

And recent HWPOISON work has copied that code into do_swap_page(), when it
finds an impossible swap entry: fix that to VM_FAULT_SIGBUS too.

Signed-off-by: Hugh Dickins <>
Cc: Izik Eidus <>
Cc: Andrea Arcangeli <>
Cc: Nick Piggin <>
Reviewed-by: KOSAKI Motohiro <>
Cc: Rik van Riel <>
Cc: Lee Schermerhorn <>
Cc: Andi Kleen <>
Reviewed-by: KAMEZAWA Hiroyuki <>
Reviewed-by: Wu Fengguang <>
Reviewed-by: Minchan Kim <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
Signed-off-by: Greg Kroah-Hartman <>

Hugh Dickins Hugh Dickins 2009-12-15

Greg Kroah-Hartman Greg Kroah-Hartman 2009-12-18

changed mm/memory.c
mm/memory.c Diff Switch to side-by-side view

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks