From: Michal Hocko <mhocko@suse.com>
To: "lixinhai.lxh@gmail.com" <lixinhai.lxh@gmail.com>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
akpm <akpm@linux-foundation.org>,
Vlastimil Babka <vbabka@suse.cz>, Hugh Dickins <hughd@google.com>
Subject: Re: [PATCH] mm: mempolicy: Fix wrong use of maxnode in mempolicy API
Date: Mon, 11 Nov 2019 11:04:47 +0100 [thread overview]
Message-ID: <20191111100447.GE1396@dhcp22.suse.cz> (raw)
In-Reply-To: <2019110900475976433214@gmail.com>
On Sat 09-11-19 00:48:01, lixinhai.lxh@gmail.com wrote:
> On 2019-11-09 at 00:04 Michal Hocko wrote:
> >On Fri 08-11-19 23:49:29, Li Xinhai wrote:
> >> The maxnode used by mbind(), set_mempolicy() and migrate_pages() is not
> >> correctly handled in get_nodes(), where --maxnode cause the calculation
> >> endmask = (1UL << (maxnode % BITS_PER_LONG)) - 1;
> >> ignores the highest node ID bit. Then, at
> >> nodes_addr(*nodes)[nlongs-1] &= endmask;
> >> the highest node ID bit is cleared. Finally, cause mpol_new() think user
> >> does not pass in any node ID, and return EINVAL.
> >>
> >> The results are:
> >> - Application receives EINVAL when only the highest node ID bit is set.
> >> - Application recevies no error when other bits set together with the
> >> highest node ID bit, but that highest ID is ignored.
> >
> >A similar patch has been posted [1] and rejected [2].
> >
> >[1] http://lkml.kernel.org/r/1570882789-20579-1-git-send-email-zhangpan26@huawei.com
> >[2] http://lkml.kernel.org/r/20191014091243.GD317@dhcp22.suse.cz
> >
> >
> >--
> >Michal Hocko
> >SUSE Labs
>
> I just checked the code in 'history' log for curiosity, this --maxnode seems
> appeared since the very first commit. Mention about this special point of
> maxnode in manpage of these three APIs would be one solution, :).
Yes documenting this would be preferable.
--
Michal Hocko
SUSE Labs
prev parent reply other threads:[~2019-11-11 10:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-08 15:49 [PATCH] mm: mempolicy: Fix wrong use of maxnode in mempolicy API Li Xinhai
2019-11-08 16:04 ` Michal Hocko
2019-11-08 16:48 ` lixinhai.lxh
2019-11-11 10:04 ` Michal Hocko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191111100447.GE1396@dhcp22.suse.cz \
--to=mhocko@suse.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=linux-mm@kvack.org \
--cc=lixinhai.lxh@gmail.com \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).