rpms/kernel/F-7 linux-2.6-input-ff-create-limit-memory.patch, NONE, 1.1 kernel-2.6.spec, 1.3316, 1.3317 linux-2.6-slub-dont-bug-on-too-large-allocation.patch, 1.1, NONE
Chuck Ebbert (cebbert)
fedora-extras-commits at redhat.com
Tue Aug 14 21:06:36 UTC 2007
Author: cebbert
Update of /cvs/pkgs/rpms/kernel/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv31994
Modified Files:
kernel-2.6.spec
Added Files:
linux-2.6-input-ff-create-limit-memory.patch
Removed Files:
linux-2.6-slub-dont-bug-on-too-large-allocation.patch
Log Message:
* Tue Aug 14 2007 Chuck Ebbert <cebbert at redhat.com>
- revert "don't BUG on too-large memory allocation"
- limit memory allocated by input force feedback drivers
linux-2.6-input-ff-create-limit-memory.patch:
--- NEW FILE linux-2.6-input-ff-create-limit-memory.patch ---
Don't let ff drivers allocate >1MB of kernel memory.
---
drivers/input/ff-core.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- linux-2.6.22.noarch.orig/drivers/input/ff-core.c
+++ linux-2.6.22.noarch/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 > 1024 * 1024)
+ return -ENOMEM;
+
+ ff = kzalloc(needed_mem, GFP_KERNEL);
if (!ff)
return -ENOMEM;
Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-7/kernel-2.6.spec,v
retrieving revision 1.3316
retrieving revision 1.3317
diff -u -r1.3316 -r1.3317
--- kernel-2.6.spec 14 Aug 2007 19:26:25 -0000 1.3316
+++ kernel-2.6.spec 14 Aug 2007 21:06:03 -0000 1.3317
@@ -576,7 +576,7 @@
Patch570: linux-2.6-selinux-mprotect-checks.patch
Patch590: linux-2.6-unexport-symbols.patch
Patch600: linux-2.6-vm-silence-atomic-alloc-failures.patch
-Patch601: linux-2.6-slub-dont-bug-on-too-large-allocation.patch
+Patch601: linux-2.6-input-ff-create-limit-memory.patch
Patch610: linux-2.6-defaults-fat-utf8.patch
Patch620: linux-2.6-defaults-unicode-vt.patch
Patch630: linux-2.6-defaults-nonmi.patch
@@ -1253,8 +1253,8 @@
#
# Silence GFP_ATOMIC failures.
ApplyPatch linux-2.6-vm-silence-atomic-alloc-failures.patch
-# don't crash the machine when a too-large memory request arrives
-ApplyPatch linux-2.6-slub-dont-bug-on-too-large-allocation.patch
+# don't let input FF drivers allocate too much memory
+ApplyPatch linux-2.6-input-ff-create-limit-memory.patch
# Changes to upstream defaults.
# Use UTF-8 by default on VFAT.
@@ -2277,6 +2277,10 @@
%endif
%changelog
+* Tue Aug 14 2007 Chuck Ebbert <cebbert at redhat.com>
+- revert "don't BUG on too-large memory allocation"
+- limit memory allocated by input force feedback drivers
+
* Tue Aug 14 2007 John W. Linville <linville at redhat.com>
- Update wireless-dev bits (mac80211 & ssb updates, bcm43xx -> b43 rename)
--- linux-2.6-slub-dont-bug-on-too-large-allocation.patch DELETED ---
More information about the fedora-extras-commits
mailing list