All of lore.kernel.org
 help / color / mirror / Atom feed
* Fix mprotect bogus check.
@ 2004-04-16 20:54 Dave Jones
  0 siblings, 0 replies; only message in thread
From: Dave Jones @ 2004-04-16 20:54 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: Linux Kernel

If we want to trap NULL vma's, we'd better be sure
that we don't dereference it first..

		Dave

--- linux-2.6.5/mm/mprotect.c~	2004-04-16 21:52:47.000000000 +0100
+++ linux-2.6.5/mm/mprotect.c	2004-04-16 21:53:12.000000000 +0100
@@ -114,10 +114,11 @@
 mprotect_attempt_merge(struct vm_area_struct *vma, struct vm_area_struct *prev,
 		unsigned long end, int newflags)
 {
-	struct mm_struct * mm = vma->vm_mm;
+	struct mm_struct * mm;
 
 	if (!prev || !vma)
 		return 0;
+	mm = vma->vm_mm;
 	if (prev->vm_end != vma->vm_start)
 		return 0;
 	if (!can_vma_merge(prev, newflags))

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-04-16 20:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-16 20:54 Fix mprotect bogus check Dave Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.