[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87pmsgqpht.fsf@yhuang6-desk2.ccr.corp.intel.com>
Date: Fri, 08 Oct 2021 09:22:54 +0800
From: "Huang, Ying" <ying.huang@...el.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
linux-mm <linux-mm@...ck.org>,
Eric Dumazet <edumazet@...gle.com>,
syzbot <syzkaller@...glegroups.com>, Mel Gorman <mgorman@...e.de>
Subject: Re: [PATCH v2] mm/mempolicy: do not allow illegal
MPOL_F_NUMA_BALANCING | MPOL_LOCAL in mbind()
Hi, Eric,
Eric Dumazet <eric.dumazet@...il.com> writes:
> From: Eric Dumazet <edumazet@...gle.com>
>
> syzbot reported access to unitialized memory in mbind() [1]
>
> Issue came with commit bda420b98505 ("numa balancing: migrate on
> fault among multiple bound nodes")
>
> This commit added a new bit in MPOL_MODE_FLAGS, but only checked
> valid combination (MPOL_F_NUMA_BALANCING can only be used with MPOL_BIND)
> in do_set_mempolicy()
>
> This patch moves the check in sanitize_mpol_flags() so that it
> is also used by mbind()
Good catch! Thanks! When MPOL_F_NUMA_BALANCING is introduced, it is
intended to be used with set_memopolicy() syscall only, it is not
allowed to be used with mbind() syscall at least for now. But I
misunderstood the original code apparently.
So I think it may be better to return EINVAL for mbind() +
MPOL_F_NUMA_BALANCING?
Best Regards,
Huang, Ying
Powered by blists - more mailing lists