Skip to content

Commit 784304a

Browse files
ausyskingregkh
authored andcommitted
mei: bus: disallow driver match while dismantling device
With immediate reply support to enum request and FW reset, a device on MEI bus can be temporarily removed. A driver for a device on MEI bus can try to bind to the device right between bus attempt to remove driver and device structures removal. This leaves device driver with pointers to freed memory of device structures. Avoid bus device driver bind while dismantling device by disallowing device match right before driver release. Signed-off-by: Alexander Usyskin <[email protected]> Signed-off-by: Tomas Winkler <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 209cdbd commit 784304a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/misc/mei/bus.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
/*
3-
* Copyright (c) 2012-2019, Intel Corporation. All rights reserved.
3+
* Copyright (c) 2012-2023, Intel Corporation. All rights reserved.
44
* Intel Management Engine Interface (Intel MEI) Linux driver
55
*/
66

@@ -1392,6 +1392,7 @@ static int mei_cl_bus_dev_add(struct mei_cl_device *cldev)
13921392
*/
13931393
static void mei_cl_bus_dev_stop(struct mei_cl_device *cldev)
13941394
{
1395+
cldev->do_match = 0;
13951396
if (cldev->is_added)
13961397
device_release_driver(&cldev->dev);
13971398
}

0 commit comments

Comments
 (0)