Messages in this thread | | | From | "Huang, Ying" <> | Subject | Re: [PATCH v2] mm/mempolicy: do not allow illegal MPOL_F_NUMA_BALANCING | MPOL_LOCAL in mbind() | Date | Fri, 08 Oct 2021 09:22:54 +0800 |
| |
Hi, Eric,
Eric Dumazet <eric.dumazet@gmail.com> writes:
> From: Eric Dumazet <edumazet@google.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
| |