PERFORCE change 133485 for review

John Baldwin jhb at FreeBSD.org
Thu Jan 17 10:18:36 PST 2008


http://perforce.freebsd.org/chv.cgi?CH=133485

Change 133485 by jhb at 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]);
 }
 


More information about the p4-projects mailing list