Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpf: fix incorrect inline asm output operands sections #2773

Merged
merged 4 commits into from
Aug 8, 2024

Conversation

mtardy
Copy link
Member

@mtardy mtardy commented Aug 6, 2024

In some places, certainly because of copy-paste we use the inputs operands instead of the output operands section.

I also spotted some incorrect constraints, r+ instead of +r for example.

@mtardy mtardy added the area/bpf This is related to BPF code label Aug 6, 2024
@mtardy mtardy changed the title Pr/mtardy/fix inline asm bpf: fix incorrect inline asm output operands sections Aug 6, 2024
@mtardy mtardy added the release-note/misc This PR makes changes that have no direct user impact. label Aug 6, 2024
@mtardy mtardy requested a review from kevsecurity August 6, 2024 18:24
@mtardy
Copy link
Member Author

mtardy commented Aug 6, 2024

mmh they are more I missed many, I only searched for rg "asm volatile.*::" so far.

Copy link
Contributor

@kevsecurity kevsecurity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work

mtardy added 3 commits August 7, 2024 12:00
In some places, certainly because of copy-paste we use the inputs
operands instead of the output operands section.

Signed-off-by: Mahe Tardy <[email protected]>
After finding a "r+" constraint in a previous inline assembly line that
was undetected since it was ignored by the compiler, because it was in
the input operands and not the output operands, I searched for more

Signed-off-by: Mahe Tardy <[email protected]>
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]>
@mtardy mtardy force-pushed the pr/mtardy/fix-inline-asm branch from 4109648 to 9c96566 Compare August 7, 2024 10:00
You cannot use the '+' modifier constraint on inputs, and here size is
not written to.

Signed-off-by: Mahe Tardy <[email protected]>
@mtardy mtardy marked this pull request as ready for review August 7, 2024 10:27
@mtardy mtardy requested a review from a team as a code owner August 7, 2024 10:27
@mtardy mtardy requested a review from jrfastab August 7, 2024 10:27
@mtardy
Copy link
Member Author

mtardy commented Aug 7, 2024

Good work

Thanks, I pushed a few other fixes. I'll try to get John's review on this one.

@mtardy mtardy added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Aug 7, 2024
@jrfastab jrfastab merged commit 2fc399f into main Aug 8, 2024
45 checks passed
@jrfastab jrfastab deleted the pr/mtardy/fix-inline-asm branch August 8, 2024 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/bpf This is related to BPF code kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants