lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wio-SF6dm+QeBW7HN7TFOK1noEm_EVob2UGyUwRYz=L9Q@mail.gmail.com>
Date: Thu, 27 Mar 2025 20:36:00 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: LKML <linux-kernel@...r.kernel.org>, Masami Hiramatsu <mhiramat@...nel.org>, 
	Mathieu Desnoyers <mathieu.desnoyers@...icios.com>, Feng Yang <yangfeng@...inos.cn>, 
	Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
Subject: Re: [GIT PULL] ring-buffer: Updates for v6.15

On Thu, 27 Mar 2025 at 20:19, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> On Thu, 27 Mar 2025 at 20:01, Steven Rostedt <rostedt@...dmis.org> wrote:
> >
> > Are you OK with the idea of moving the mapping code into the ring
> > buffer code (which I think is cleaner) and then keeping track of that
> > to get to the pages with the helper function?
> >
> > struct page *rb_get_page(struct trace_buffer *buffer, unsigned long addr)
> > {
> >         if (buffer->flags & RB_FL_PHYSICAL) {
> >                 addr -= buffer->vmap_start;
> >                 addr += buffer->phys_start;
> >                 return pfn_to_page(addr >> PAGE_SHIFT);
> >         }
> >         return virt_to_page(addr);
> > }
>
> I think that would have been *enormously* better, yes

.. actually, thinking a bit more about it, I think you want another
level of abstraction to deal with the chunking side (ie I think you
want to make the subbuf_ids[] thing explicit and the 'page order' as
well).

So you have that 'meta_buffer' thing for the first page, but you also
have that subbuf_ids[] array with pages chunked by 'order'), and I
think you need another level of abstraction for those.

IOW, you'd have 'rb_get_meta_buffer_page()' for the first page, and
then something like 'rb_get_buffer_page()' for the subbuf_id[] thing.

Or something in that direction. I didn't look *too* closely at what
the code actually needs, I'm just trying to make sure that you don't
pass random kernel addresses around, but something more structured.

Preferably maybe just the page index *within* the ring buffer,
perhaps, and have the helper function do the whole "is this the meta
buffer or one of the subbuf_id things"?

Hmm?

More clear abstraction is what I'm looking for, in other words.

              Linus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ