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

Signatures escape same Metadata.Properties map field to heap #4298

Closed
geyslan opened this issue Sep 11, 2024 · 2 comments
Closed

Signatures escape same Metadata.Properties map field to heap #4298

geyslan opened this issue Sep 11, 2024 · 2 comments
Assignees
Labels
Milestone

Comments

@geyslan
Copy link
Member

geyslan commented Sep 11, 2024

Description

This can cause a data race as detected in: https://github.com/aquasecurity/tracee/actions/runs/10814517981/job/30001186085?pr=4252#step:6:592

INFO: 
INFO: = TEST: TRC-1010 =================================================
INFO: 
INFO: 
INFO: UP AND RUNNING
INFO:

...

goroutine 20 [running]:
reflect.mapiternext(0x2104360?)
	/tmp/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.4.linux-arm64/src/runtime/map.go:1392 +0x1c
reflect.(*MapIter).Next(0x4000057300?)
	/tmp/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.4.linux-arm64/src/reflect/value.go:2005 +0x78
encoding/json.mapEncoder.encode({0x4000057468?}, 0x4000d1fd80, {0x2145200?, 0x4000d1fd78?, 0x20782c0?}, {0xd?, 0x0?})
	/tmp/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.4.linux-arm64/src/encoding/json/encode.go:745 +0x28c
encoding/json.structEncoder.encode({{{0x40004e3d48, 0x4, 0x4}, 0x4002fcad80, 0x4002fcadb0}}, 0x4000d1fd80, {0x22c5d00?, 0x4000d1fd40?, 0x96?}, {0xa8?, ...})
	/tmp/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.4.linux-arm64/src/encoding/json/encode.go:704 +0x190
encoding/json.ptrEncoder.encode({0x4000057688?}, 0x4000d1fd80, {0x2025240?, 0x4000c803a8?, 0x4000d1fd80?}, {0xb?, 0x0?})
	/tmp/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.4.linux-arm64/src/encoding/json/encode.go:876 +0x1ec
encoding/json.structEncoder.encode({{{0x4000392c08, 0x20, 0x23}, 0x4002fcae40, 0x4002fcae70}}, 0x4000d1fd80, {0x23e0000?, 0x4000c801e0?, 0x4000057818?}, {0xfc?, ...})
	/tmp/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.4.linux-arm64/src/encoding/json/encode.go:704 +0x190
encoding/json.(*encodeState).reflectValue(0x4000d1fd80, {0x23e0000?, 0x4000c801e0?, 0xeb0e98?}, {0x38?, 0x0?})
	/tmp/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.4.linux-arm64/src/encoding/json/encode.go:321 +0x70
encoding/json.(*encodeState).marshal(0x40000578b8?, {0x23e0000?, 0x4000c801e0?}, {0x0?, 0xfb?})
	/tmp/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.4.linux-arm64/src/encoding/json/encode.go:297 +0xc0
encoding/json.Marshal({0x23e0000, 0x4000c801e0})
	/tmp/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.4.linux-arm64/src/encoding/json/encode.go:163 +0x94
github.com/aquasecurity/tracee/pkg/cmd/printer.jsonEventPrinter.Print({{_, _}}, {0x17f43b24efef8cbf, 0x17f43b24edad3d83, 0x0, 0x12, 0x1701, 0x12, 0xc, 0x3200, ...})
	/actions-runner/_work/tracee/tracee/pkg/cmd/printer/printer.go:396 +0x48
github.com/aquasecurity/tracee/pkg/cmd/printer.startPrinter(0x4001d87360, 0x4001d4b5c0, 0x4000101440, {0x3588860, 0x4000112d60})
	/actions-runner/_work/tracee/tracee/pkg/cmd/printer/broadcast.go:103 +0x64
created by github.com/aquasecurity/tracee/pkg/cmd/printer.(*Broadcast).Init in goroutine 1
	/actions-runner/_work/tracee/tracee/pkg/cmd/printer/broadcast.go:52 +0x1f4
...

TRC-1010 is cgroup_release_agent, anyhow, all signatures should be checked.

@geyslan geyslan added this to the v0.23.0 milestone Sep 11, 2024
@geyslan
Copy link
Member Author

geyslan commented Sep 11, 2024

@NDStrahilevitz FYI as it was detected in #4252 tests.

@geyslan
Copy link
Member Author

geyslan commented Sep 25, 2024

Fixed by this reversion: #4321

@geyslan geyslan closed this as completed Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants