mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 06:31:49 +00:00
tracing: Use memset_startat() to zero struct trace_iterator
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Use memset_startat() to avoid confusing memset() about writing beyond the target struct member. Link: https://lkml.kernel.org/r/20211118202217.1285588-1-keescook@chromium.org Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
This commit is contained in:
parent
f86b0aaad7
commit
c4c1dbcc09
@ -6706,9 +6706,7 @@ waitagain:
|
||||
cnt = PAGE_SIZE - 1;
|
||||
|
||||
/* reset all but tr, trace, and overruns */
|
||||
memset(&iter->seq, 0,
|
||||
sizeof(struct trace_iterator) -
|
||||
offsetof(struct trace_iterator, seq));
|
||||
memset_startat(iter, 0, seq);
|
||||
cpumask_clear(iter->started);
|
||||
trace_seq_init(&iter->seq);
|
||||
iter->pos = -1;
|
||||
|
Loading…
Reference in New Issue
Block a user