The patch titled
     drivers/scsi/mpt2sas: prevent heap overflows
has been removed from the -mm tree.  Its filename was
     drivers-scsi-mpt2sas-prevent-heap-overflows.patch

This patch was dropped because an updated version will be merged

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: drivers/scsi/mpt2sas: prevent heap overflows
From: Dan Rosenberg <[email protected]>

At two points in handling device ioctls via /dev/mpt2ctl, user-supplied
length values are used to copy data from userspace into heap buffers
without any bounds checking at all, allowing controllable heap corruption
and subsequently privilege escalation.  This patch should fix these
instances (please review).

Signed-off-by: Dan Rosenberg <[email protected]>
Cc: Eric Moore <[email protected]>
Cc: Desai Kashyap <[email protected]>
Cc: Eugene Teo <[email protected]>
Cc: James Bottomley <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
---

 drivers/scsi/mpt2sas/mpt2sas_ctl.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff -puN 
drivers/scsi/mpt2sas/mpt2sas_ctl.c~drivers-scsi-mpt2sas-prevent-heap-overflows 
drivers/scsi/mpt2sas/mpt2sas_ctl.c
--- 
a/drivers/scsi/mpt2sas/mpt2sas_ctl.c~drivers-scsi-mpt2sas-prevent-heap-overflows
+++ a/drivers/scsi/mpt2sas/mpt2sas_ctl.c
@@ -688,6 +688,12 @@ _ctl_do_mpt_command(struct MPT2SAS_ADAPT
                goto out;
        }
 
+       if (karg.data_sge_offset * 4 > ioc->request_sz ||
+           karg.data_sge_offset > (UINT_MAX / 4)) {
+               ret = -EINVAL;
+               goto out;
+       }
+
        /* copy in request message frame from user */
        if (copy_from_user(mpi_request, mf, karg.data_sge_offset*4)) {
                printk(KERN_ERR "failure at %s:%d/%s()!\n", __FILE__, __LINE__,
_

Patches currently in -mm which might be from [email protected] are

net-convert-%p-usage-to-%pk.patch

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to