]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
dtrace: fix lquantize for 32-bit overflow on values
authorEugene Loh <eugene.loh@oracle.com>
Tue, 25 Jul 2017 19:52:19 +0000 (12:52 -0700)
committerTomas Jedlicka <tomas.jedlicka@oracle.com>
Fri, 15 Sep 2017 08:34:57 +0000 (10:34 +0200)
Fix dtrace_aggregate_lquantize() so that it no longer truncates
value to or computes bin index in 32 bits.  Linux bug is
26268136 dtrace_aggregate_lquantize() suffers from 32-bit overflow
It references a corresponding Solaris bug.

Orabug: 26268136

Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
dtrace/dtrace_probe_ctx.c

index 5a539a18243f365a8d80f0b4937ec66b6d102e11..53ac64f0f66f9eef25546fab0f9856594ca3aa0e 100644 (file)
@@ -166,7 +166,7 @@ void dtrace_aggregate_lquantize(uint64_t *lquanta, uint64_t nval,
        int32_t         base = DTRACE_LQUANTIZE_BASE(arg);
        uint16_t        step = DTRACE_LQUANTIZE_STEP(arg);
        uint16_t        levels = DTRACE_LQUANTIZE_LEVELS(arg);
-       int32_t         val = (int32_t)nval, level;
+       int64_t         val = (int64_t)nval, level;
 
        ASSERT(step != 0);
        ASSERT(levels != 0);