Page MenuHomeFreeBSD

acpi_gpiobus: Fix cleanup on set flags failure
ClosedPublic

Authored by andrew on Nov 19 2024, 1:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jan 14, 10:29 PM
Unknown Object (File)
Tue, Jan 14, 10:44 AM
Unknown Object (File)
Tue, Jan 14, 10:31 AM
Unknown Object (File)
Tue, Jan 14, 7:01 AM
Unknown Object (File)
Mon, Jan 13, 5:18 PM
Unknown Object (File)
Mon, Jan 6, 4:00 PM
Unknown Object (File)
Mon, Jan 6, 9:25 AM
Unknown Object (File)
Mon, Jan 6, 9:11 AM
Subscribers

Details

Summary

When GPIOBUS_PIN_SETFLAGS fails we called gpiobus_free_ivars to clean
up the contents of the ivar, then would free the ivar. This lead to a
use-after-free as the ivar had already been set on the child so
gpiobus_child_deleted would try to free it again.

Fix this by removing the early cleanup and letting
gpiobus_child_deleted handle it.

Fixes: c9e880c0ceef ("gpiobus: Use a bus_child_deleted method to free ivars for children")
Sponsored by: Arm Ltd

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Dec 9 2024, 3:45 PM
This revision was automatically updated to reflect the committed changes.