On Mon, Jul 1, 2019 at 7:37 PM Matthew Wilcox wrote:
>
> On Mon, Jul 01, 2019 at 07:16:00PM -0700, David Miller wrote:
> > From: Cong Wang
> > Date: Fri, 28 Jun 2019 11:03:40 -0700
> >
> > > idr_get_next_ul() is problematic by design, it can't handle
> > > the following overflow case well on 32-b
From: Matthew Wilcox
Date: Mon, 1 Jul 2019 19:37:30 -0700
> On Mon, Jul 01, 2019 at 07:16:00PM -0700, David Miller wrote:
>> From: Cong Wang
>> Date: Fri, 28 Jun 2019 11:03:40 -0700
>>
>> > idr_get_next_ul() is problematic by design, it can't handle
>> > the following overflow case well on 32-b
On Mon, Jul 01, 2019 at 07:16:00PM -0700, David Miller wrote:
> From: Cong Wang
> Date: Fri, 28 Jun 2019 11:03:40 -0700
>
> > idr_get_next_ul() is problematic by design, it can't handle
> > the following overflow case well on 32-bit CPU:
> >
> > u32 id = UINT_MAX;
> > idr_alloc_u32(&id);
> > whi
From: Cong Wang
Date: Fri, 28 Jun 2019 11:03:40 -0700
> idr_get_next_ul() is problematic by design, it can't handle
> the following overflow case well on 32-bit CPU:
>
> u32 id = UINT_MAX;
> idr_alloc_u32(&id);
> while (idr_get_next_ul(&id) != NULL)
> id++;
>
> when 'id' overflows and becomes
idr_get_next_ul() is problematic by design, it can't handle
the following overflow case well on 32-bit CPU:
u32 id = UINT_MAX;
idr_alloc_u32(&id);
while (idr_get_next_ul(&id) != NULL)
id++;
when 'id' overflows and becomes 0 after UINT_MAX, the loop
goes infinite.
Fix this by eliminating externa