On Thu, 13 Aug 2026 13:55:26 +0000
[email protected] wrote:

> > @@ -3264,7 +3263,7 @@ int ring_buffer_resize(struct trace_buffer *buffer, 
> > unsigned long size,
> >                     int cpu_id)
> >  {
> >     struct ring_buffer_per_cpu *cpu_buffer;
> > -   unsigned long nr_pages;
> > +   unsigned int nr_pages;  
> 
> [Severity: Critical]
> If a huge value is written to buffer_size_kb, could the unsigned
> difference between nr_pages and cpu_buffer->nr_pages overflow when
> assigned to the now 32-bit signed cpu_buffer->nr_pages_to_update?

I agree. I never wanted to limit the size of the ring buffer. If anything,
I would want to make all references to nr_pages to be long. Otherwise we
are capping the size of the ring buffer to 8 terabytes per CPU. Yeah, that
may sound huge, but believe me, in the not so distant future, it may be
desirable.

I'm fine with keeping persistent memory and even special case mappings
limited to MAX_INT pages. But not the ring buffer as a whole.

-- Steve

Reply via email to