[DTrace-devel] [oracle/dtrace-utils] 362b93: Fix overflow in immediate operand to 'and'

Kris Van Hees noreply at github.com
Mon Aug 28 15:43:40 UTC 2023


  Branch: refs/heads/kvh/2.0-branch-dev
  Home:   https://github.com/oracle/dtrace-utils
  Commit: 362b93a9be81fff08135bc6699141321c0fc5253
      https://github.com/oracle/dtrace-utils/commit/362b93a9be81fff08135bc6699141321c0fc5253
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-08-28 (Mon, 28 Aug 2023)

  Changed paths:
    M bpf/index.S

  Log Message:
  -----------
  Fix overflow in immediate operand to 'and'

ALU instructions take a signed 32-bit IMM.  Strictly speaking,
0xffffffff overflows it.  Switch to -1 to be safe.

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


  Commit: cf6dd49155fe5aefcc93f1867c3ce0c7456cd2c0
      https://github.com/oracle/dtrace-utils/commit/cf6dd49155fe5aefcc93f1867c3ce0c7456cd2c0
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-28 (Mon, 28 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: fbfacc5855cc90a0f13b8ab326a9d18417f19596
      https://github.com/oracle/dtrace-utils/commit/fbfacc5855cc90a0f13b8ab326a9d18417f19596
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-28 (Mon, 28 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: fdb3b4698ba54fecff2e7e4c6232f835b999edec
      https://github.com/oracle/dtrace-utils/commit/fdb3b4698ba54fecff2e7e4c6232f835b999edec
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-28 (Mon, 28 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: e11098e22e863bea14e35a8ce4bae3118e6730e2
      https://github.com/oracle/dtrace-utils/commit/e11098e22e863bea14e35a8ce4bae3118e6730e2
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-28 (Mon, 28 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>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>


  Commit: 5cb6801ceade748c08b46169b91aefa4a981a7cf
      https://github.com/oracle/dtrace-utils/commit/5cb6801ceade748c08b46169b91aefa4a981a7cf
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-28 (Mon, 28 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: d91da7d2fb4f7303f9f3a4da2199ff63fa39aace
      https://github.com/oracle/dtrace-utils/commit/d91da7d2fb4f7303f9f3a4da2199ff63fa39aace
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-28 (Mon, 28 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: 1380696181d01d872864a4ce2ba7f6873aa6b1d3
      https://github.com/oracle/dtrace-utils/commit/1380696181d01d872864a4ce2ba7f6873aa6b1d3
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-28 (Mon, 28 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: 7392296852ab84739f1798f32dfb103646a8f4a3
      https://github.com/oracle/dtrace-utils/commit/7392296852ab84739f1798f32dfb103646a8f4a3
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-28 (Mon, 28 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: 1ad81012d81605c5b77df0e8916f690471b507ef
      https://github.com/oracle/dtrace-utils/commit/1ad81012d81605c5b77df0e8916f690471b507ef
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-28 (Mon, 28 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: a33b8c5913e1bbd36fb872fb580cc1b15673a6c1
      https://github.com/oracle/dtrace-utils/commit/a33b8c5913e1bbd36fb872fb580cc1b15673a6c1
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-28 (Mon, 28 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 may 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>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>


  Commit: 7cf085c996b2bc3765b366e551a0e381edd2ff72
      https://github.com/oracle/dtrace-utils/commit/7cf085c996b2bc3765b366e551a0e381edd2ff72
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-28 (Mon, 28 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: b55ea5246b8984f9e4104f87612d31453859bb0c
      https://github.com/oracle/dtrace-utils/commit/b55ea5246b8984f9e4104f87612d31453859bb0c
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-08-28 (Mon, 28 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: 98c7cc3fb625087e233ba58389ab63596e7f7e1f
      https://github.com/oracle/dtrace-utils/commit/98c7cc3fb625087e233ba58389ab63596e7f7e1f
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-08-28 (Mon, 28 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: d92d1bb2f1de22e59831e0406e07d53e89601fe4
      https://github.com/oracle/dtrace-utils/commit/d92d1bb2f1de22e59831e0406e07d53e89601fe4
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-28 (Mon, 28 Aug 2023)

  Changed paths:
    M libdtrace/dt_cc.c

  Log Message:
  -----------
  cc: remove dead code

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


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

  Changed paths:
    M libdtrace/dt_bpf.c
    M libdtrace/dt_bpf.h
    M libdtrace/dt_cc.c
    M libdtrace/dt_impl.h
    M libdtrace/dt_probe.c
    M libdtrace/dt_probe.h
    M libdtrace/dt_work.c

  Log Message:
  -----------
  cc, bpf: separate final BPF program creation from linking and loading

Some providers may need to do more complex code generaetion for the
probe BPF program trampoline.  The generation of trampoline code was
being done after BPF map creation, making it impossible for trampoline
code to use constructs that require data to be added to BPF maps.

The final BPF program handling has been changed to first create the
final programs, then create the BPF maps, and finally link and load the
BPF programs (performing the final relocations) and attaching them to
their probes.

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


Compare: https://github.com/oracle/dtrace-utils/compare/42f15d3235bc...c70fd4715d8d



More information about the DTrace-devel mailing list