[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.10.1503051233280.23808@chino.kir.corp.google.com>
Date: Thu, 5 Mar 2015 12:34:17 -0800 (PST)
From: David Rientjes <rientjes@...gle.com>
To: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
cc: Kazutomo Yoshii <kazutomo.yoshii@...il.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>
Subject: Re: [PATCH] mm: pagewalk: prevent positive return value of
walk_page_test() from being passed to callers (Re: [PATCH] mm: fix do_mbind
return value)
On Thu, 5 Mar 2015, Naoya Horiguchi wrote:
> walk_page_test() is purely pagewalk's internal stuff, and its positive return
> values are not intended to be passed to the callers of pagewalk. However, in
> the current code if the last vma in the do-while loop in walk_page_range()
> happens to return a positive value, it leaks outside walk_page_range().
> So the user visible effect is invalid/unexpected return value (according to
> the reporter, mbind() causes it.)
>
> This patch fixes it simply by reinitializing the return value after checked.
>
> Another exposed interface, walk_page_vma(), already returns 0 for such cases
> so no problem.
>
> Fixes: 6f4576e3687b ("mempolicy: apply page table walker on queue_pages_range()")
> Reported-by: Kazutomo Yoshii <kazutomo.yoshii@...il.com>
> Signed-off-by: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
Acked-by: David Rientjes <rientjes@...gle.com>
This is exactly what I had in mind, thanks for fixing it up so fast!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists