[DTrace-devel] [oracle/dtrace-utils] 312aff: cg: fix ALLOCA taint propagation for struct/union ...

Kris Van Hees noreply at github.com
Fri Aug 18 20:07:48 UTC 2023


  Branch: refs/heads/kvh/2.0-branch-dev-ip
  Home:   https://github.com/oracle/dtrace-utils
  Commit: 312aff0f7b3bd3e973f5b142c17440f1ac5c4d92
      https://github.com/oracle/dtrace-utils/commit/312aff0f7b3bd3e973f5b142c17440f1ac5c4d92
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-18 (Fri, 18 Aug 2023)

  Changed paths:
    M libdtrace/dt_parser.c
    A test/unittest/codegen/tst.alloca-taint-sou-access.d

  Log Message:
  -----------
  cg: fix ALLOCA taint propagation for struct/union member access

When alloca'd memory stores a struct or union, lvalues that represent
members in that struct or union should also be marked as pointers to
alloca'd memory.

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Nick Alcock <nick.alcock at oracle.com>


  Commit: 28171d34ffcbfdbb783db2bf5f4bf110362104ca
      https://github.com/oracle/dtrace-utils/commit/28171d34ffcbfdbb783db2bf5f4bf110362104ca
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-18 (Fri, 18 Aug 2023)

  Changed paths:
    M bpf/basename.S
    M bpf/dirname.S
    M bpf/inet_ntoa.S
    M bpf/lltostr.S
    M libdtrace/dt_cg.c

  Log Message:
  -----------
  cg, bpf: Pass dctx as first arg in arg-to-tstring subroutines

Passing a pointer to the DTrace context (dctx) enables subroutines
called through arg-to-tstring to report faults if necessary.  It also
gives the implementation of these subroutines access to context data.
(None use that as of yet, but e.g. inet_ntoa6() is expected to need
it.)

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>


  Commit: c5d1c19f79061e5be77d66f4f615698ba408ac55
      https://github.com/oracle/dtrace-utils/commit/c5d1c19f79061e5be77d66f4f615698ba408ac55
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-18 (Fri, 18 Aug 2023)

  Changed paths:
    M libdtrace/dt_strtab.c
    M libdtrace/dt_strtab.h

  Log Message:
  -----------
  strtab: make internal structures private

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>


  Commit: 234064dfbaeeff3d408a86178cdd0544bab072ad
      https://github.com/oracle/dtrace-utils/commit/234064dfbaeeff3d408a86178cdd0544bab072ad
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-18 (Fri, 18 Aug 2023)

  Changed paths:
    M libdtrace/Build
    M libdtrace/dt_bpf.c
    M libdtrace/dt_bpf.h
    M libdtrace/dt_cc.c
    M libdtrace/dt_cg.c
    M libdtrace/dt_dctx.h
    M libdtrace/dt_dlibs.c
    M libdtrace/dt_impl.h
    M libdtrace/dt_open.c
    A libdtrace/dt_rodata.c
    A libdtrace/dt_rodata.h
    M libdtrace/dt_subr.c

  Log Message:
  -----------
  Add rodata support

This patch provides for read-only data to be placed in its own memory
block (much like the .rodata ELF section).  It lays the groundwork for
future enhancements that support .rodata sections in precompiled BPF
code (as may be generated for static data items), and for the storage
of read-only data that is not constrained by the maximum string size.

Its first user will be the inet_ntoa6() implementation that needs to
store a read-only lookup table.

The string table can be considered a special case of read-only data
(as evidenced by the clear duplication of code between dt_rodata.c and
dt_strtab.c) and a future patch will convert the strtab implementation
to be a wrapper for a rodata-style memory block.

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>


  Commit: 4d4472241439b17e26bae8a3d4be5f7fa00694ea
      https://github.com/oracle/dtrace-utils/commit/4d4472241439b17e26bae8a3d4be5f7fa00694ea
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-18 (Fri, 18 Aug 2023)

  Changed paths:
    M libdtrace/dt_cg.c

  Log Message:
  -----------
  cg: optional 4th arg for dt_cg_subr_arg_to_tstring() calls

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>


  Commit: 8162f252e4daf48a1e092de548c96fc03fa70f7b
      https://github.com/oracle/dtrace-utils/commit/8162f252e4daf48a1e092de548c96fc03fa70f7b
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-18 (Fri, 18 Aug 2023)

  Changed paths:
    M libdtrace/dt_cg.c
    A test/unittest/translators/tst.NullInput.d
    M test/unittest/translators/tst.ProcModelTrans.d

  Log Message:
  -----------
  cg: allow input to translator to be NULL

Some translators support NULL as input pointer value.  The code generator
was performing a NULL-check on a the LHS of a PTR or DOT node before
considering the possibility that the node is subject to translator
handling.  The check should happen after translator handling.

With this patch, tst.ProcModelTrans.d works but only for the case of
NULL input.  The test is changed to actually use a real task_struct as
input.  New test tst.NullInput.d exercises the case this patch fixes.

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>


  Commit: ccb9f19f5d4496a5d90ae38ccb0ef15b1fb802b3
      https://github.com/oracle/dtrace-utils/commit/ccb9f19f5d4496a5d90ae38ccb0ef15b1fb802b3
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-18 (Fri, 18 Aug 2023)

  Changed paths:
    M bpf/Build
    A bpf/inet_ntoa6.S
    M libdtrace/dt_cg.c
    M libdtrace/dt_dctx.h
    M libdtrace/dt_impl.h
    R test/unittest/funcs/err.inet_ntoa6badaddr.d
    A test/unittest/funcs/inet_ntoa6/err.inet_ntoa6badaddr.d
    A test/unittest/funcs/inet_ntoa6/tst.inet_ntoa6.d
    A test/unittest/funcs/inet_ntoa6/tst.inet_ntoa6.r
    A test/unittest/funcs/inet_ntoa6/tst.inet_ntoa6.strsize_10.d
    A test/unittest/funcs/inet_ntoa6/tst.inet_ntoa6.strsize_10.r
    A test/unittest/funcs/inet_ntoa6/tst.inet_ntoa6.strsize_40.d
    A test/unittest/funcs/inet_ntoa6/tst.inet_ntoa6.strsize_40.r
    R test/unittest/funcs/tst.inet_ntoa6.d
    R test/unittest/funcs/tst.inet_ntoa6.r

  Log Message:
  -----------
  Add support for inet_ntoa6() subroutine

This patch also introduces a size limit for tstrings that can differ
from strsize because internal routines might need extra space.  The
tstring size is now defined as DT_TSTRING_SIZE, and it is the larger
or strsize and the maximum space routines require.  Right now, the
only routine that requires extra space is inet_ntoa6() because it
use the tstring to store its output and to store 2 copies of the
input data, for a total of 40 bytes + 2 * 16 bytes = 72 bytes.

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>


  Commit: a15fc60d583e2f28813896b3fd801cf4e2a497f4
      https://github.com/oracle/dtrace-utils/commit/a15fc60d583e2f28813896b3fd801cf4e2a497f4
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-18 (Fri, 18 Aug 2023)

  Changed paths:
    M libdtrace/dt_cg.c
    A test/unittest/bitfields/tst.bitfield-offset.d

  Log Message:
  -----------
  cg: correct bitfield offset determination

The C compiler (together with binutils) can represent bitfields using
one of two representations: store the actual offset of the bitfield in
ctm_offset, or store the base offset of the underlying type in ctm_offset
and store the offset within the underlying type as cte_offset.

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>


  Commit: dfdc3996bf72219634700e3a05c4c6d0fcf9d135
      https://github.com/oracle/dtrace-utils/commit/dfdc3996bf72219634700e3a05c4c6d0fcf9d135
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-18 (Fri, 18 Aug 2023)

  Changed paths:
    M libdtrace/dt_cg.c

  Log Message:
  -----------
  cg: fix tstring leak in translator members that yield string values

When a translator member yields a string value, the tstring holding the
value was not properly tracked.  This resulted in an assertion failure
in test/demo/ip/ipproto.d.

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>


  Commit: 010d2ddfec3d0eced369ec5e824d28509524f8ce
      https://github.com/oracle/dtrace-utils/commit/010d2ddfec3d0eced369ec5e824d28509524f8ce
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-18 (Fri, 18 Aug 2023)

  Changed paths:
    M libdtrace/dt_aggregate.c
    M libdtrace/dt_cg.c
    M libdtrace/dt_consume.c
    M libdtrace/dt_open.c
    M test/unittest/aggs/tst.negtrunc.d
    M test/unittest/aggs/tst.negtruncquant.d
    M test/unittest/aggs/tst.trunc.d
    M test/unittest/aggs/tst.trunc0.d
    M test/unittest/aggs/tst.truncquant.d

  Log Message:
  -----------
  Implement the trunc() action

Some tests will not yield the desired results yet due to issues with
switchrate/aggrate/statusrate implementation details that those
tests depend on.

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>


  Commit: 7384e5d720dbbe7f7df79063e12a7d3e868a4c7e
      https://github.com/oracle/dtrace-utils/commit/7384e5d720dbbe7f7df79063e12a7d3e868a4c7e
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-18 (Fri, 18 Aug 2023)

  Changed paths:
    R test/unittest/aggs/tst.subr.d
    A test/unittest/funcs/tst.subr.d

  Log Message:
  -----------
  test: update and move tst.subr.d

The tst.subr.d test resided under the aggs/ hierarchy which does not
make sense because it tests for the implementation of subroutines (and
simply uses aggregations to collect data based on subroutine return
types (int, string, or void).

The test has been updated to reflect the current set of implemented
subroutines.

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>


  Commit: 9afd10be65b2e66b87f6ca3a4bf5f3d2ce8765a4
      https://github.com/oracle/dtrace-utils/commit/9afd10be65b2e66b87f6ca3a4bf5f3d2ce8765a4
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-08-18 (Fri, 18 Aug 2023)

  Changed paths:
    A test/unittest/aggs/tst.trunc-lquantize-5.d
    A test/unittest/aggs/tst.trunc-lquantize-5.r
    A test/unittest/aggs/tst.trunc-lquantize-default.d
    A test/unittest/aggs/tst.trunc-lquantize-default.r
    A test/unittest/aggs/tst.trunc-lquantize-neg5.d
    A test/unittest/aggs/tst.trunc-lquantize-neg5.r
    A test/unittest/aggs/tst.trunc-sum-5.d
    A test/unittest/aggs/tst.trunc-sum-5.r
    A test/unittest/aggs/tst.trunc-sum-default.d
    A test/unittest/aggs/tst.trunc-sum-default.r
    A test/unittest/aggs/tst.trunc-sum-neg5.d
    A test/unittest/aggs/tst.trunc-sum-neg5.r

  Log Message:
  -----------
  test: Add trunc tests

Theoretically, funny race conditions could arise between producer
and consumer, especially for functions like trunc(), which are
generated in the producer but then executed in the consumer.

Add some trunc tests that should be robust against such races.
They are patterned after similar clear() tests.  Specifically,
many aggregations are performed and then followed immediately by
the trunc() call to be tested.  Then, the test waits, protecting
it from variations in update rates, before a final aggregation is
performed and results dumped out.

Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>


  Commit: eb3ae5b89dd5c3718de355ed6e38b5abe5a48c40
      https://github.com/oracle/dtrace-utils/commit/eb3ae5b89dd5c3718de355ed6e38b5abe5a48c40
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-08-18 (Fri, 18 Aug 2023)

  Changed paths:
    M libdtrace/dt_aggregate.c

  Log Message:
  -----------
  Simplify code to match aggregation key

Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>


  Commit: d2e982eb68684e7372f9469f6527ea2fb92f410e
      https://github.com/oracle/dtrace-utils/commit/d2e982eb68684e7372f9469f6527ea2fb92f410e
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-18 (Fri, 18 Aug 2023)

  Changed paths:
    M libdtrace/Build
    M libdtrace/dt_open.c
    A libdtrace/dt_prov_ip.c
    M libdtrace/dt_provider.h
    M libdtrace/ip.d
    M test/demo/ip/ipproto.d
    M test/unittest/funcs/tst.inet_ntoa.d

  Log Message:
  -----------
  Implement the ip provider

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>


Compare: https://github.com/oracle/dtrace-utils/compare/d4c53b8d6648...d2e982eb6868



More information about the DTrace-devel mailing list