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 race when accessing m.fd #11812

Merged
merged 1 commit into from Jun 2, 2020
Merged

bpf: Fix race when accessing m.fd #11812

merged 1 commit into from Jun 2, 2020

Conversation

tgraf
Copy link
Member

@tgraf tgraf commented Jun 2, 2020

Open() writes to m.fd and thus must hold m.lock while doing so. Require
m.lock to be held for writing. This also means that we can remove
m.openLock. This simplifies the overall fix as the question of order
when acquiring m.lock and m.openLock does not come up.

Fixes: #10990

Open() writes to m.fd and thus must hold m.lock while doing so. Require
m.lock to be held for writing. This also means that we can remove
m.openLock. This simplifies the overall fix as the question of order
when acquiring m.lock and m.openLock does not come up.

Fixes: #10990

Signed-off-by: Thomas Graf <thomas@cilium.io>
@tgraf tgraf added kind/bug This is a bug in the Cilium logic. priority/release-blocker release-note/misc This PR makes changes that have no direct user impact. labels Jun 2, 2020
@tgraf tgraf requested a review from a team June 2, 2020 09:12
@maintainer-s-little-helper maintainer-s-little-helper bot added this to Needs backport from master in 1.8.0 Jun 2, 2020
@maintainer-s-little-helper maintainer-s-little-helper bot added this to In progress in 1.8.0 Jun 2, 2020
@tgraf
Copy link
Member Author

tgraf commented Jun 2, 2020

test-me-please

pkg/bpf/map_linux.go Show resolved Hide resolved
pkg/bpf/map_linux.go Show resolved Hide resolved
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jun 2, 2020
@borkmann borkmann merged commit 1729be2 into master Jun 2, 2020
1.8.0 automation moved this from In progress to Merged Jun 2, 2020
@borkmann borkmann deleted the pr/tgraf/bpf-map-race branch June 2, 2020 12:21
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from master to Backport pending to v1.8 in 1.8.0 Jun 3, 2020
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from master to Backport pending to v1.8 in 1.8.0 Jun 3, 2020
@joestringer joestringer moved this from Backport pending to v1.8 to Backport done to v1.8 in 1.8.0 Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This is a bug in the Cilium logic. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.
Projects
No open projects
1.8.0
Backport done to v1.8
1.8.0
  
Merged
Development

Successfully merging this pull request may close these issues.

DATA RACE: m.fd unsafely accessed
3 participants