summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2011-08-18 16:28:08 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2011-08-18 16:28:08 -0700
commiteedef2f9f845c859b3090dd6db35b72157a1dcb5 (patch)
treeb545323a0a523a2f83bef195fe2661fc3ebfa7da
parent45b1ab8a3fc895eeaefcf09c931eafb843a294f7 (diff)
downloadlongterm-queue-2.6.33-eedef2f9f845c859b3090dd6db35b72157a1dcb5.tar.gz
.33 patches
-rw-r--r--queue-2.6.33/befs-validate-length-of-long-symbolic-links.patch51
-rw-r--r--queue-2.6.33/series1
2 files changed, 52 insertions, 0 deletions
diff --git a/queue-2.6.33/befs-validate-length-of-long-symbolic-links.patch b/queue-2.6.33/befs-validate-length-of-long-symbolic-links.patch
new file mode 100644
index 0000000..f0c0212
--- /dev/null
+++ b/queue-2.6.33/befs-validate-length-of-long-symbolic-links.patch
@@ -0,0 +1,51 @@
+From 338d0f0a6fbc82407864606f5b64b75aeb3c70f2 Mon Sep 17 00:00:00 2001
+From: Timo Warns <Warns@pre-sense.de>
+Date: Wed, 17 Aug 2011 17:59:56 +0200
+Subject: befs: Validate length of long symbolic links.
+
+From: Timo Warns <Warns@pre-sense.de>
+
+commit 338d0f0a6fbc82407864606f5b64b75aeb3c70f2 upstream.
+
+Signed-off-by: Timo Warns <warns@pre-sense.de>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/befs/linuxvfs.c | 23 ++++++++++++++---------
+ 1 file changed, 14 insertions(+), 9 deletions(-)
+
+--- a/fs/befs/linuxvfs.c
++++ b/fs/befs/linuxvfs.c
+@@ -469,17 +469,22 @@ befs_follow_link(struct dentry *dentry,
+ befs_data_stream *data = &befs_ino->i_data.ds;
+ befs_off_t len = data->size;
+
+- befs_debug(sb, "Follow long symlink");
+-
+- link = kmalloc(len, GFP_NOFS);
+- if (!link) {
+- link = ERR_PTR(-ENOMEM);
+- } else if (befs_read_lsymlink(sb, data, link, len) != len) {
+- kfree(link);
+- befs_error(sb, "Failed to read entire long symlink");
++ if (len == 0) {
++ befs_error(sb, "Long symlink with illegal length");
+ link = ERR_PTR(-EIO);
+ } else {
+- link[len - 1] = '\0';
++ befs_debug(sb, "Follow long symlink");
++
++ link = kmalloc(len, GFP_NOFS);
++ if (!link) {
++ link = ERR_PTR(-ENOMEM);
++ } else if (befs_read_lsymlink(sb, data, link, len) != len) {
++ kfree(link);
++ befs_error(sb, "Failed to read entire long symlink");
++ link = ERR_PTR(-EIO);
++ } else {
++ link[len - 1] = '\0';
++ }
+ }
+ } else {
+ link = befs_ino->i_data.symlink;
diff --git a/queue-2.6.33/series b/queue-2.6.33/series
index 4c93bbe..d0dc517 100644
--- a/queue-2.6.33/series
+++ b/queue-2.6.33/series
@@ -9,3 +9,4 @@ alsa-snd-usb-caiaq-correct-offset-fields-of-outbound.patch
mm-fix-wrong-vmap-address-calculations-with-odd-nr_cpus.patch
perf-tools-do-not-look-at-.-config-for-configuration.patch
fs-partitions-efi.c-corrupted-guid-partition-tables-can-cause-kernel-oops.patch
+befs-validate-length-of-long-symbolic-links.patch