On Wed, 14 May 2025 10:14:31 +0900
Masami Hiramatsu (Google) <mhira...@kernel.org> wrote:

> > In case the tscratch->clock_id gets corrupted, we better make sure it
> > doesn't overflow:
> > 
> >             if (tscratch->clock_id >= ARRAY_SIZE(trace_clocks) ||
> >                 tracing_set_clock(tr, 
> > trace_clocks[tscratch->clock_id].name) < 0) {  
> 
> Good catch! BTW, don't we have any check about scratch area?
> (e.g. adding a checksum)

We could, but it would require updating every time we update the
scratch area.

Currently, the scratch area is only considered valid if the ring buffer
is proven to be valid. But if this becomes a problem, we probably
should add a checksum or something.

-- Steve

Reply via email to