Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Jan 2008 18:18:35 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 133485 for review
Message-ID:  <200801171818.m0HIIZnF015129@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=133485

Change 133485 by jhb@jhb_mutex on 2008/01/17 18:18:04

	Outsmart gcc so that we still exhaust the stack.

Affected files ...

.. //depot/projects/smpng/sys/modules/crash/crash.c#41 edit

Differences ...

==== //depot/projects/smpng/sys/modules/crash/crash.c#41 (text+ko) ====

@@ -751,12 +751,25 @@
     test_witness_order_funcs);
 #endif
 
+static int	blow_stack(void);
+
 static int
+eat_stack(void)
+{
+	u_int32_t dummy[128];
+
+	dummy[0] = arc4random();
+	dummy[0] += blow_stack();
+	return (dummy[0]);
+}
+
+static int
 blow_stack(void)
 {
-	char dummy[512];
+	u_int32_t dummy[128];
 
-	dummy[0] += blow_stack();
+	dummy[0] = arc4random();
+	dummy[0] += eat_stack();
 	return (dummy[0]);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801171818.m0HIIZnF015129>