Skip to content

bpf: Fix race when accessing m.fd#11812

Merged
borkmann merged 1 commit intomasterfrom
pr/tgraf/bpf-map-race
Jun 2, 2020
Merged

bpf: Fix race when accessing m.fd#11812
borkmann merged 1 commit intomasterfrom
pr/tgraf/bpf-map-race

Conversation

@tgraf
Copy link
Copy Markdown
Contributor

@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
@tgraf
Copy link
Copy Markdown
Contributor Author

tgraf commented Jun 2, 2020

test-me-please

Comment thread pkg/bpf/map_linux.go
Comment thread pkg/bpf/map_linux.go
@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
@borkmann borkmann deleted the pr/tgraf/bpf-map-race branch June 2, 2020 12:21
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

None yet

Development

Successfully merging this pull request may close these issues.

DATA RACE: m.fd unsafely accessed

4 participants