The USB controller drivers assume they can cast a NULL pointer to a
struct and find the address of a member. KUBSan complains about this so
replace with the __offsetof macro that uses sither a builtin function
where available, or the same method on older compilers.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/dev/usb/controller/atmegadci.c | ||
---|---|---|
81 | I would suggest to use __containerof() here to replace everything inside these macros BUS2SC macros. __containerof(bus, struct atmegadci_softc, sc_bus) Also make sure that all build targets inside stand/usb are building after this change. |
Comment Actions
I already changed it locally, unfortunately it doesn't update the review automatically.
sys/dev/usb/controller/atmegadci.c | ||
---|---|---|
81 | Is stand/usb used by any of the loaders? It's broken for me on arm64, e.g. bus_topo_lock is undefined in usb_controller.c |
Comment Actions
I'll have a look at stand/usb later then.
It is not used by any official loaders.
Is stand/usb used by any of the loaders? It's broken for me on arm64, e.g. bus_topo_lock is undefined in usb_controller.c
@imp : Do you mind adding two dummy functions bus_topo_lock() and bus_topo_unlock() to the kernel emulation shims in stand/usb ?