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/20220817080332.1052710-3-weiyongjun1@huawei.com Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Cc: Akinobu Mita <akinobu.mita@gmail.com> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Isabella Basso <isabbasso@riseup.net> Cc: Josh Poimboeuf <jpoimboe@kernel.org> Cc: Kees Cook <keescook@chromium.org> Cc: Miguel Ojeda <ojeda@kernel.org> Cc: Nathan Chancellor <nathan@kernel.org> Cc: Nick Desaulniers <ndesaulniers@google.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent a7ebbbb commit 4acb9e5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)