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-changelog

[Xen-changelog] [xen-unstable] xl: poison data objects in auto-generated

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xl: poison data objects in auto-generated destructors
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 26 Aug 2010 03:30:59 -0700
Delivery-date: Thu, 26 Aug 2010 03:34:56 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Gianni Tedesco <gianni.tedesco@xxxxxxxxxx>
# Date 1282320720 -3600
# Node ID f77261710856aad506dda92cfa3b92b923be4e15
# Parent  f68726cdf357f8948700a56e96d4c10e3131bce2
xl: poison data objects in auto-generated destructors

Increase the probability of blowing up badly up during any
use-after-destroy scenarios.

Signed-off-by: Gianni Tedesco <gianni.tedesco@xxxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/libxl/gentypes.py |    4 ++++
 1 files changed, 4 insertions(+)

diff -r f68726cdf357 -r f77261710856 tools/libxl/gentypes.py
--- a/tools/libxl/gentypes.py   Thu Aug 19 18:24:12 2010 +0100
+++ b/tools/libxl/gentypes.py   Fri Aug 20 17:12:00 2010 +0100
@@ -145,8 +145,11 @@ if __name__ == '__main__':
 
 #include <stdint.h>
 #include <stdlib.h>
+#include <string.h>
 
 #include "libxl.h"
+
+#define LIBXL_DTOR_POISON 0xa5
 
 """ % " ".join(sys.argv))
 
@@ -154,6 +157,7 @@ if __name__ == '__main__':
         f.write("void %s(%s *p)\n" % (ty.destructor_fn, ty.typename))
         f.write("{\n")
         f.write(libxl_C_type_destroy(ty, "p", True))
+        f.write("\tmemset(p, LIBXL_DTOR_POISON, sizeof(*p));\n")
         f.write("}\n")
         f.write("\n")
     f.close()

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xl: poison data objects in auto-generated destructors, Xen patchbot-unstable <=