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:   Sun, 5 Aug 2018 05:50:04 -0700
From:   Matthew Wilcox <willy@...radead.org>
To:     Kirill Tkhai <ktkhai@...tuozzo.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>, vdavydov.dev@...il.com,
        mhocko@...e.com, aryabinin@...tuozzo.com, ying.huang@...el.com,
        penguin-kernel@...ove.SAKURA.ne.jp, shakeelb@...gle.com,
        jbacik@...com, linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: Use special value SHRINKER_REGISTERING instead
 list_empty() check

On Sun, Aug 05, 2018 at 08:30:43AM +0300, Kirill Tkhai wrote:
> On 05.08.2018 03:03, Matthew Wilcox wrote:
> > On Sat, Aug 04, 2018 at 09:42:05PM +0300, Kirill Tkhai wrote:
> >> This is exactly the thing the patch makes. Instead of inserting a shrinker pointer
> >> to idr, it inserts a fake value SHRINKER_REGISTERING there. The patch makes impossible
> >> to dereference a shrinker unless it's completely registered. 
> > 
> > -       id = idr_alloc(&shrinker_idr, shrinker, 0, 0, GFP_KERNEL);
> > +       id = idr_alloc(&shrinker_idr, SHRINKER_REGISTERING, 0, 0, GFP_KERNEL);
> > 
> > Instead:
> > 
> > +       id = idr_alloc(&shrinker_idr, NULL, 0, 0, GFP_KERNEL);
> > 
> > ... and the rest of your patch becomes even simpler.
> 
> The patch, we are discussing at the moment, does *exactly* this:
> 
> https://lkml.org/lkml/2018/8/3/588
> 
> It looks like you missed this hunk in the patch.

No, it does this:

+       id = idr_alloc(&shrinker_idr, SHRINKER_REGISTERING, 0, 0, GFP_KERNEL);

I'm saying do this:

+       id = idr_alloc(&shrinker_idr, NULL, 0, 0, GFP_KERNEL);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ