mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
RDMA/rxe: Close a race after ib_register_device
Since rxe allows unregistration from other threads the rxe pointer can become invalid any moment after ib_register_driver returns. This could cause a user triggered use after free. Add another driver callback to be called right after the device becomes registered to complete any device setup required post-registration. This callback has enough core locking to prevent the device from becoming unregistered. Signed-off-by: Jason Gunthorpe <[email protected]>
This commit is contained in:
parent
6cc2c8e535
commit
ca22354b14
6 changed files with 35 additions and 12 deletions
|
|
@ -2539,6 +2539,11 @@ struct ib_device_ops {
|
|||
struct rdma_restrack_entry *entry);
|
||||
|
||||
/* Device lifecycle callbacks */
|
||||
/*
|
||||
* Called after the device becomes registered, before clients are
|
||||
* attached
|
||||
*/
|
||||
int (*enable_driver)(struct ib_device *dev);
|
||||
/*
|
||||
* This is called as part of ib_dealloc_device().
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue