hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I9OHHN -------------------------------- Previously, this patch was introduced to address a syz issue caused by the omission of MPOL_WEIGHTED_INTERLEAVE from the policy_modes array, which led to out-of-bounds accesses in mpol_parse_str. Now that weight-based L/R memory interleaving allocation has been implemented, this patch is no longer needed. This reverts commit e85c21ba894605f5700fd78380288b8ef5e7bd73. --- mm/mempolicy.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 8d7732e276f3..d3bd80112366 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -1634,8 +1634,7 @@ static inline int sanitize_mpol_flags(int *mode, unsigned short *flags) *flags = *mode & MPOL_MODE_FLAGS; *mode &= ~MPOL_MODE_FLAGS; - if ((unsigned int)(*mode) >= MPOL_MAX || - (unsigned int)(*mode) == MPOL_WEIGHTED_INTERLEAVE) + if ((unsigned int)(*mode) >= MPOL_MAX) return -EINVAL; if ((*flags & MPOL_F_STATIC_NODES) && (*flags & MPOL_F_RELATIVE_NODES)) return -EINVAL; @@ -3158,7 +3157,6 @@ static const char * const policy_modes[] = [MPOL_PREFERRED] = "prefer", [MPOL_BIND] = "bind", [MPOL_INTERLEAVE] = "interleave", - [MPOL_WEIGHTED_INTERLEAVE] = "weighted interleave", [MPOL_LOCAL] = "local", [MPOL_PREFERRED_MANY] = "prefer (many)", }; -- 2.25.1