aboutsummaryrefslogtreecommitdiffstats
path: root/main/linux-grsec/CVE-2013-2164.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-06-26 11:05:10 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-06-26 12:10:30 +0000
commit25d456a566f8d7bdc343a3a55219b23a29433f5f (patch)
treedca55e26cbea752275efed42519aad4b4e1fb388 /main/linux-grsec/CVE-2013-2164.patch
parent7faa1fcb2188bed0579ca9d656264d8107b53588 (diff)
downloadaports-25d456a566f8d7bdc343a3a55219b23a29433f5f.tar.bz2
aports-25d456a566f8d7bdc343a3a55219b23a29433f5f.tar.xz
main/linux-grsec: security fixes (CVE-2013-2164,CVE-2013-2851,CVE-2013-2852)
ref #2077 ref #2088 ref #2093 fixes #2083 fixes #2092 fixes #2097
Diffstat (limited to 'main/linux-grsec/CVE-2013-2164.patch')
-rw-r--r--main/linux-grsec/CVE-2013-2164.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/main/linux-grsec/CVE-2013-2164.patch b/main/linux-grsec/CVE-2013-2164.patch
new file mode 100644
index 0000000000..6afb6c4d8b
--- /dev/null
+++ b/main/linux-grsec/CVE-2013-2164.patch
@@ -0,0 +1,45 @@
+From 050e4b8fb7cdd7096c987a9cd556029c622c7fe2 Mon Sep 17 00:00:00 2001
+From: Jonathan Salwan <jonathan.salwan@gmail.com>
+Date: Thu, 06 Jun 2013 00:39:39 +0000
+Subject: drivers/cdrom/cdrom.c: use kzalloc() for failing hardware
+
+In drivers/cdrom/cdrom.c mmc_ioctl_cdrom_read_data() allocates a memory
+area with kmalloc in line 2885.
+
+2885 cgc->buffer = kmalloc(blocksize, GFP_KERNEL);
+2886 if (cgc->buffer == NULL)
+2887 return -ENOMEM;
+
+In line 2908 we can find the copy_to_user function:
+
+2908 if (!ret && copy_to_user(arg, cgc->buffer, blocksize))
+
+The cgc->buffer is never cleaned and initialized before this function. If
+ret = 0 with the previous basic block, it's possible to display some
+memory bytes in kernel space from userspace.
+
+When we read a block from the disk it normally fills the ->buffer but if
+the drive is malfunctioning there is a chance that it would only be
+partially filled. The result is an leak information to userspace.
+
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+Cc: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+---
+(limited to 'drivers/cdrom/cdrom.c')
+
+diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
+index d620b44..8a3aff7 100644
+--- a/drivers/cdrom/cdrom.c
++++ b/drivers/cdrom/cdrom.c
+@@ -2882,7 +2882,7 @@ static noinline int mmc_ioctl_cdrom_read_data(struct cdrom_device_info *cdi,
+ if (lba < 0)
+ return -EINVAL;
+
+- cgc->buffer = kmalloc(blocksize, GFP_KERNEL);
++ cgc->buffer = kzalloc(blocksize, GFP_KERNEL);
+ if (cgc->buffer == NULL)
+ return -ENOMEM;
+
+--
+cgit v0.9.2