Skip to content

Commit fcdb1d6

Browse files
authored
pkg/ebpf: change authentication symbol for kallsyms (#2035)
When reading /proc/kallsyms file, a symbol address is checked to identify if the file was read correctly. The "current_task" symbol is not available on ARM, so it had to be changed to a symbol supported on all architectures.
1 parent fdc4e7f commit fcdb1d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/ebpf/initialization/ksymbols.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ func SendKsymbolsToMap(bpfKsymsMap *libbpfgo.BPFMap, ksymbols map[string]*helper
3535

3636
// ValidateKsymbolsTable check if the addresses in the table are valid by checking a specific symbol address.
3737
// The reason for the addresses to be invalid is if the capabilities required to read the kallsyms file are not given.
38-
// The chosen symbol used here is "current_task" because it is used by all supported kernel versions and shouldn't be 0.
38+
// The chosen symbol used here is "security_file_open" because it is a must-have symbol for tracee to run.
3939
func ValidateKsymbolsTable(ksyms *helpers.KernelSymbolTable) bool {
40-
if sym, err := ksyms.GetSymbolByName(globalSymbolOwner, "current_task"); err != nil || sym.Address == 0 {
40+
if sym, err := ksyms.GetSymbolByName(globalSymbolOwner, "security_file_open"); err != nil || sym.Address == 0 {
4141
return false
4242
}
4343
return true

0 commit comments

Comments
 (0)