Skip to content

Commit 4acb9e5

Browse files
Wei Yongjunakpm00
authored andcommitted
fault-injection: skip stacktrace filtering by default
If FAULT_INJECTION_STACKTRACE_FILTER is enabled, the depth is default to 32. This means fail_stacktrace() will iter each entry's stacktrace, even if filter is not configured. This patch changes to quick return from fail_stacktrace() if stacktrace filter is not set. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Wei Yongjun <[email protected]> Cc: Akinobu Mita <[email protected]> Cc: Dan Williams <[email protected]> Cc: Isabella Basso <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: Kees Cook <[email protected]> Cc: Miguel Ojeda <[email protected]> Cc: Nathan Chancellor <[email protected]> Cc: Nick Desaulniers <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Rasmus Villemoes <[email protected]> Cc: Vlastimil Babka <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent a7ebbbb commit 4acb9e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/fault-inject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static bool fail_stacktrace(struct fault_attr *attr)
7171
int n, nr_entries;
7272
bool found = (attr->require_start == 0 && attr->require_end == ULONG_MAX);
7373

74-
if (depth == 0)
74+
if (depth == 0 || (found && !attr->reject_start && !attr->reject_end))
7575
return found;
7676

7777
nr_entries = stack_trace_save(entries, depth, 1);

0 commit comments

Comments
 (0)