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

Mock bind program incorrectly declares support for supports_context_header #4124

Open
Alan-Jowett opened this issue Jan 10, 2025 · 1 comment
Assignees
Labels
bug Something isn't working P2 tests triaged Discussed in a triage meeting
Milestone

Comments

@Alan-Jowett
Copy link
Member

If a program information provider sets supports_context_header then it must allocate a context with the space for this.

Declared here:

.capabilities = {.supports_context_header = true},

Allocated here:

bind_md_t* bind_context = reinterpret_cast<bind_md_t*>(ebpf_allocate(sizeof(bind_md_t)));

Due to the mismatch, doing a prog test run using this mock program causes heap corruption.

@dthaler dthaler added the bug Something isn't working label Jan 13, 2025
@shankarseal shankarseal added tests triaged Discussed in a triage meeting labels Jan 13, 2025
@shankarseal
Copy link
Collaborator

In addition to fixing the test, add a unit test the exercises this code path.

@shankarseal shankarseal added this to the 2502 milestone Jan 13, 2025
@shankarseal shankarseal added the P2 label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P2 tests triaged Discussed in a triage meeting
Projects
None yet
Development

No branches or pull requests

4 participants