Page MenuHomeFreeBSD

acpi: set up the sysctl tree before acpi_machdep_init()
Needs ReviewPublic

Authored by nprice on Sat, Oct 17, 6:07 AM.
Tags
None
Referenced Files
F176304984: D60797.id190094.diff
Sat, Oct 17, 7:17 PM
F176299875: D60797.diff
Sat, Oct 17, 6:35 PM
F176297497: D60797.id190094.diff
Sat, Oct 17, 6:18 PM
F176290081: D60797.diff
Sat, Oct 17, 5:11 PM
F176284262: D60797.diff
Sat, Oct 17, 4:02 PM
F176270766: D60797.id.diff
Sat, Oct 17, 1:43 PM
F176269618: D60797.id.diff
Sat, Oct 17, 1:31 PM
F176269586: D60797.id.diff
Sat, Oct 17, 1:30 PM
Subscribers

Details

Reviewers
olce
adrian
Summary

On amd64 and i386, acpi_machdep_init() adds hw.acpi.reset_video under
acpi_sysctl_tree. Since the tree moved to the end of attach, it no
longer exists at that point, so sysctl_add_oid() drops the node and the
sysctl documented in acpi(4) is missing. Found with KUBSAN.

acpi_machdep_init() cannot fail, so calling it after the tree does not
leave knobs behind on a failed attach.

Signed-off-by: Nick Price <nprice@FreeBSD.org>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 78287
Build 75170: arc lint + arc unit

Event Timeline

nprice held this revision as a draft.
nick_spun.io added a reviewer: adrian.

Oh, sorry to have missed that. Building the sysctl(8) tree was pushed down in order to avoid having to add code to destroy it on error as at this point error is not possible anymore. Thus, just moving the call to acpi_machdep_init() is not enough. You have to add a call to syctl_ctx_free() on error.

When this revision is approved, please add the following tag on commit:
Fixes: 7f031c9f6b9f ("acpi: Move sysctl tree set up at end of initialization")