The branch main has been updated by hselasky:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=31525faed8b43c579767cf3ac211f41764b2a46c

commit 31525faed8b43c579767cf3ac211f41764b2a46c
Author:     Hans Petter Selasky <[email protected]>
AuthorDate: 2021-06-16 13:01:42 +0000
Commit:     Hans Petter Selasky <[email protected]>
CommitDate: 2021-07-12 12:22:31 +0000

    ibcore: Validate port number in query_pkey verb.
    
    Before calling the driver's function let's make sure port is valid.
    
    Linux commit:
    9af3f5cf9d64a056eca53bc643f6288ad28bbbb5
    
    MFC after:      1 week
    Reviewed by:    kib
    Sponsored by:   Mellanox Technologies // NVIDIA Networking
---
 sys/ofed/drivers/infiniband/core/ib_device.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/ofed/drivers/infiniband/core/ib_device.c 
b/sys/ofed/drivers/infiniband/core/ib_device.c
index 8c6a2d9f1a8a..8ce1127db639 100644
--- a/sys/ofed/drivers/infiniband/core/ib_device.c
+++ b/sys/ofed/drivers/infiniband/core/ib_device.c
@@ -809,6 +809,9 @@ void ib_cache_gid_del_all_by_netdev(struct ifnet *ndev)
 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);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main
To unsubscribe, send any mail to "[email protected]"

Reply via email to