On Thu, Feb 28, 2019 at 09:25:50PM +0200, Leon Romanovsky wrote: > On Thu, Feb 28, 2019 at 05:57:55PM +0200, Gal Pressman wrote: > > On 28-Feb-19 17:38, Bernard Metzler wrote: > > >>> + > > >>> + rv = ib_copy_to_udata(udata, &uresp, sizeof(uresp)); > > >> > > >> All ib_copy_from/to_udata should copy the minimum of sizeof() and > > >> udata->inlen/outlen. Applies to other places in the code as well. > > >> > > > Hmmm, shouldn't better the rdma core take care of that? > > > > Sounds like a good idea, I would love to see such patch :). > > Anyway, this should be fixed here or in the core code. > > If you are talking about drivers/infiniband/core/*, so yes, it was > discussed several times, but no one actually sent a patch. core/* is already done, see uverbs_response(), uverbs_request(), etc The issue is the drivers were not done similiarly as well, but that is the basic format for what the API should look like. Jason