WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [2.6.23 patch] xenbus_xs.c: fix a use-after-free

To: jeremy@xxxxxxxxxxxxx, chrisw@xxxxxxxxxxxx
Subject: [Xen-devel] [2.6.23 patch] xenbus_xs.c: fix a use-after-free
From: Adrian Bunk <bunk@xxxxxxxxx>
Date: Mon, 23 Jul 2007 03:11:35 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
Delivery-date: Tue, 24 Jul 2007 09:02:41 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20070723010204.GT26212@xxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20070723010204.GT26212@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.16 (2007-06-11)
This patch fixes an obvious use-after-free spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@xxxxxxxxx>

---
--- linux-2.6.22-rc6-mm1/drivers/xen/xenbus/xenbus_xs.c.old     2007-07-23 
03:04:20.000000000 +0200
+++ linux-2.6.22-rc6-mm1/drivers/xen/xenbus/xenbus_xs.c 2007-07-23 
03:04:42.000000000 +0200
@@ -782,8 +782,8 @@ static int process_msg(void)
                msg->u.watch.vec = split(body, msg->hdr.len,
                                         &msg->u.watch.vec_size);
                if (IS_ERR(msg->u.watch.vec)) {
-                       kfree(msg);
                        err = PTR_ERR(msg->u.watch.vec);
+                       kfree(msg);
                        goto out;
                }
 


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>