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] [PATCH 2 of 4] xentrace: replace ASSERT with printk in __tra

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 2 of 4] xentrace: replace ASSERT with printk in __trace_var
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Fri, 15 Jul 2011 17:38:06 +0200
Cc: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
Delivery-date: Fri, 15 Jul 2011 08:41:15 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1310744290; l=927; s=domk; d=aepfle.de; h=Cc:To:From:Date:References:In-Reply-To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:X-RZG-CLASS-ID: X-RZG-AUTH; bh=82T/8kbEemBbzHuni9TUwieMA3g=; b=l4UDgAbDDAHi06rAfAs1guVf2187z1XcaJTjjVq0giqyQCB9hT92PyTAgS5mi4WOY6b D+9H7Ki+BRpR+8UeCHs4Xw/+0e0knj54fIUQEDVVgTA4gjM39TW5JtwJLGkZk+LCWAYZe 1+Yey78etG8M+Dva16Zpm+n62CsWZ/KWnTQ=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1310744284@xxxxxxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1310744284@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.7.5
# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1310741871 -7200
# Node ID e0ff4eea0432e0af3210e090a47414a0126e9904
# Parent  d0dcdddf5285eba0605a95dfda79b794803fa733
xentrace: replace ASSERT with printk in __trace_var

If trace_var gets called with large extra_data, do not crash the hypervisor.
Instead print a warning and truncate the buffer.

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>

diff -r d0dcdddf5285 -r e0ff4eea0432 xen/common/trace.c
--- a/xen/common/trace.c
+++ b/xen/common/trace.c
@@ -683,7 +683,10 @@ void __trace_var(u32 event, bool_t cycle
     if ( (extra % sizeof(u32)) != 0 )
         extra_word++;
     
-    ASSERT(extra_word <= TRACE_EXTRA_MAX);
+    if ( unlikely(extra_word > TRACE_EXTRA_MAX) )
+        printk(XENLOG_WARNING "xentrace: event %x extra_data %u too large.\n",
+                event, extra);
+
     extra_word = min_t(int, extra_word, TRACE_EXTRA_MAX);
 
     /* Round size up to nearest word */

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