Skip to contentSkip to conversation

rdma_rxe: address an issue with hardened user copy

PATCH Applied Bob Pearson 2 participants 2 messages Aug 27, 2020 – Aug 31, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 rdma_rxe: address an issue with hardened user copy

Change rxe pools to use kzalloc instead of kmem_cache to allocate memory for rxe objects.

difference v1-v2:
ported patch to current for-next branch

---
 drivers/infiniband/sw/rxe/rxe.c      |  8 ----
 drivers/infiniband/sw/rxe/rxe_pool.c | 60 +---------------------------
 drivers/infiniband/sw/rxe/rxe_pool.h |  7 ----
 3 files changed, 2 insertions(+), 73 deletions(-)
drivers/infiniband/sw/rxe/rxe.c +0 -8
index 904351bcb9ce..3cba4a1f5070 100644
@@ -309,13 +309,6 @@ static int __init rxe_module_init(void)
 {
 	int err;
 
-	/* initialize slab caches for managed objects */
-	err = rxe_cache_init();
-	if (err) {
-		pr_err("unable to init object pools\n");
-		return err;
-	}
-
 	err = rxe_net_init();
 	if (err)
 		return err;
@@ -330,7 +323,6 @@ static void __exit rxe_module_exit(void)
 	rdma_link_unregister(&rxe_link_ops);
 	ib_unregister_driver(RDMA_DRIVER_RXE);
 	rxe_net_exit();
-	rxe_cache_exit();
 
 	pr_info("unloaded\n");
 }
drivers/infiniband/sw/rxe/rxe_pool.c +2 -58

78 lines not on this page · raw message

drivers/infiniband/sw/rxe/rxe_pool.h +0 -7
index 2f2cff1cbe43..f249eca6b5f3 100644
@@ -69,7 +69,6 @@ struct rxe_type_info {
 	u32			min_index;
 	size_t			key_offset;
 	size_t			key_size;
-	struct kmem_cache	*cache;
 };
 
 extern struct rxe_type_info rxe_type_info[];
@@ -113,12 +112,6 @@ struct rxe_pool {
 	size_t			key_size;
 };
 
-/* initialize slab caches for managed objects */
-int rxe_cache_init(void);
-
-/* cleanup slab caches for managed objects */
-void rxe_cache_exit(void);
-
 /* initialize a pool of objects with given limit on
  * number of elements. gets parameters from rxe_type_info
  * pool elements will be allocated out of a slab cache
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw
Quoted 6 lines · Bob Pearson

Change rxe pools to use kzalloc instead of kmem_cache to allocate memory for rxe objects.

difference v1-v2:
ported patch to current for-next branch

Quoted 6 lines
---
 drivers/infiniband/sw/rxe/rxe.c      |  8 ----
 drivers/infiniband/sw/rxe/rxe_pool.c | 60 +---------------------------
 drivers/infiniband/sw/rxe/rxe_pool.h |  7 ----
 3 files changed, 2 insertions(+), 73 deletions(-)

Applied to for-next, thanks

Jason