This is a note to let you know that I've just added the patch titled

    udldrmfb: udl_get_edid: usb_control_msg buffer must not be on the stack

to the 3.4-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     udldrmfb-udl_get_edid-usb_control_msg-buffer-must-not-be-on-the-stack.patch
and it can be found in the queue-3.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 242187b362555849e8c971dfbbfd55f8bd9fa717 Mon Sep 17 00:00:00 2001
From: Hans de Goede <[email protected]>
Date: Fri, 11 Jan 2013 12:08:57 +0100
Subject: udldrmfb: udl_get_edid: usb_control_msg buffer must not be on the stack

From: Hans de Goede <[email protected]>

commit 242187b362555849e8c971dfbbfd55f8bd9fa717 upstream.

The buffer passed to usb_control_msg may end up in scatter-gather list, and
may thus not be on the stack. Having it on the stack usually works on x86, but
not on other archs.

Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/gpu/drm/udl/udl_connector.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

--- a/drivers/gpu/drm/udl/udl_connector.c
+++ b/drivers/gpu/drm/udl/udl_connector.c
@@ -22,13 +22,17 @@
 static u8 *udl_get_edid(struct udl_device *udl)
 {
        u8 *block;
-       char rbuf[3];
+       char *rbuf;
        int ret, i;
 
        block = kmalloc(EDID_LENGTH, GFP_KERNEL);
        if (block == NULL)
                return NULL;
 
+       rbuf = kmalloc(2, GFP_KERNEL);
+       if (rbuf == NULL)
+               goto error;
+
        for (i = 0; i < EDID_LENGTH; i++) {
                ret = usb_control_msg(udl->ddev->usbdev,
                                      usb_rcvctrlpipe(udl->ddev->usbdev, 0), 
(0x02),
@@ -42,10 +46,12 @@ static u8 *udl_get_edid(struct udl_devic
                block[i] = rbuf[1];
        }
 
+       kfree(rbuf);
        return block;
 
 error:
        kfree(block);
+       kfree(rbuf);
        return NULL;
 }
 


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

queue-3.4/udldrmfb-udl_get_edid-usb_control_msg-buffer-must-not-be-on-the-stack.patch
queue-3.4/epoll-prevent-missed-events-on-epoll_ctl_mod.patch
queue-3.4/udldrmfb-udl_get_edid-drop-unneeded-i.patch
queue-3.4/udldrmfb-fix-edid-not-working-with-monitors-with-edid.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to