-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CWS] Do not use fentry if
tasks_rcu_exit_srcu
kernel symbol is fou…
…nd (#33866)
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Unless explicitly stated otherwise all files in this repository are licensed | ||
// under the Apache License Version 2.0. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
// Copyright 2016-present Datadog, Inc. | ||
|
||
package ebpf | ||
|
||
// HasTasksRCUExitLockSymbol returns true if the tasks_rcu_exit_srcu symbol is found in the kernel symbols. | ||
// The tasks_rcu_exit_srcu lock might cause a deadlock when removing fentry trampolines. | ||
// This was fixed by https://github.com/torvalds/linux/commit/1612160b91272f5b1596f499584d6064bf5be794 | ||
func HasTasksRCUExitLockSymbol() (bool, error) { | ||
const tasksRCUExitLockSymbol = "tasks_rcu_exit_srcu" | ||
missingSymbols, err := VerifyKernelFuncs(tasksRCUExitLockSymbol) | ||
if err != nil { | ||
return false, err | ||
} | ||
|
||
// VerifyKernelFuncs returns the missing symbols | ||
_, isMissing := missingSymbols[tasksRCUExitLockSymbol] | ||
return !isMissing, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters