- input-limit-memory-allocated-by-uinput-ff-drivers.patch removed from -mm tree

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

 



The patch titled
     input: limit memory allocated by uinput ff drivers
has been removed from the -mm tree.  Its filename was
     input-limit-memory-allocated-by-uinput-ff-drivers.patch

This patch was dropped because an updated version will be merged

------------------------------------------------------
Subject: input: limit memory allocated by uinput ff drivers
From: Chuck Ebbert <cebbert@xxxxxxxxxx>

Don't let force feedback drivers allocate more than 256K of kernel memory. 
On kernel 2.6.22 this causes a kernel OOPS with the SLUB memory allocator;
on later kernels the drivers may allocate large amounts of memory.

Signed-off-by: Chuck Ebbert <cebbert@xxxxxxxxxx>
Cc: Dmitry Torokhov <dtor@xxxxxxx>
Cc: Christoph Lameter <clameter@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/input/ff-core.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff -puN drivers/input/ff-core.c~input-limit-memory-allocated-by-uinput-ff-drivers drivers/input/ff-core.c
--- a/drivers/input/ff-core.c~input-limit-memory-allocated-by-uinput-ff-drivers
+++ a/drivers/input/ff-core.c
@@ -306,6 +306,7 @@ int input_ff_create(struct input_dev *de
 {
 	struct ff_device *ff;
 	int i;
+	int needed_mem;
 
 	if (!max_effects) {
 		printk(KERN_ERR
@@ -313,8 +314,11 @@ int input_ff_create(struct input_dev *de
 		return -EINVAL;
 	}
 
-	ff = kzalloc(sizeof(struct ff_device) +
-		     max_effects * sizeof(struct file *), GFP_KERNEL);
+	needed_mem = sizeof(struct ff_device) + max_effects * sizeof(struct file *);
+	if (needed_mem > 256 * 1024)
+		return -ENOMEM;
+
+	ff = kzalloc(needed_mem, GFP_KERNEL);
 	if (!ff)
 		return -ENOMEM;
 
_

Patches currently in -mm which might be from cebbert@xxxxxxxxxx are

input-limit-memory-allocated-by-uinput-ff-drivers.patch
slub-accurately-compare-debug-flags-during-slab-cache-merge.patch
slub-accurately-compare-debug-flags-during-slab-cache-merge-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