Date: Mon, 6 Jun 2016 22:07:55 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r301525 - vendor-sys/illumos/dist/uts/common/dtrace Message-ID: <201606062207.u56M7taM040776@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Mon Jun 6 22:07:55 2016 New Revision: 301525 URL: https://svnweb.freebsd.org/changeset/base/301525 Log: 7033 ustack helper should fault on bad return values Reviewed by: Patrick Mooney <patrick.mooney@joyent.com> Reviewed by: Bryan Cantrill <bryan@joyent.com> Approved by: Matthew Ahrens <mahrens@delphix.com> Author: Alex Wilson <alex.wilson@joyent.com> illumos/illumos-gate@a2f72b65ebc430aaf277ad797e554bb4deba9b95 Modified: vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Modified: vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Mon Jun 6 22:06:45 2016 (r301524) +++ vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Mon Jun 6 22:07:55 2016 (r301525) @@ -6526,6 +6526,7 @@ dtrace_action_ustack(dtrace_mstate_t *ms uint64_t *pcs = &buf[1], *fps; char *str = (char *)&pcs[nframes]; int size, offs = 0, i, j; + size_t rem; uintptr_t old = mstate->dtms_scratch_ptr, saved; uint16_t *flags = &cpu_core[CPU->cpu_id].cpuc_dtrace_flags; char *sym; @@ -6597,12 +6598,18 @@ dtrace_action_ustack(dtrace_mstate_t *ms continue; } + if (!dtrace_strcanload((uintptr_t)sym, strsize, &rem, mstate, + &(state->dts_vstate))) { + str[offs++] = '\0'; + continue; + } + DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); /* * Now copy in the string that the helper returned to us. */ - for (j = 0; offs + j < strsize; j++) { + for (j = 0; offs + j < strsize && j < rem; j++) { if ((str[offs + j] = sym[j]) == '\0') break; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201606062207.u56M7taM040776>