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]
Date: Wed, 8 May 2024 10:29:02 -0500
From: Maxwell Bland <mbland@...orola.com>
To: Catalin Marinas <catalin.marinas@....com>
Cc: linux-mm@...ck.org, Will Deacon <will@...nel.org>,
        Jonathan Corbet <corbet@....net>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Ard Biesheuvel <ardb@...nel.org>, Mark Rutland <mark.rutland@....com>,
        Christophe Leroy <christophe.leroy@...roup.eu>,
        Alexandre Ghiti <alexghiti@...osinc.com>,
        linux-arm-kernel@...ts.infradead.org, linux-doc@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] ptdump: add intermediate directory support

On Wed, May 08, 2024 at 12:20:41PM GMT, Catalin Marinas wrote:
> On Tue, Apr 30, 2024 at 11:05:01AM -0500, Maxwell Bland wrote:

> > +		if (st->start_address != addr) {
> > +			pt_dump_seq_printf(st->seq, "0x%016lx-0x%016lx   ",
> > +					   st->start_address, addr);
> > +			delta = (addr - st->start_address);

> Should it show a PGD_SIZE * number_of_entries instead?

It should show the full range of memory covered by the PGD's table.
Will fix, thanks!

r > +	if (st->note_non_leaf && !pgd_leaf(val))
> > +		st->note_page(st, addr, 0, pgd_val(val));
> > +
> >  	if (pgd_leaf(val)) {
> >  		st->note_page(st, addr, 0, pgd_val(val));
> >  		walk->action = ACTION_CONTINUE;

> Is the difference between leaf and non-leaf calls only the walk->action?
> We could have a single call to st->note_page() and keep the walk->action
> setting separately. Do we also need to set ACTION_SUBTREE in case the
> entry is a table entry? Or is it done in the caller somewhere? I could
> not figure out.
>
> An alternative would be to have an ARCH_WANT_NON_LEAF_PTDUMP Kconfig
> option instead of a bool note_non_leaf in struct ptdump_state. This
> option seems to be entirely static, not sure it's worth a struct member
> for it. You'd use IS_ENABLED() above instead of st->note_non_leaf.


ACTION_SUBTREE seems right, I will look into it. Something like (though
I'll check to see if it is correct and polish):

  walk_action = (!pgd_leaf) ? ACTION_SUBTREE : ACTION_CONTINUE;
  if ((IS_ENABLED(...) && !pgd_leaf()) || pgd_leaf())
  	st->note_page ...

> -- 
> Catalin

Nice! Thank you for your feedback. I will iterate and also fix up the
other minor things, e.g. 72 character wrap in doc files.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ