8000 pkg/utils/sharedobjs: check open failure by AlonZivony · Pull Request #2450 · aquasecurity/tracee · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

pkg/utils/sharedobjs: check open failure #2450

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pkg/utils/sharedobjs/host_symbols_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,14 @@ func (soCache *dynamicSymbolsLRUCache) Add(obj ObjInfo, dynamicSymbols *dynamicS
func loadSharedObjectDynamicSymbols(path string) (*dynamicSymbols, error) {
var loadedObject *elf.File

capabilities.GetInstance().Required(func() error {
err := capabilities.GetInstance().Required(func() error {
var e error
loadedObject, e = elf.Open(path)
return e
})
if err != nil {
return nil, err
}
defer loadedObject.Close()

dynamicSymbols, err := loadedObject.DynamicSymbols()
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/sharedobjs/host_symbols_loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func TestHostSharedObjectSymbolsLoader_loadSOSymbols(t *testing.T) {
})
}

func TestLoadSharedObjectDynamicSymbols(t *testing.T) {
func TestParseDynamicSymbols(t *testing.T) {
testCases := []struct {
Name string
Input []elf.Symbol
Expand Down
0