-
Notifications
You must be signed in to change notification settings - Fork 678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
providers/irdma: Validate input before memory window bind #1107
Conversation
providers/irdma/uverbs.c
Outdated
return EINVAL; | ||
|
||
if (bind_info->mr) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Why do we need these checks in user-space and not in the driver?
It is preferable to have one place for the checks and drivers are supposed to have these type of checks anyway. - I imagine almost all drivers need these checks. Why irdma is special here?
- You have double SOB for Tatyana in the commit message.
Signed-off-by: Signed-off-by: Tatyana Nikolova tatyana.e.nikolova@intel.com
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Why do we need these checks in user-space and not in the driver?
It is preferable to have one place for the checks and drivers are supposed to have these type of checks anyway.- I imagine almost all drivers need these checks. Why irdma is special here?
- You have double SOB for Tatyana in the commit message.
Signed-off-by: Signed-off-by: Tatyana Nikolova tatyana.e.nikolova@intel.com
Hi Leon - Thanks for the review. Sindhu is out for the rest of the year. And will work on these review comments when she is back on Jan 4th.
Shiraz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bind isn't supposed to call to the kernel, but perhaps the checkes should be done in the core rdma-core code..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will send out a patch. Thanks Jason/Leon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Address Leon's remarks
irdma does not do proper input validation checks on the memory window bind. Specifically, the checks for non-null MR, address and length as well as one to ensure MR and MW are in same PD are missing. Fix this by moving these checks to core code and remove it from providers rxe, hns, mlx5 and irdma too. Fixes: 14a0fc8 ("rdma-core/irdma: Implement device supported verb APIs") Signed-off-by: Sindhu-Devale <sindhu.devale@intel.com> Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com>
67ef6ce
to
a83619b
Compare
Looks good, if no one complains, I will merge it tomorrow, before rdma-core release. Thanks |
Check for a non null MR, address and length
before allowing bind operation.
Also, add check to make sure the MR and MW are in
same PD before posting a bind MW op.
Fixes: 14a0fc8 ("rdma-core/irdma: Implement device supported verb APIs")
Signed-off-by: Tatyana Nikolova tatyana.e.nikolova@intel.com
Signed-off-by: Sindhu-Devale sindhu.devale@intel.com