projects
/
lttng-modules.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Filter: catch shift undefined behavior
[lttng-modules.git]
/
lttng-filter-interpreter.c
diff --git
a/lttng-filter-interpreter.c
b/lttng-filter-interpreter.c
index 5bf0bd6074719ef59cf5dc8a2fe57f4cc0f5e7e7..b1e5ba7360261a651386ebfa4485093a4a566237 100644
(file)
--- a/
lttng-filter-interpreter.c
+++ b/
lttng-filter-interpreter.c
@@
-990,6
+990,11
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
{
int64_t res;
{
int64_t res;
+ /* Catch undefined behavior. */
+ if (unlikely(estack_ax_v < 0 || estack_ax_v >= 64)) {
+ ret = -EINVAL;
+ goto end;
+ }
res = (estack_bx_v >> estack_ax_v);
estack_pop(stack, top, ax, bx);
estack_ax_v = res;
res = (estack_bx_v >> estack_ax_v);
estack_pop(stack, top, ax, bx);
estack_ax_v = res;
@@
-1000,6
+1005,11
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
{
int64_t res;
{
int64_t res;
+ /* Catch undefined behavior. */
+ if (unlikely(estack_ax_v < 0 || estack_ax_v >= 64)) {
+ ret = -EINVAL;
+ goto end;
+ }
res = (estack_bx_v << estack_ax_v);
estack_pop(stack, top, ax, bx);
estack_ax_v = res;
res = (estack_bx_v << estack_ax_v);
estack_pop(stack, top, ax, bx);
estack_ax_v = res;
This page took
0.022755 seconds
and
4
git commands to generate.