Skip to content

Commit

Permalink
db: return EINVAL if there are any unknown flags set in the compariso…
Browse files Browse the repository at this point in the history
…n op

Signed-off-by: James Henstridge <james.henstridge@canonical.com>
  • Loading branch information
jhenstridge committed May 12, 2022
1 parent 6bdc497 commit 516fb01
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/db.c
Original file line number Diff line number Diff line change
Expand Up @@ -2331,6 +2331,11 @@ int db_col_rule_add(struct db_filter_col *col,
rc = -EINVAL;
goto add_return;
}
/* Check that no unknown flags are specified in the op */
if ((arg_data.op & ~(SCMP_CMP_OPMASK | SCMP_CMP_32BIT)) != 0) {
rc = -EINVAL;
goto add_return;
}
} else {
rc = -EINVAL;
goto add_return;
Expand Down

0 comments on commit 516fb01

Please sign in to comment.