From: Steven Rostedt <rostedt@goodmis.org>
To: Sven Schnelle <svens@linux.ibm.com>
Cc: linux-kernel@vger.kernel.org, Tom Zanussi <zanussi@kernel.org>
Subject: Re: BUG: KASAN: slab-out-of-bounds in print_synth_event+0xa68/0xa78
Date: Tue, 8 Aug 2023 13:20:30 -0400 [thread overview]
Message-ID: <20230808132030.4ddfc90f@gandalf.local.home> (raw)
In-Reply-To: <yt9dzg31ppzy.fsf@linux.ibm.com>
On Tue, 08 Aug 2023 16:28:49 +0200
Sven Schnelle <svens@linux.ibm.com> wrote:
> Steven Rostedt <rostedt@goodmis.org> writes:
>
> >> I think the problem is that the code assigns data_offset with:
> >>
> >> *(u32 *)&entry->fields[*n_u64] = data_offset;
> >>
> >> but reads it with:
> >>
> >> offset = (u32)entry->fields[n_u64];
> >>
> >> which works on LE, but not BE.
> >
> > Ah, that makes sense. I didn't realize (or forgot) that s390 was BE. My
> > PowerPC box that was BE died years ago, and I have stopped testing BE ever
> > since :-(
>
> Ok. If you want something for testing BE i could provide you with an
> s390 linux image + the commandline to run that within qemu. Linux on
> s390 is not much different than other platforms, but you would need an
> s390 cross-compiler.
That's fine. I have you to test the BE code ;-)
> >> diff --git a/kernel/trace/trace_events_synth.c b/kernel/trace/trace_events_synth.c
> >> index d6a70aff2410..1f8fe7f2b5b2 100644
> >> --- a/kernel/trace/trace_events_synth.c
> >> +++ b/kernel/trace/trace_events_synth.c
> >> @@ -125,9 +125,22 @@ static bool synth_event_match(const char *system, const char *event,
> >> (!system || strcmp(system, SYNTH_SYSTEM) == 0);
> >> }
> >>
> >> +struct synth_trace_data {
> >> + u16 len;
> >> + u16 offset;
> >> +};
> >
> > This is actually common throughout the tracing code (as all dynamic fields
> > have this). We should probably make this more generic than just for
> > synthetic events. Although, that would probably break BE user space. Hmm,
> > we could have it be:
>
> I'm not familiar with the ftrace code, so I think i would need some more
> time to find all the other locations. Therefore i updated the patch to move
> the structure declaration to trace.h and sent that as a first step.
It's been on my todo list for sometime. Maybe I should just go and do that
part.
-- Steve
prev parent reply other threads:[~2023-08-08 18:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-04 6:20 Sven Schnelle
2023-08-04 15:50 ` Steven Rostedt
2023-08-04 16:32 ` Sven Schnelle
2023-08-04 17:36 ` Steven Rostedt
2023-08-07 6:08 ` Sven Schnelle
2023-08-08 1:53 ` Steven Rostedt
2023-08-08 5:58 ` Sven Schnelle
2023-08-08 9:44 ` Sven Schnelle
2023-08-08 10:14 ` Steven Rostedt
2023-08-08 14:28 ` Sven Schnelle
2023-08-08 17:20 ` Steven Rostedt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230808132030.4ddfc90f@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=svens@linux.ibm.com \
--cc=zanussi@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®