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] [day] [month] [year] [list]
Message-ID: <YxEFhVcKS8gBeIcf@dhcp22.suse.cz>
Date:   Thu, 1 Sep 2022 21:18:29 +0200
From:   Michal Hocko <mhocko@...e.com>
To:     Vlastimil Babka <vbabka@...e.cz>
Cc:     linux-mm@...ck.org, Christoph Hellwig <hch@...radead.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Mel Gorman <mgorman@...e.de>,
        Johannes Weiner <hannes@...xchg.org>,
        Dan Carpenter <dan.carpenter@...cle.com>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH] mm: reduce noise in show_mem for lowmem allocations

On Thu 01-09-22 16:14:39, Vlastimil Babka wrote:
> On 8/30/22 09:34, Michal Hocko wrote:
> > [Cc Dan]
> > Dan has brought up[1] that the use of gfp mask has confused his static
> > analyzer which assumes that GFP_HIGHUSER_MOVABLE implies a sleeping
> > allocation and that wouldn't be a great idea from the panic path. I
> > would add that most callers of this function would be really bad to
> > allocate.
> > 
> > The report itself is a false positive but it made me think a bit about
> > this. Even if the check is too simplistic I guess it resembles how many
> > developers are thinking (including me). If I see GFP_HIGHUSER_MOVABLE or
> > GF_KERNEL I automatically assume a sleeping allocation down the road.
> > And who know somebody might add one in the future even into show_mem
> > because the gfp parameter would be too tempting to not (ab)use.
> > 
> > My original intention was to use a natural allocation speak but this can
> > backfire so maybe it would be better to give the argument its real
> > meaning and that is the high_zone_idx. This is cryptic for code outside
> > of MM but that is not all that many callers and we can hide this fact
> > from them. In other words does the thing below looks better (incremental
> > for illustration, I will make it a proper patch if yes)?
> 
> Yeah, looks better to me this way. Thanks!

Thanks for looking into this. Unless somebody objects I will send a
consolidated patch early next week.
-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ