diff options
author | Alan Modra <amodra@gmail.com> | 2020-01-13 14:27:19 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-01-13 16:44:27 +1030 |
commit | febda64f152972d8edf0147fb29f89b02f6a4cf9 (patch) | |
tree | 530633bd36c29a3fd0715e8658777f665385aa9a /opcodes/ChangeLog | |
parent | df08b5881b4972d78f9a2069955dad5b12bc972e (diff) | |
download | gdb-febda64f152972d8edf0147fb29f89b02f6a4cf9.zip gdb-febda64f152972d8edf0147fb29f89b02f6a4cf9.tar.gz gdb-febda64f152972d8edf0147fb29f89b02f6a4cf9.tar.bz2 |
ubsan: wasm32: signed integer overflow
The signed integer overflow occurred when adding one to target_count
for (i = 0; i < target_count + 1; i++)
but that's the least of the worries here. target_count was long and i
int, leading to the possibility of a loop that never ended.
So to avoid this type of vulnerability, this patch uses what I believe
to be the proper types for arguments of various wasm32 opcodes, rather
than using "long" which may change in size.
gas/
* testsuite/gas/wasm32/allinsn.d: Update expected output.
opcodes/
* wasm32-dis.c (print_insn_wasm32): Localise variables. Store
result of wasm_read_leb128 in a uint64_t and check that bits
are not lost when copying to other locals. Use uint32_t for
most locals. Use PRId64 when printing int64_t.
Diffstat (limited to 'opcodes/ChangeLog')
-rw-r--r-- | opcodes/ChangeLog | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index e034a61..4584331 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,5 +1,12 @@ 2020-01-13 Alan Modra <amodra@gmail.com> + * wasm32-dis.c (print_insn_wasm32): Localise variables. Store + result of wasm_read_leb128 in a uint64_t and check that bits + are not lost when copying to other locals. Use uint32_t for + most locals. Use PRId64 when printing int64_t. + +2020-01-13 Alan Modra <amodra@gmail.com> + * score-dis.c: Formatting. * score7-dis.c: Formatting. |