[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c8bc199d-30e1-4f0c-868c-6cbab1fbc747@redhat.com>
Date: Tue, 8 Apr 2025 11:52:18 +0200
From: David Hildenbrand <david@...hat.com>
To: Baoquan He <bhe@...hat.com>, linux-mm@...ck.org
Cc: akpm@...ux-foundation.org, osalvador@...e.de, mingo@...nel.org,
yanjun.zhu@...ux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/3] mm/gup: fix wrongly calculated returned value in
fault_in_safe_writeable()
On 07.04.25 05:03, Baoquan He wrote:
> Not like fault_in_readable() or fault_in_writeable(), in
> fault_in_safe_writeable() local variable 'start' is increased page
> by page to loop till the whole address range is handled. However,
> it mistakenly calcalates the size of handled range with 'uaddr - start'.
>
> Here fix the code bug in fault_in_safe_writeable(), and also adjusting
> the codes in fault_in_readable() and fault_in_writeable() to use local
> variable 'start' to loop so that codes in these three functions are
> consistent.
>
I probably phrased it poorly in my other reply: the confusing part (to
me) is adjusting "start". Maybe we should have unsigned long start,end,cur;
Maybe we should really split the "fix" from the cleanups, and tag the
fix with a Fixes:.
I was wondering if these functions could be simplified a bit. But the
overflow handling is a bit nasty.
--
Cheers,
David / dhildenb
Powered by blists - more mailing lists