Commit Graph
9 Commits
Author SHA1 Message Date
Jason Gunthorpe 70f780edcd RDMA/ionic: Fix typo in format string
Applying the corrupted patch by hand mangled the format string, put the s
in the right place.

Cc: [email protected]
Fixes: 654a27f255 ("RDMA/ionic: bound node_desc sysfs read with %.64s")
Link: https://patch.msgid.link/r/[email protected]
Reported-by: Brad Spengler <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
2026-05-02 15:30:48 -03:00
Kai Zen 654a27f255 RDMA/ionic: bound node_desc sysfs read with %.64s
node_desc[64] in struct ib_device is not guaranteed to be NUL-
terminated. The core IB sysfs handler uses "%.64s" for exactly this
reason (drivers/infiniband/core/sysfs.c:1307), since node_desc_store()
performs a raw memcpy of up to IB_DEVICE_NODE_DESC_MAX bytes with no NUL
termination:

  memcpy(desc.node_desc, buf, min_t(int, count, IB_DEVICE_NODE_DESC_MAX));

If exactly 64 bytes are written via the node_desc sysfs file, the array
contains no NUL byte. The ionic hca_type_show() handler uses unbounded
"%s" and will read past the end of node_desc into adjacent fields of
struct ib_device until it encounters a NUL.

ionic supports IB_DEVICE_MODIFY_NODE_DESC, so this is triggerable by
userspace.

Match the core handler and bound the format specifier.

Cc: [email protected]
Fixes: 2075bbe8ef ("RDMA/ionic: Register device ops for miscellaneous functionality")
Link: https://patch.msgid.link/r/CALynFi7NAbhDCt1tdaDbf6TnLvAqbaHa6-Wqf6OkzREbA_PAfg@mail.gmail.com
Signed-off-by: Kai Aizen <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
2026-04-09 12:47:04 -03:00
Kamal Heib fd80bd7105 RDMA/ionic: Fix potential NULL pointer dereference in ionic_query_port
The function ionic_query_port() calls ib_device_get_netdev() without
checking the return value which could lead to NULL pointer dereference,
Fix it by checking the return value and return -ENODEV if the 'ndev' is
NULL.

Fixes: 2075bbe8ef ("RDMA/ionic: Register device ops for miscellaneous functionality")
Signed-off-by: Kamal Heib <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Leon Romanovsky <[email protected]>
2026-02-24 04:54:10 -05:00
Abhijit Gangurde ea4c399642 RDMA/ionic: Implement device stats ops
Implement device stats operations for hw stats and qp stats.

Co-developed-by: Allen Hubbe <[email protected]>
Signed-off-by: Allen Hubbe <[email protected]>
Signed-off-by: Abhijit Gangurde <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Leon Romanovsky <[email protected]>
2025-09-11 02:18:36 -04:00
Abhijit Gangurde 2075bbe8ef RDMA/ionic: Register device ops for miscellaneous functionality
Implement idbdev ops for device and port information.

Co-developed-by: Andrew Boyer <[email protected]>
Signed-off-by: Andrew Boyer <[email protected]>
Co-developed-by: Allen Hubbe <[email protected]>
Signed-off-by: Allen Hubbe <[email protected]>
Signed-off-by: Abhijit Gangurde <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Leon Romanovsky <[email protected]>
2025-09-11 02:18:36 -04:00
Abhijit Gangurde b83c62055b RDMA/ionic: Register device ops for datapath
Implement device supported verb APIs for datapath.

Co-developed-by: Andrew Boyer <[email protected]>
Signed-off-by: Andrew Boyer <[email protected]>
Co-developed-by: Allen Hubbe <[email protected]>
Signed-off-by: Allen Hubbe <[email protected]>
Signed-off-by: Abhijit Gangurde <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Leon Romanovsky <[email protected]>
2025-09-11 02:18:36 -04:00
Abhijit Gangurde e8521822c7 RDMA/ionic: Register device ops for control path
Implement device supported verb APIs for control path.

Co-developed-by: Andrew Boyer <[email protected]>
Signed-off-by: Andrew Boyer <[email protected]>
Co-developed-by: Allen Hubbe <[email protected]>
Signed-off-by: Allen Hubbe <[email protected]>
Signed-off-by: Abhijit Gangurde <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Leon Romanovsky <[email protected]>
2025-09-11 02:18:36 -04:00
Abhijit Gangurde f3bdbd4270 RDMA/ionic: Create device queues to support admin operations
Setup RDMA admin queues using device command exposed over
auxiliary device and manage these queues using ida.

Co-developed-by: Andrew Boyer <[email protected]>
Signed-off-by: Andrew Boyer <[email protected]>
Co-developed-by: Allen Hubbe <[email protected]>
Signed-off-by: Allen Hubbe <[email protected]>
Signed-off-by: Abhijit Gangurde <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Leon Romanovsky <[email protected]>
2025-09-11 02:18:36 -04:00
Abhijit Gangurde 8d765af51a RDMA/ionic: Register auxiliary module for ionic ethernet adapter
Register auxiliary module to create ibdevice for ionic
ethernet adapter.

Co-developed-by: Andrew Boyer <[email protected]>
Signed-off-by: Andrew Boyer <[email protected]>
Co-developed-by: Allen Hubbe <[email protected]>
Signed-off-by: Allen Hubbe <[email protected]>
Signed-off-by: Abhijit Gangurde <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Leon Romanovsky <[email protected]>
2025-09-11 02:18:36 -04:00