Re: [PATCH] 9p: prevent read overrun in protocol dump tracepoint

2023-12-02 Thread Dominique Martinet
Steven Rostedt wrote on Sat, Dec 02, 2023 at 11:15:24PM -0500: > > Also, for custom tracepoints e.g. bpftrace the program needs to know how > > many bytes can be read safely even if it's just for dumping -- unless > > dynamic_array is a "fat pointer" that conveys its own size? > > (Sorry didn't

Re: [PATCH] 9p: prevent read overrun in protocol dump tracepoint

2023-12-02 Thread Steven Rostedt
On Sun, 3 Dec 2023 10:33:32 +0900 Dominique Martinet wrote: > > TP_printk("clnt %lu %s(tag = %d)\n%.3x: %16ph\n%.3x: %16ph\n", > > (unsigned long)__entry->clnt, > > show_9p_op(__entry->type), > > __entry->tag, 0,

Re: [PATCH] 9p: prevent read overrun in protocol dump tracepoint

2023-12-02 Thread Dominique Martinet
Steven Rostedt wrote on Sat, Dec 02, 2023 at 08:14:09PM -0500: > > AFAICS __entry is a local variable on stack, and array __entry->line not > > intialized with zeros, i.e. the dump would contain trash at the end. Maybe > > prepending memset() before memcpy()? Well spotted! Now I'm thinking about

Re: [PATCH] 9p: prevent read overrun in protocol dump tracepoint

2023-12-02 Thread Steven Rostedt
On Sat, 02 Dec 2023 14:05:24 +0100 Christian Schoenebeck wrote: > > > --- a/include/trace/events/9p.h > > > +++ b/include/trace/events/9p.h > > > @@ -185,7 +185,8 @@ TRACE_EVENT(9p_protocol_dump, > > > __entry->clnt = clnt; > > > __entry->type = pdu->id; > > >

Re: ARM Ftrace Function Graph Fails With UNWINDER_FRAME_POINTER

2023-12-02 Thread Justin Chen
On 12/2/2023 1:26 AM, Ard Biesheuvel wrote: On Sat, 2 Dec 2023 at 09:49, Justin Chen wrote: On 12/1/23 10:53 PM, Ard Biesheuvel wrote: On Fri, 1 Dec 2023 at 23:59, Justin Chen wrote: On 12/1/23 10:07 AM, Steven Rostedt wrote: On Fri, 1 Dec 2023 09:25:59 -0800 Justin Chen wrote:

Re: [PATCH] 9p: prevent read overrun in protocol dump tracepoint

2023-12-02 Thread Christian Schoenebeck
On Saturday, December 2, 2023 5:35:18 AM CET asmad...@codewreck.org wrote: > JP Kobryn wrote on Fri, Dec 01, 2023 at 07:04:10PM -0800: > > An out of bounds read can occur within the tracepoint 9p_protocol_dump(). > > In the fast assign, there is a memcpy that uses a constant size of 32 > > (macro

Re: ARM Ftrace Function Graph Fails With UNWINDER_FRAME_POINTER

2023-12-02 Thread Ard Biesheuvel
On Sat, 2 Dec 2023 at 09:49, Justin Chen wrote: > > > > On 12/1/23 10:53 PM, Ard Biesheuvel wrote: > > On Fri, 1 Dec 2023 at 23:59, Justin Chen wrote: > >> > >> > >> > >> On 12/1/23 10:07 AM, Steven Rostedt wrote: > >>> On Fri, 1 Dec 2023 09:25:59 -0800 > >>> Justin Chen wrote: > >>> > > It

Re: ARM Ftrace Function Graph Fails With UNWINDER_FRAME_POINTER

2023-12-02 Thread Justin Chen
On 12/1/23 10:53 PM, Ard Biesheuvel wrote: On Fri, 1 Dec 2023 at 23:59, Justin Chen wrote: On 12/1/23 10:07 AM, Steven Rostedt wrote: On Fri, 1 Dec 2023 09:25:59 -0800 Justin Chen wrote: It appears the sub instruction at 0x6dd0 correctly accounts for the extra 8 bytes, so the frame