Re: [RFC] rdma/uverbs: Sketch for an ioctl framework

Jason Gunthorpe
2016-05-26T18:43:48Z

On Thu, May 26, 2016 at 06:07:02PM +0000, Liran Liss wrote:

> However, I think that processing object locking before validation is not secure.
> A malicious user could easily cause a deadlock due to ordering.

Hum, interesting point. I wonder if we already have bugs there today?

I'd say that is actually more likely to happen if it is open
coded. Nested object locking like that requires consistent ordering to
avoid deadlock..

It would be easier for the core code to enforce consistent nested lock
acquire ordering than to try and do that scattered across all the
code. You are right, the core code cannot just iterate over the
provided object list and grab the locks.

One very simple option is for the core to enforce a sort order on the
object list as it grabs the locks and fail&unwind for unordered lists.

Parameter validation doesn't really factor into this problem....

Jason