Re: [PATCH for-next 1/2] IB/uverbs: Fix race between uverbs_close and remove_one

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 2, 2016 at 9:31 PM, Doug Ledford <dledford@xxxxxxxxxx> wrote:
> On Sun, 2016-07-03 at 15:28 +0300, Leon Romanovsky wrote:
>> From: Jason Gunthorpe <jgunthorpe@xxxxxxxxxxxxxxxxxxxx>
>>
>> Fixes an oops that might happen if uverbs_close races with
>> remove_one.
>>
>> Both contexts may run ib_uverbs_cleanup_ucontext, it depends
>> on the flow.
>>
>> Currently, there is no protection for a case that remove_one
>> didn't make the cleanup it runs to its end, the underlying
>> ib_device was freed then uverbs_close will call
>> ib_uverbs_cleanup_ucontext and OOPs.
>>
>> Above might happen if uverbs_close deleted the file from the list
>> then remove_one didn't find it and runs to its end.
>>
>> Fixes to protect against that case by a new cleanup lock so that
>> ib_uverbs_cleanup_ucontext will be called always before that
>> remove_one is ended.
>>
>> Fixes: 35d4a0b63dc0 ("IB/uverbs: Fix race between ib_uverbs_open and
>> remove_one")
>> Reported-by: Devesh Sharma <devesh.sharma@xxxxxxxxxxxx>
>> Signed-off-by: Jason Gunthorpe <jgunthorpe@xxxxxxxxxxxxxxxxxxxx>
>> Signed-off-by: Yishai Hadas <yishaih@xxxxxxxxxxxx>
>> Signed-off-by: Leon Romanovsky <leon@xxxxxxxxxx>
>
> The only reason I hadn't taken this patch before is because Jason said
> it was totally untested and someone (Devesh in this case) needed to
> test it to make sure it resolved their problem.  I don't see a test-by
> line here, so has this happened?

I can't say about Devesh, but we verified it as part of our verification phase.
Do you need anything special except Yishai's SOB?

>
> --
> Doug Ledford <dledford@xxxxxxxxxx>
>               GPG KeyID: 0E572FDD
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux