On 30-Apr-19 14:18, Leon Romanovsky wrote: > On Tue, Apr 30, 2019 at 11:46:39AM +0300, Gal Pressman wrote: >> Cited commit introduced the udata parameter to different destroy flows >> but the uapi method definition does not have udata (i.e has_udata flag >> is not set). As a result, an uninitialized udata struct is being passed >> down to the driver callbacks. >> >> Fix that by clearing the driver udata even in cases where has_udata flag >> is not set. >> >> Fixes: c4367a26357b ("IB: Pass uverbs_attr_bundle down ib_x destroy path") >> Cc: Shamir Rabinovitch <shamir.rabinovitch@xxxxxxxxxx> >> Co-developed-by: Jason Gunthorpe <jgg@xxxxxxxx> > > What is wrong with Signed-off-by that caused you to add new tag? Jason is the one that originally wrote and sent the code, this tag seems appropriate. Obviously I don't mind removing it, it's there to give him credit.. > >> Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxx> >> Signed-off-by: Gal Pressman <galpress@xxxxxxxxxx> >> --- >> drivers/infiniband/core/uverbs_ioctl.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/drivers/infiniband/core/uverbs_ioctl.c b/drivers/infiniband/core/uverbs_ioctl.c >> index cfbef25b3a73..829b0c6944d8 100644 >> --- a/drivers/infiniband/core/uverbs_ioctl.c >> +++ b/drivers/infiniband/core/uverbs_ioctl.c >> @@ -453,6 +453,8 @@ static int ib_uverbs_run_method(struct bundle_priv *pbundle, >> uverbs_fill_udata(&pbundle->bundle, >> &pbundle->bundle.driver_udata, >> UVERBS_ATTR_UHW_IN, UVERBS_ATTR_UHW_OUT); >> + else >> + pbundle->bundle.driver_udata = (struct ib_udata){}; >> >> if (destroy_bkey != UVERBS_API_ATTR_BKEY_LEN) { >> struct uverbs_obj_attr *destroy_attr = >> -- >> 2.7.4 >>