* [PATCH] IB/uverbs: Signedness bug in UVERBS_HANDLER()
@ 2018-12-22 7:42 Dan Carpenter
2018-12-22 8:37 ` Leon Romanovsky
2018-12-22 23:09 ` Jason Gunthorpe
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2018-12-22 7:42 UTC (permalink / raw)
To: kernel-janitors
The "num_sge" variable needs to be signed for the error handling to
work. The uverbs_attr_ptr_get_array_size() returns int so this change
is safe.
Fixes: ad8a4496757f ("IB/uverbs: Add support to advise_mr")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/infiniband/core/uverbs_std_types_mr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/core/uverbs_std_types_mr.c b/drivers/infiniband/core/uverbs_std_types_mr.c
index 71dfa5e5938e..4d4be0c2b752 100644
--- a/drivers/infiniband/core/uverbs_std_types_mr.c
+++ b/drivers/infiniband/core/uverbs_std_types_mr.c
@@ -47,7 +47,7 @@ static int UVERBS_HANDLER(UVERBS_METHOD_ADVISE_MR)(
enum ib_uverbs_advise_mr_advice advice;
struct ib_device *ib_dev = pd->device;
struct ib_sge *sg_list;
- u32 num_sge;
+ int num_sge;
u32 flags;
int ret;
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] IB/uverbs: Signedness bug in UVERBS_HANDLER()
2018-12-22 7:42 [PATCH] IB/uverbs: Signedness bug in UVERBS_HANDLER() Dan Carpenter
@ 2018-12-22 8:37 ` Leon Romanovsky
2018-12-22 23:09 ` Jason Gunthorpe
1 sibling, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2018-12-22 8:37 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 512 bytes --]
On Sat, Dec 22, 2018 at 10:42:59AM +0300, Dan Carpenter wrote:
> The "num_sge" variable needs to be signed for the error handling to
> work. The uverbs_attr_ptr_get_array_size() returns int so this change
> is safe.
>
> Fixes: ad8a4496757f ("IB/uverbs: Add support to advise_mr")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> drivers/infiniband/core/uverbs_std_types_mr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Thanks,
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] IB/uverbs: Signedness bug in UVERBS_HANDLER()
2018-12-22 7:42 [PATCH] IB/uverbs: Signedness bug in UVERBS_HANDLER() Dan Carpenter
2018-12-22 8:37 ` Leon Romanovsky
@ 2018-12-22 23:09 ` Jason Gunthorpe
1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2018-12-22 23:09 UTC (permalink / raw)
To: kernel-janitors
On Sat, Dec 22, 2018 at 10:42:59AM +0300, Dan Carpenter wrote:
> The "num_sge" variable needs to be signed for the error handling to
> work. The uverbs_attr_ptr_get_array_size() returns int so this change
> is safe.
>
> Fixes: ad8a4496757f ("IB/uverbs: Add support to advise_mr")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
> ---
> drivers/infiniband/core/uverbs_std_types_mr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to for-next
Thanks,
Jason
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-12-22 23:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-22 7:42 [PATCH] IB/uverbs: Signedness bug in UVERBS_HANDLER() Dan Carpenter
2018-12-22 8:37 ` Leon Romanovsky
2018-12-22 23:09 ` Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox