- mm-extra-remap_vmalloc_range-check.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     mm: extra remap_vmalloc_range check

has been removed from the -mm tree.  Its filename is

     mm-extra-remap_vmalloc_range-check.patch

This patch was probably dropped from -mm because
it has now been merged into a subsystem tree or
into Linus's tree, or because it was folded into
its parent patch in the -mm tree.


From: Nick Piggin <npiggin@xxxxxxx>

Add a flag to ensure all remap_vmalloc_range memory has been allocated with
the vmalloc _user variants, so data does not get leaked.

Signed-off-by: Nick Piggin <npiggin@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/media/video/em28xx/em28xx-core.c     |    4 --
 drivers/media/video/et61x251/et61x251_core.c |    3 +-
 drivers/media/video/sn9c102/sn9c102_core.c   |    2 -
 drivers/media/video/zc0301/zc0301_core.c     |    2 -
 include/linux/vmalloc.h                      |    1 
 mm/vmalloc.c                                 |   25 +++++++++++++++--
 6 files changed, 29 insertions(+), 8 deletions(-)

diff -puN drivers/media/video/em28xx/em28xx-core.c~mm-extra-remap_vmalloc_range-check drivers/media/video/em28xx/em28xx-core.c
--- devel/drivers/media/video/em28xx/em28xx-core.c~mm-extra-remap_vmalloc_range-check	2006-04-21 00:35:09.000000000 -0700
+++ devel-akpm/drivers/media/video/em28xx/em28xx-core.c	2006-04-21 00:35:09.000000000 -0700
@@ -79,10 +79,8 @@ u32 em28xx_request_buffers(struct em28xx
 
 	dev->num_frames = count;
 	while (dev->num_frames > 0) {
-		if ((buff = vmalloc_32(dev->num_frames * imagesize))) {
-			memset(buff, 0, dev->num_frames * imagesize);
+		if ((buff = vmalloc_32_user(dev->num_frames * imagesize)))
 			break;
-		}
 		dev->num_frames--;
 	}
 
diff -puN drivers/media/video/et61x251/et61x251_core.c~mm-extra-remap_vmalloc_range-check drivers/media/video/et61x251/et61x251_core.c
--- devel/drivers/media/video/et61x251/et61x251_core.c~mm-extra-remap_vmalloc_range-check	2006-04-21 00:35:09.000000000 -0700
+++ devel-akpm/drivers/media/video/et61x251/et61x251_core.c	2006-04-21 00:35:09.000000000 -0700
@@ -133,7 +133,8 @@ et61x251_request_buffers(struct et61x251
 
 	cam->nbuffers = count;
 	while (cam->nbuffers > 0) {
-		if ((buff = vmalloc_32(cam->nbuffers * PAGE_ALIGN(imagesize))))
+		if ((buff = vmalloc_32_user(cam->nbuffers *
+						PAGE_ALIGN(imagesize))))
 			break;
 		cam->nbuffers--;
 	}
diff -puN drivers/media/video/sn9c102/sn9c102_core.c~mm-extra-remap_vmalloc_range-check drivers/media/video/sn9c102/sn9c102_core.c
--- devel/drivers/media/video/sn9c102/sn9c102_core.c~mm-extra-remap_vmalloc_range-check	2006-04-21 00:35:09.000000000 -0700
+++ devel-akpm/drivers/media/video/sn9c102/sn9c102_core.c	2006-04-21 00:35:09.000000000 -0700
@@ -149,7 +149,7 @@ sn9c102_request_buffers(struct sn9c102_d
 
 	cam->nbuffers = count;
 	while (cam->nbuffers > 0) {
-		if ((buff = vmalloc_32(cam->nbuffers * PAGE_ALIGN(imagesize))))
+		if ((buff = vmalloc_32_user(cam->nbuffers * PAGE_ALIGN(imagesize))))
 			break;
 		cam->nbuffers--;
 	}
diff -puN drivers/media/video/zc0301/zc0301_core.c~mm-extra-remap_vmalloc_range-check drivers/media/video/zc0301/zc0301_core.c
--- devel/drivers/media/video/zc0301/zc0301_core.c~mm-extra-remap_vmalloc_range-check	2006-04-21 00:35:09.000000000 -0700
+++ devel-akpm/drivers/media/video/zc0301/zc0301_core.c	2006-04-21 00:35:09.000000000 -0700
@@ -136,7 +136,7 @@ zc0301_request_buffers(struct zc0301_dev
 
 	cam->nbuffers = count;
 	while (cam->nbuffers > 0) {
-		if ((buff = vmalloc_32(cam->nbuffers * PAGE_ALIGN(imagesize))))
+		if ((buff = vmalloc_32_user(cam->nbuffers * PAGE_ALIGN(imagesize))))
 			break;
 		cam->nbuffers--;
 	}
diff -puN include/linux/vmalloc.h~mm-extra-remap_vmalloc_range-check include/linux/vmalloc.h
--- devel/include/linux/vmalloc.h~mm-extra-remap_vmalloc_range-check	2006-04-21 00:35:09.000000000 -0700
+++ devel-akpm/include/linux/vmalloc.h	2006-04-21 00:35:09.000000000 -0700
@@ -8,6 +8,7 @@
 #define VM_IOREMAP	0x00000001	/* ioremap() and friends */
 #define VM_ALLOC	0x00000002	/* vmalloc() */
 #define VM_MAP		0x00000004	/* vmap()ed pages */
+#define VM_USERMAP	0x00000008	/* suitable for remap_vmalloc_range */
 /* bits [20..32] reserved for arch specific ioremap internals */
 
 /*
diff -puN mm/vmalloc.c~mm-extra-remap_vmalloc_range-check mm/vmalloc.c
--- devel/mm/vmalloc.c~mm-extra-remap_vmalloc_range-check	2006-04-21 00:35:09.000000000 -0700
+++ devel-akpm/mm/vmalloc.c	2006-04-21 00:35:09.000000000 -0700
@@ -524,7 +524,16 @@ EXPORT_SYMBOL(vmalloc);
  */
 void *vmalloc_user(unsigned long size)
 {
-	return __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO, PAGE_KERNEL);
+	struct vm_struct *area;
+	void *ret;
+
+	ret = __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO, PAGE_KERNEL);
+	write_lock(&vmlist_lock);
+	area = __find_vm_area(ret);
+	area->flags |= VM_USERMAP;
+	write_unlock(&vmlist_lock);
+
+	return ret;
 }
 EXPORT_SYMBOL(vmalloc_user);
 
@@ -591,7 +600,16 @@ EXPORT_SYMBOL(vmalloc_32);
  */
 void *vmalloc_32_user(unsigned long size)
 {
-	return __vmalloc(size, GFP_KERNEL | __GFP_ZERO, PAGE_KERNEL);
+	struct vm_struct *area;
+	void *ret;
+
+	ret = __vmalloc(size, GFP_KERNEL | __GFP_ZERO, PAGE_KERNEL);
+	write_lock(&vmlist_lock);
+	area = __find_vm_area(ret);
+	area->flags |= VM_USERMAP;
+	write_unlock(&vmlist_lock);
+
+	return ret;
 }
 EXPORT_SYMBOL(vmalloc_32_user);
 
@@ -700,6 +718,9 @@ int remap_vmalloc_range(struct vm_area_s
 	if (!area)
 		goto out_einval_locked;
 
+	if (!(area->flags & VM_USERMAP))
+		goto out_einval_locked;
+
 	if (usize + (pgoff << PAGE_SHIFT) > area->size - PAGE_SIZE)
 		goto out_einval_locked;
 	read_unlock(&vmlist_lock);
_

Patches currently in -mm which might be from npiggin@xxxxxxx are

mm-vm_bug_on.patch
mm-extra-remap_vmalloc_range-check.patch
drivers-leave-vm_flags-alone.patch
drivers-catch-and-return-remap_vmalloc_range-errors.patch
reiser4-releasepage-fix.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux