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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 15 Jun 2022 16:54:47 +0800 (CST)
From:   <wang.yi59@....com.cn>
To:     <yury.norov@...il.com>
Cc:     <akpm@...ux-foundation.org>, <linux-mm@...ck.org>,
        <andriy.shevchenko@...ux.intel.com>, <linux@...musvillemoes.dk>,
        <linux-kernel@...r.kernel.org>, <xue.zhihong@....com.cn>,
        <wang.liang82@....com.cn>, <Liu.Jianjun3@....com.cn>,
        <yury.norov@...il.com>
Subject: Re:[PATCH] bitmap: fix a unproper remap when mpol_rebind_nodemask()

> On Mon, Jun 13, 2022 at 8:45 PM <wang.yi59@....com.cn> wrote:
> >
> >
> > - change the bitmap_remap() as this patch did, but this changed the
> > behavior of this routine which looks does the right thing. One good
> > news is this function is only called by mpol_rebind_nodemask().
> 
> There are users of bitmap_remap() in drivers/gpio/gpio-xilinx.c
> 
> > - don't change the bitmap_remap(), to be honest, I didn't figure out
> > a way. Any suggestions?
> 
> I haven't had a chance to play with it (because of my dayjob), but I
> have a strong feeling that the proper solution should come from
> existing functionality.
> 
> Did you experiment with MPOL_F_{STATIC,RELATIVE}_NODES?
> Those flags enable nodes_and() and mpol_relative_nodemask()
> paths correspondingly.
> 

You are right, adding MPOL_F_STATIC_NODES can fix this situation. So it
seems that we don't need to do anything in kernel now.

Many thanks for your time :)


> What I suggested is:
> 
>  328                 node_clear(1, pol->w.cpuset_mems_allowed);
>  329                 node_clear(3, pol->w.cpuset_mems_allowed);
>  330                 nodes_remap(tmp, pol->nodes, pol->w.cpuset_mems_allowed,
>  331                                                                 *nodes);
>  332                 pol->w.cpuset_mems_allowed = *nodes;
> 
> > In the example above, if set cpuset.mems to 0,2 firstly, the nodes
> > binds will change from 1 to 2. And then set cpuset.mems to 1,3, it will
> > change from 2 to 3 again.


---
Best wishes
Yi Wang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ