Skip to content

Commit

Permalink
bpf: fix an incorrect inline asm operands and constraints
Browse files Browse the repository at this point in the history
While searching for using input operands while we should use the output
operand, I found the "r+" mistake, that is detected when you fix the
operands since the compiler no longer ignores it.

Signed-off-by: Mahe Tardy <[email protected]>
  • Loading branch information
mtardy committed Aug 7, 2024
1 parent 6d5802d commit 9c96566
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bpf/process/pfilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,8 @@ generic_process_filter(struct bpf_map_def *heap, struct bpf_map_def *fmap)
pass = selector_process_filter(f, curr, enter, msg);
if (pass) {
/* Verify lost that msg is not null here so recheck */
asm volatile("%[curr] &= 0x1f;\n" ::[curr] "r+"(curr)
:);
asm volatile("%[curr] &= 0x1f;\n"
: [curr] "+r"(curr));
sel->active[curr] = true;
sel->active[SELECTORS_ACTIVE] = true;
sel->pass |= true;
Expand Down

0 comments on commit 9c96566

Please sign in to comment.