projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Filter error message cleanup
[lttng-ust.git]
/
liblttng-ust
/
lttng-filter-validator.c
diff --git
a/liblttng-ust/lttng-filter-validator.c
b/liblttng-ust/lttng-filter-validator.c
index 4e257f5d9b969558f29e15dfcd34d3ea0e33dd85..456407ffde228fa625e3973b3d5e02c71b0bd4d7 100644
(file)
--- a/
liblttng-ust/lttng-filter-validator.c
+++ b/
liblttng-ust/lttng-filter-validator.c
@@
-190,7
+190,7
@@
int bytecode_validate_overflow(struct bytecode_runtime *bytecode,
{
if (unlikely(pc + sizeof(struct return_op)
> start_pc + bytecode->len)) {
{
if (unlikely(pc + sizeof(struct return_op)
> start_pc + bytecode->len)) {
- ret = -E
INVAL
;
+ ret = -E
RANGE
;
}
break;
}
}
break;
}
@@
-252,7
+252,7
@@
int bytecode_validate_overflow(struct bytecode_runtime *bytecode,
{
if (unlikely(pc + sizeof(struct binary_op)
> start_pc + bytecode->len)) {
{
if (unlikely(pc + sizeof(struct binary_op)
> start_pc + bytecode->len)) {
- ret = -E
INVAL
;
+ ret = -E
RANGE
;
}
break;
}
}
break;
}
@@
-270,7
+270,7
@@
int bytecode_validate_overflow(struct bytecode_runtime *bytecode,
{
if (unlikely(pc + sizeof(struct unary_op)
> start_pc + bytecode->len)) {
{
if (unlikely(pc + sizeof(struct unary_op)
> start_pc + bytecode->len)) {
- ret = -E
INVAL
;
+ ret = -E
RANGE
;
}
break;
}
}
break;
}
@@
-281,7
+281,7
@@
int bytecode_validate_overflow(struct bytecode_runtime *bytecode,
{
if (unlikely(pc + sizeof(struct logical_op)
> start_pc + bytecode->len)) {
{
if (unlikely(pc + sizeof(struct logical_op)
> start_pc + bytecode->len)) {
- ret = -E
INVAL
;
+ ret = -E
RANGE
;
}
break;
}
}
break;
}
@@
-300,7
+300,7
@@
int bytecode_validate_overflow(struct bytecode_runtime *bytecode,
{
if (unlikely(pc + sizeof(struct load_op) + sizeof(struct field_ref)
> start_pc + bytecode->len)) {
{
if (unlikely(pc + sizeof(struct load_op) + sizeof(struct field_ref)
> start_pc + bytecode->len)) {
- ret = -E
INVAL
;
+ ret = -E
RANGE
;
}
break;
}
}
break;
}
@@
-312,7
+312,7
@@
int bytecode_validate_overflow(struct bytecode_runtime *bytecode,
if (unlikely(pc + sizeof(struct load_op)
> start_pc + bytecode->len)) {
if (unlikely(pc + sizeof(struct load_op)
> start_pc + bytecode->len)) {
- ret = -E
INVAL
;
+ ret = -E
RANGE
;
break;
}
break;
}
@@
-320,7
+320,7
@@
int bytecode_validate_overflow(struct bytecode_runtime *bytecode,
str_len = strnlen(insn->data, maxlen);
if (unlikely(str_len >= maxlen)) {
/* Final '\0' not found within range */
str_len = strnlen(insn->data, maxlen);
if (unlikely(str_len >= maxlen)) {
/* Final '\0' not found within range */
- ret = -E
INVAL
;
+ ret = -E
RANGE
;
}
break;
}
}
break;
}
@@
-329,7
+329,7
@@
int bytecode_validate_overflow(struct bytecode_runtime *bytecode,
{
if (unlikely(pc + sizeof(struct load_op) + sizeof(struct literal_numeric)
> start_pc + bytecode->len)) {
{
if (unlikely(pc + sizeof(struct load_op) + sizeof(struct literal_numeric)
> start_pc + bytecode->len)) {
- ret = -E
INVAL
;
+ ret = -E
RANGE
;
}
break;
}
}
break;
}
@@
-338,7
+338,7
@@
int bytecode_validate_overflow(struct bytecode_runtime *bytecode,
{
if (unlikely(pc + sizeof(struct load_op) + sizeof(struct literal_double)
> start_pc + bytecode->len)) {
{
if (unlikely(pc + sizeof(struct load_op) + sizeof(struct literal_double)
> start_pc + bytecode->len)) {
- ret = -E
INVAL
;
+ ret = -E
RANGE
;
}
break;
}
}
break;
}
@@
-349,7
+349,7
@@
int bytecode_validate_overflow(struct bytecode_runtime *bytecode,
{
if (unlikely(pc + sizeof(struct cast_op)
> start_pc + bytecode->len)) {
{
if (unlikely(pc + sizeof(struct cast_op)
> start_pc + bytecode->len)) {
- ret = -E
INVAL
;
+ ret = -E
RANGE
;
}
break;
}
}
break;
}
@@
-1099,9
+1099,10
@@
int lttng_filter_validate_bytecode(struct bytecode_runtime *bytecode)
start_pc = &bytecode->data[0];
for (pc = next_pc = start_pc; pc - start_pc < bytecode->len;
pc = next_pc) {
start_pc = &bytecode->data[0];
for (pc = next_pc = start_pc; pc - start_pc < bytecode->len;
pc = next_pc) {
- if (bytecode_validate_overflow(bytecode, start_pc, pc) != 0) {
- ERR("filter bytecode overflow\n");
- ret = -EINVAL;
+ ret = bytecode_validate_overflow(bytecode, start_pc, pc);
+ if (ret != 0) {
+ if (ret == -ERANGE)
+ ERR("filter bytecode overflow\n");
goto end;
}
dbg_printf("Validating op %s (%u)\n",
goto end;
}
dbg_printf("Validating op %s (%u)\n",
This page took
0.025034 seconds
and
4
git commands to generate.