OSDN Git Service
(root)
/
tomoyo
/
tomoyo-test1.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fe15bcc
)
RDMA/core: Validate port number in query_pkey verb
author
Yuval Shaia
<yuval.shaia@oracle.com>
Thu, 6 Dec 2018 12:48:18 +0000
(14:48 +0200)
committer
Jason Gunthorpe
<jgg@mellanox.com>
Fri, 7 Dec 2018 21:33:09 +0000
(14:33 -0700)
Before calling the driver's function let's make sure port is valid.
Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/device.c
patch
|
blob
|
history
diff --git
a/drivers/infiniband/core/device.c
b/drivers/infiniband/core/device.c
index
0027b0d
..
348a7fb
100644
(file)
--- a/
drivers/infiniband/core/device.c
+++ b/
drivers/infiniband/core/device.c
@@
-1042,6
+1042,9
@@
int ib_enum_all_devs(nldev_callback nldev_cb, struct sk_buff *skb,
int ib_query_pkey(struct ib_device *device,
u8 port_num, u16 index, u16 *pkey)
{
+ if (!rdma_is_port_valid(device, port_num))
+ return -EINVAL;
+
return device->query_pkey(device, port_num, index, pkey);
}
EXPORT_SYMBOL(ib_query_pkey);