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: <7718244879ff2b696ea9cbb744cb3805@suse.de>
Date:   Mon, 24 Apr 2023 05:54:59 +0200
From:   Oscar Salvador <osalvador@...e.de>
To:     Alexander Potapenko <glider@...gle.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        Michal Hocko <mhocko@...e.com>,
        Vlastimil Babka <vbabka@...e.cz>,
        Eric Dumazet <edumazet@...gle.com>,
        Waiman Long <longman@...hat.com>,
        Suren Baghdasaryan <surenb@...gle.com>,
        Marco Elver <elver@...gle.com>,
        Andrey Konovalov <andreyknvl@...il.com>
Subject: Re: [PATCH v4 0/3] page_owner: print stacks and their counter

On 2023-04-21 13:19, Alexander Potapenko wrote:
> I think the implementation of these counters is too specific to
> page_owner and is hard to use for any other purpose.
> If we decide to have them, there should be no page_owner-specific
> logic in the way we initialize/increment/decrement these counters.

Another solution would be to always increment the refcount in 
__stack_depot_save,
in this case the "page-owner" specific changes are gone, and
it is more of a generic thing.
e.g: Andrey Konovalov mentioned that in a future KASAN remodelation,
he would be using a stack refcount as well.

> The thresholds in "mm,page_owner: Filter out stacks by a threshold
> counter" should also belong elsewhere.

That can certainly be cleaned up I guess to not polute non-page_owner 
code.

> Given that no other stackdepot user needs these counters, maybe it
> should be cleaner to store an opaque struct along with the stack,
> passing its size to stack_depot_save(), and letting users access it
> directly using the stackdepot handler.
> 
> I am also wondering if a separate hashtable mapping handlers to
> counters would solve the problem for you?

Let us see first if with the changes from above the code gets to a more
generic and clean stage, if not we can explore further options.

Thanks for your feedback Alexander!

-- 
Oscar Salvador
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ