Commit 4bfbc269 authored by Thorsten Blum's avatar Thorsten Blum Committed by Kees Cook
Browse files

mux: Convert mux_control_ops to a flex array member in mux_chip

Convert mux_control_ops to a flexible array member at the end of the
mux_chip struct and add the __counted_by() compiler attribute to
improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
CONFIG_FORTIFY_SOURCE.

Use struct_size() to calculate the number of bytes to allocate for a new
mux chip and to remove the following Coccinelle/coccicheck warning:

  WARNING: Use struct_size

Use size_add() to safely add any extra bytes.

No functional changes intended.

Link: https://github.com/KSPP/linux/issues/83


Signed-off-by: default avatarThorsten Blum <thorsten.blum@linux.dev>
Link: https://lore.kernel.org/r/20250610104106.1948-2-thorsten.blum@linux.dev


Signed-off-by: default avatarKees Cook <kees@kernel.org>
parent e04c78d8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment