Skip to content

Commit

Permalink
fix(events): fix hooked_syscall for RHEL 8.x kernels
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaeldtinoco committed Oct 28, 2023
1 parent 9c04d29 commit 7d6a7c4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion pkg/ebpf/hooked_syscall_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,13 @@ func (t *Tracee) populateExpectedSyscallTableArray(tableMap *bpf.BPFMap) error {
// Get address to the function that defines the not implemented sys call
niSyscallSymbol, err := t.kernelSymbols.GetSymbolByName("system", events.SyscallPrefix+"ni_syscall")
if err != nil {
return err
e := err
// RHEL 8.x uses sys_ni_syscall instead of __arch_ni_syscall
niSyscallSymbol, err = t.kernelSymbols.GetSymbolByName("system", "sys_ni_syscall")
if err != nil {
logger.Debugw("hooked_syscall: syscall symbol not found", "name", "sys_ni_syscall")
return e
}
}
niSyscallAddress := niSyscallSymbol.Address

Expand Down
4 changes: 2 additions & 2 deletions pkg/events/core_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -1349,8 +1349,8 @@ var SyscallSymbolNames = map[ID][]KernelRestrictions{
431: {{Name: "fsconfig"}},
432: {{Name: "fsmount"}},
433: {{Name: "fspick"}},
434: {{Name: "pidfd_open"}},
435: {{Name: "clone3"}},
434: {{Above: "5.2", Name: "pidfd_open"}},
435: {{Above: "5.2", Name: "clone3"}},
436: {{Above: "5.9", Name: "close_range"}},
437: {{Above: "5.6", Name: "openat2"}},
438: {{Above: "5.6", Name: "pidfd_getfd"}},
Expand Down
4 changes: 2 additions & 2 deletions pkg/events/core_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -1408,8 +1408,8 @@ var SyscallSymbolNames = map[ID][]KernelRestrictions{
431: {{Name: "fsconfig"}},
432: {{Name: "fsmount"}},
433: {{Name: "fspick"}},
434: {{Name: "pidfd_open"}},
435: {{Name: "clone3"}},
434: {{Above: "5.2", Name: "pidfd_open"}},
435: {{Above: "5.2", Name: "clone3"}},
436: {{Above: "5.9", Name: "close_range"}},
437: {{Above: "5.7", Name: "openat2"}},
438: {{Above: "5.7", Name: "pidfd_getfd"}},
Expand Down

0 comments on commit 7d6a7c4

Please sign in to comment.