Skip to content

Commit 516fb01

Browse files
committed
db: return EINVAL if there are any unknown flags set in the comparison op
Signed-off-by: James Henstridge <james.henstridge@canonical.com>
1 parent 6bdc497 commit 516fb01

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/db.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2331,6 +2331,11 @@ int db_col_rule_add(struct db_filter_col *col,
23312331
rc = -EINVAL;
23322332
goto add_return;
23332333
}
2334+
/* Check that no unknown flags are specified in the op */
2335+
if ((arg_data.op & ~(SCMP_CMP_OPMASK | SCMP_CMP_32BIT)) != 0) {
2336+
rc = -EINVAL;
2337+
goto add_return;
2338+
}
23342339
} else {
23352340
rc = -EINVAL;
23362341
goto add_return;

0 commit comments

Comments
 (0)