X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttng-filter-interpreter.c;h=671f8b8a7dc45769edfaabb68b3d3fec4613b1af;hb=2f333868d848f2bb2265f9a91c5cceb447348dfd;hp=c7ce7d331bd2dc4eb8639751d7b38377ed451fca;hpb=ceabb767180e064629b5a9ab4ed14449da864763;p=lttng-modules.git diff --git a/lttng-filter-interpreter.c b/lttng-filter-interpreter.c index c7ce7d33..671f8b8a 100644 --- a/lttng-filter-interpreter.c +++ b/lttng-filter-interpreter.c @@ -7,15 +7,15 @@ * Copyright (C) 2010-2016 Mathieu Desnoyers */ -#include -#include -#include +#include +#include +#include #include #include #include -LTTNG_STACK_FRAME_NON_STANDARD(lttng_filter_interpret_bytecode); +STACK_FRAME_NON_STANDARD(lttng_filter_interpret_bytecode); /* * get_char should be called with page fault handler disabled if it is expected @@ -30,8 +30,7 @@ char get_char(struct estack_entry *reg, size_t offset) char c; /* Handle invalid access as end of string. */ - if (unlikely(!lttng_access_ok(VERIFY_READ, - reg->u.s.user_str + offset, + if (unlikely(!access_ok(reg->u.s.user_str + offset, sizeof(c)))) return '\0'; /* Handle fault (nonzero return value) as end of string. */ @@ -552,7 +551,7 @@ static int dynamic_load_field(struct estack_entry *stack_top) ret = -EINVAL; goto end; } - stack_top->u.s.seq_len = LTTNG_SIZE_MAX; + stack_top->u.s.seq_len = SIZE_MAX; stack_top->u.s.literal_type = ESTACK_STRING_LITERAL_TYPE_NONE; break; @@ -1129,7 +1128,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, ret = -EINVAL; goto end; } - estack_ax(stack, top)->u.s.seq_len = LTTNG_SIZE_MAX; + estack_ax(stack, top)->u.s.seq_len = SIZE_MAX; estack_ax(stack, top)->u.s.literal_type = ESTACK_STRING_LITERAL_TYPE_NONE; estack_ax(stack, top)->u.s.user = 0; @@ -1193,7 +1192,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, dbg_printk("load string %s\n", insn->data); estack_push(stack, top, ax, bx); estack_ax(stack, top)->u.s.str = insn->data; - estack_ax(stack, top)->u.s.seq_len = LTTNG_SIZE_MAX; + estack_ax(stack, top)->u.s.seq_len = SIZE_MAX; estack_ax(stack, top)->u.s.literal_type = ESTACK_STRING_LITERAL_TYPE_PLAIN; estack_ax(stack, top)->u.s.user = 0; @@ -1208,7 +1207,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, dbg_printk("load globbing pattern %s\n", insn->data); estack_push(stack, top, ax, bx); estack_ax(stack, top)->u.s.str = insn->data; - estack_ax(stack, top)->u.s.seq_len = LTTNG_SIZE_MAX; + estack_ax(stack, top)->u.s.seq_len = SIZE_MAX; estack_ax(stack, top)->u.s.literal_type = ESTACK_STRING_LITERAL_TYPE_STAR_GLOB; estack_ax(stack, top)->u.s.user = 0; @@ -1273,7 +1272,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, ret = -EINVAL; goto end; } - estack_ax(stack, top)->u.s.seq_len = LTTNG_SIZE_MAX; + estack_ax(stack, top)->u.s.seq_len = SIZE_MAX; estack_ax(stack, top)->u.s.literal_type = ESTACK_STRING_LITERAL_TYPE_NONE; estack_ax(stack, top)->u.s.user = 0; @@ -1323,7 +1322,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, ret = -EINVAL; goto end; } - estack_ax(stack, top)->u.s.seq_len = LTTNG_SIZE_MAX; + estack_ax(stack, top)->u.s.seq_len = SIZE_MAX; estack_ax(stack, top)->u.s.literal_type = ESTACK_STRING_LITERAL_TYPE_NONE; estack_ax(stack, top)->u.s.user = 1; @@ -1539,7 +1538,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, ret = -EINVAL; goto end; } - estack_ax(stack, top)->u.s.seq_len = LTTNG_SIZE_MAX; + estack_ax(stack, top)->u.s.seq_len = SIZE_MAX; estack_ax(stack, top)->u.s.literal_type = ESTACK_STRING_LITERAL_TYPE_NONE; next_pc += sizeof(struct load_op);