HomeFreeBSD

Fix undefined behaviour in the USB controllers

Description

Fix undefined behaviour in the USB controllers

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 and containerof macros that use either a
builtin function where available, or the same NULL pointer on older
compilers without the builtin.

Reviewers: hselasky

Subscribers: imp

Reviewed by: hselasky
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33865

(cherry picked from commit a3cea156801790d0bbbb4cd9bede0ece8742af82)

Details

Provenance
andrewAuthored on Dec 29 2021, 12:10 PM
Reviewer
hselasky
Differential Revision
D33865: Fix undefined behaviour in the USB controllers
Parents
rG099b125337de: rc: improve dependencies for growfs
Branches
Unknown
Tags
Unknown