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)
Sat, Apr 26, 5:06 PM
Unknown Object (File)
Fri, Apr 25, 1:02 AM
Unknown Object (File)
Sun, Apr 20, 8:03 AM
Unknown Object (File)
Sun, Apr 20, 4:27 AM
Unknown Object (File)
Sun, Apr 20, 12:23 AM
Unknown Object (File)
Sat, Apr 19, 11:05 PM
Unknown Object (File)
Fri, Apr 18, 9:41 PM
Unknown Object (File)
Feb 20 2025, 3:16 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