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

Fix failure in FuzzDenyPreferredInsert test #30368

Merged

Conversation

christarazi
Copy link
Member

  • policy: De-dup logic for insertion in map state in addDependentOnEntry()
  • policy: Initialize mapstate structures before insertion

The logic for Insert() was duplicated inside addDependentOnEntry(), so
call Insert() instead of repeating the logic for insertion.

Signed-off-by: Chris Tarazi <chris@isovalent.com>
This commit refactors the mapstate insertion code such that it ensures
the underlying map is initialized before inserting. The idea is to
prevent the following error message:

```
panic: assignment to entry in nil map
```

which was exposed by the FuzzDenyPreferredInsert fuzz test.[1]

Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=63091

[1]: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=63091

Signed-off-by: Chris Tarazi <chris@isovalent.com>
@christarazi christarazi requested a review from a team as a code owner January 23, 2024 02:46
@christarazi christarazi added kind/bug This is a bug in the Cilium logic. sig/policy Impacts whether traffic is allowed or denied based on user-defined policies. release-note/misc This PR makes changes that have no direct user impact. labels Jan 23, 2024
@christarazi christarazi changed the title pr/christarazi/fix fuzzing nil ptr Fix failure in FuzzDenyPreferredInsert test Jan 23, 2024
@christarazi
Copy link
Member Author

/test

@christarazi christarazi added the needs-backport/1.15 This PR / issue needs backporting to the v1.15 branch label Jan 23, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot added this to Needs backport from main in v1.15.0-rc.1 Jan 23, 2024
@aanm aanm added this to Needs backport from main in 1.15.1 Jan 31, 2024
@aanm aanm removed this from Needs backport from main in v1.15.0-rc.1 Jan 31, 2024
@christarazi
Copy link
Member Author

cc @cilium/sig-policy

@christarazi christarazi added this pull request to the merge queue Feb 1, 2024
Merged via the queue into cilium:main with commit 3f523d3 Feb 1, 2024
63 checks passed
@christarazi christarazi deleted the pr/christarazi/fix-fuzzing-nil-ptr branch February 1, 2024 17:01
@nbusseneau nbusseneau mentioned this pull request Feb 8, 2024
12 tasks
@nbusseneau nbusseneau added backport-pending/1.15 The backport for Cilium 1.15.x for this PR is in progress. and removed needs-backport/1.15 This PR / issue needs backporting to the v1.15 branch labels Feb 8, 2024
@github-actions github-actions bot added backport-done/1.15 The backport for Cilium 1.15.x for this PR is done. and removed backport-pending/1.15 The backport for Cilium 1.15.x for this PR is in progress. labels Feb 9, 2024
@michi-covalent michi-covalent moved this from Needs backport from main to Backport done to v1.15 in 1.15.1 Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-done/1.15 The backport for Cilium 1.15.x for this PR is done. kind/bug This is a bug in the Cilium logic. release-note/misc This PR makes changes that have no direct user impact. sig/policy Impacts whether traffic is allowed or denied based on user-defined policies.
Projects
No open projects
1.15.1
Backport done to v1.15
Development

Successfully merging this pull request may close these issues.

None yet

3 participants