[DTrace-devel] [PATCH 2/3] cg: validate tstring alloc/free

Kris Van Hees kris.van.hees at oracle.com
Thu Jul 17 18:20:56 UTC 2025


On Wed, Jul 16, 2025 at 08:45:19PM -0400, Eugene Loh wrote:
> On 7/16/25 20:22, Kris Van Hees wrote:
> 
> > On Wed, Jul 16, 2025 at 07:07:59PM -0400, Eugene Loh wrote:
> > > I was a little concerned about this patch, but also wanted to expedite
> > > review.  FWIW, testing shows
> > > 
> > > test/unittest/builtinvar/tst.psinfo-bug21974606.d:
> > > test/unittest/builtinvar/tst.psinfo-bug22561297.d:
> > > test/unittest/builtinvar/tst.psinfo.d:
> > > test/unittest/builtinvar/tst.psinfo1.d:
> > > test/unittest/fbtprovider/tst.entryargs2.sh:
> > > test/unittest/funcs/copyinstr/tst.copyinstr-high-maxsize.d:
> > > test/unittest/funcs/copyinstr/tst.copyinstr-low-maxsize.d:
> > > test/unittest/funcs/copyinstr/tst.copyinstr-no-maxsize.d:
> > > test/unittest/funcs/copyinstr/tst.copyinstr.d:
> > > test/unittest/proc/tst.exec.sh:
> > > test/unittest/proc/tst.execfail.ENOENT.sh:
> > > test/unittest/proc/tst.execfail.sh:
> > > test/unittest/proc/tst.pr_psargs.d:
> > > test/unittest/proc/tst.pr_psargs_other_task.d:
> > > test/unittest/usdt/tst.argmap-typed-partial.d:
> > > test/unittest/usdt/tst.argmap-typed.d:
> > > test/unittest/variables/bvar/tst.execargs.d:
> > > test/demo/spec/specopen.d:
> > > 
> > > test/unittest/dif/bcopy.d:
> > > 
> > > failing on every VM.  (Well, bcopy is listed separately since we skip it on
> > > ARM.)  I'll try to put together a patch, but let me know if you already knew
> > > about this and have a fix.
> > I am looking into it as well.  Clearly, this patch is catching issues as
> > expected.
> 
> I guess, but those issues should be fixed before the patch is applied?  I'll
> move onto something else unless you think it's a good idea for two of us to
> be looking at this at once.  I do not understand, though, why we check if

See:
	[PATCH] tstring: fix leaks
just posted

> dnp->dn_kind is DT_NODE_FUNC or DT_NODE_OP1 or DT_NODE_OP2 or DT_NODE_OP3 or
> DT_NODE_DEXPR.

Because the way parser nodes are implemented, a rather complex union is used,
and various members in it are used by different node kinds for different
things.

Those nodes (and my patch adds one) are the nodes that can hold a tstring.



More information about the DTrace-devel mailing list