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

Concurrent read and write in kernel symbols map #3785

Closed
NDStrahilevitz opened this issue Dec 31, 2023 · 0 comments · Fixed by #3786
Closed

Concurrent read and write in kernel symbols map #3785

NDStrahilevitz opened this issue Dec 31, 2023 · 0 comments · Fixed by #3786
Assignees
Labels
Milestone

Comments

@NDStrahilevitz
Copy link
Collaborator

Description

No clear reproduction, this seems like a chance race condition.

Log of the crash:

atal error: concurrent map read and map write

goroutine 132 [running]:
github.com/aquasecurity/libbpfgo/helpers.(*lazyKernelSymbols).GetSymbolByName(0xc0000f41c0, {0x20dd94a, 0x6}, {0xc0026473b0, 0x13})
	/root/go/pkg/mod/github.com/aquasecurity/libbpfgo/helpers@v0.4.6-0.20230321190037-f591a2c5734f/kernel_symbols.go:194 +0x8e
github.com/aquasecurity/tracee/pkg/ebpf.(*Tracee).populateExpectedSyscallTableArray(0xc000a04600, 0x0?)
	/root/go/pkg/mod/bitbucket.org/scalock/tracee@v0.19.1-0.20231226141957-8e6f516ecb37/pkg/ebpf/hooked_syscall_table.go:190 +0x338
github.com/aquasecurity/tracee/pkg/ebpf.(*Tracee).hookedSyscallTableRoutine.func1()
	/root/go/pkg/mod/bitbucket.org/scalock/tracee@v0.19.1-0.20231226141957-8e6f516ecb37/pkg/ebpf/hooked_syscall_table.go:51 +0x25
github.com/aquasecurity/tracee/pkg/capabilities.(*Capabilities).EBPF(0xc00072c160, 0x212070b?)
	/root/go/pkg/mod/bitbucket.org/scalock/tracee@v0.19.1-0.20231226141957-8e6f516ecb37/pkg/capabilities/capabilities.go:190 +0xc4
github.com/aquasecurity/tracee/pkg/ebpf.(*Tracee).hookedSyscallTableRoutine(0xc000a04600, {0x249de40, 0xc002d00a80})
	/root/go/pkg/mod/bitbucket.org/scalock/tracee@v0.19.1-0.20231226141957-8e6f516ecb37/pkg/ebpf/hooked_syscall_table.go:49 +0x15f
created by github.com/aquasecurity/tracee/pkg/ebpf.(*Tracee).Run
	/root/go/pkg/mod/bitbucket.org/scalock/tracee@v0.19.1-0.20231226141957-8e6f516ecb37/pkg/ebpf/tracee.go:1388 +0xc5

goroutine 1 [runnable]:
strings.Count({0xc0005882ae?, 0x9?}, {0x246cb44, 0x1})
	/usr/local/go/src/strings/strings.go:41 +0x105
strings.genSplit({0xc0005882ae, 0x9}, {0x246cb44, 0x1}, 0x0, 0x0?)
	/usr/local/go/src/strings/strings.go:244 +0x56
strings.Split(...)
	/usr/local/go/src/strings/strings.go:308
github.com/aquasecurity/tracee/pkg/ebpf.(*Tracee).triggerMemDump(_, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...})
	/root/go/pkg/mod/bitbucket.org/scalock/tracee@v0.19.1-0.20231226141957-8e6f516ecb37/pkg/ebpf/tracee.go:1726 +0xdde
github.com/aquasecurity/tracee/pkg/ebpf.(*Tracee).Run(0xc000a04600, {0x249de40?, 0xc002d00a80})
	/root/go/pkg/mod/bitbucket.org/scalock/tracee@v0.19.1-0.20231226141957-8e6f516ecb37/pkg/ebpf/tracee.go:1391 +0x125
bitbucket.org/scalock/endpoint/src/cndr/pkg/applications/tracer/usecase.(*tracer).Run(0xc000ad4420)
	/endpoint/src/cndr/pkg/applications/tracer/usecase/usecase.go:294 +0x35c
bitbucket.org/scalock/endpoint/src/cndr/pkg/app.New()
	/endpoint/src/cndr/pkg/app/app.go:301 +0x1bad
bitbucket.org/scalock/endpoint/src/cndr/pkg/cmd/cndr.NewCommand.func1(0xc0006d0000?, {0x20d72a4?, 0x29?, 0x2b?})
	/endpoint/src/cndr/pkg/cmd/cndr/cndr.go:17 +0x2a
github.com/spf13/cobra.(*Command).execute(0xc0006d0000, {0xc00011a2d0, 0x29, 0x2b})
	/root/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:944 +0x847
github.com/spf13/cobra.(*Command).ExecuteC(0xc0006d0000)
	/root/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
	/root/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992
main.main()
	/endpoint/src/cndr/cmd/cndr/main.go:11 +0x25

Output of tracee version:

Tracee version: v0.19.0-112-g1c5ca9564

Output of uname -a:

Linux ip-172-31-75-171 6.2.0-1017-aws #17~22.04.1-Ubuntu SMP Fri Nov 17 21:07:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Additional details

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.

1 participant