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, Nov 25, 8:41 AM
Unknown Object (File)
Fri, Nov 21, 1:59 PM
Unknown Object (File)
Fri, Nov 14, 9:12 AM
Unknown Object (File)
Sat, Nov 8, 11:32 PM
Unknown Object (File)
Wed, Nov 5, 9:55 PM
Unknown Object (File)
Thu, Oct 30, 1:58 AM
Unknown Object (File)
Wed, Oct 29, 9:04 PM
Unknown Object (File)
Wed, Oct 29, 8:57 PM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 60683
Build 57567: arc lint + arc unit