public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] add BUG call to overlapping vma fix
@ 2005-01-14 16:52 Jason Baron
  2005-01-14 23:36 ` Arun Sharma
  2005-01-17 18:32 ` Jason Baron
  0 siblings, 2 replies; 3+ messages in thread
From: Jason Baron @ 2005-01-14 16:52 UTC (permalink / raw)
  To: linux-ia64

[-- Attachment #1: Type: TEXT/PLAIN, Size: 455 bytes --]


hi,

It seems that in ia64_elf32_init, instead of calling return, if we insert
an overlapping vma, we should instead BUG(). We should never get into this
code path, because the vma's are set above PAGE_OFFSET, and thus a
Xmalicious user can not trigger this code path. This change is being
suggested mainly for clarity. Thanks to Stephen Tweedie for pointing out
that returning early in ia64_elf32_init could have unpredictable results.

thanks,

-Jason

[-- Attachment #2: overlapping vma BUG() addition --]
[-- Type: TEXT/PLAIN, Size: 943 bytes --]

--- linux/arch/ia64/ia32/binfmt_elf32.c.bak	Fri Jan 14 11:22:06 2005
+++ linux/arch/ia64/ia32/binfmt_elf32.c	Fri Jan 14 11:23:19 2005
@@ -103,7 +103,7 @@ ia64_elf32_init (struct pt_regs *regs)
 			if (insert_vm_struct(current->mm, vma)) {
 				kmem_cache_free(vm_area_cachep, vma);
 				up_write(&current->mm->mmap_sem);
-				return;
+				BUG();
 			}
 		}
 		up_write(&current->mm->mmap_sem);
@@ -130,7 +130,7 @@ ia64_elf32_init (struct pt_regs *regs)
 			if (insert_vm_struct(current->mm, vma)) {
 				kmem_cache_free(vm_area_cachep, vma);
 				up_write(&current->mm->mmap_sem);
-				return;
+				BUG();
 			}
 		}
 		up_write(&current->mm->mmap_sem);
@@ -153,7 +153,7 @@ ia64_elf32_init (struct pt_regs *regs)
 			if (insert_vm_struct(current->mm, vma)) {
 				kmem_cache_free(vm_area_cachep, vma);
 				up_write(&current->mm->mmap_sem);
-				return;
+				BUG();
 			}
 		}
 		up_write(&current->mm->mmap_sem);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-01-17 18:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-14 16:52 [patch] add BUG call to overlapping vma fix Jason Baron
2005-01-14 23:36 ` Arun Sharma
2005-01-17 18:32 ` Jason Baron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox