summaryrefslogtreecommitdiffstats
path: root/testsuite/transko/varargs.stp
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-10-09 17:32:26 -0700
committerJosh Stone <jistone@redhat.com>2009-10-21 09:08:07 -0700
commit8f805d3329e985f0ea0851fa1522ab447765af27 (patch)
tree47144dc67421664c8f0d17f4bb831781d2036459 /testsuite/transko/varargs.stp
parenta8f1332f49206b314871fbdea50ab1045401a024 (diff)
downloadsystemtap-steved-8f805d3329e985f0ea0851fa1522ab447765af27.tar.gz
systemtap-steved-8f805d3329e985f0ea0851fa1522ab447765af27.tar.xz
systemtap-steved-8f805d3329e985f0ea0851fa1522ab447765af27.zip
PR10750: Enforce a reasonable limit on # of varargs
If we leave the number of args unbounded, then an excessively-sized printf could cause a kernel stack overflow. I've arbitrarily chosen 32 as our new maximum. * translate.cxx (c_unparser::visit_print_format): Throw if >32 args. * testsuite/transko/varargs.stp: Assert that 33 args aren't allowed. * testsuite/transok/varargs.stp: Assert that 32 args are ok.
Diffstat (limited to 'testsuite/transko/varargs.stp')
-rwxr-xr-xtestsuite/transko/varargs.stp10
1 files changed, 10 insertions, 0 deletions
diff --git a/testsuite/transko/varargs.stp b/testsuite/transko/varargs.stp
new file mode 100755
index 00000000..f38309ad
--- /dev/null
+++ b/testsuite/transko/varargs.stp
@@ -0,0 +1,10 @@
+#! stap -p3
+
+probe begin {
+ // PR10750 enforces at most 32 print args
+ println(1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32,
+ 33)
+}