Re: [RESEND PATCH] mux: Convert mux_control_ops to a flex array member in mux_chip

2025-04-29 Thread Thorsten Blum
Peter? On 13. Apr 2025, at 14:42, Thorsten Blum wrote: > On 7. Apr 2025, at 20:20, Kees Cook wrote: >> On Fri, Mar 07, 2025 at 12:32:07PM +0100, Thorsten Blum wrote: >>> On 3. Mar 2025, at 19:44, Kees Cook wrote: On Mon, Mar 03, 2025 at 12:02:22AM +0100, Thorsten Blum wrote: > Convert mux

Re: [RESEND PATCH] mux: Convert mux_control_ops to a flex array member in mux_chip

2025-04-13 Thread Thorsten Blum
Hi Peter, On 7. Apr 2025, at 20:20, Kees Cook wrote: > On Fri, Mar 07, 2025 at 12:32:07PM +0100, Thorsten Blum wrote: >> On 3. Mar 2025, at 19:44, Kees Cook wrote: >>> On Mon, Mar 03, 2025 at 12:02:22AM +0100, Thorsten Blum wrote: Convert mux_control_ops to a flexible array member at the end

Re: [RESEND PATCH] mux: Convert mux_control_ops to a flex array member in mux_chip

2025-04-07 Thread Kees Cook
On Fri, Mar 07, 2025 at 12:32:07PM +0100, Thorsten Blum wrote: > On 3. Mar 2025, at 19:44, Kees Cook wrote: > > On Mon, Mar 03, 2025 at 12:02:22AM +0100, Thorsten Blum wrote: > >> Convert mux_control_ops to a flexible array member at the end of the > >> mux_chip struct and add the __counted_by() co

[RESEND PATCH] mux: Convert mux_control_ops to a flex array member in mux_chip

2025-03-18 Thread Thorsten Blum
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

Re: [RESEND PATCH] mux: Convert mux_control_ops to a flex array member in mux_chip

2025-03-07 Thread Thorsten Blum
On 3. Mar 2025, at 19:44, Kees Cook wrote: > On Mon, Mar 03, 2025 at 12:02:22AM +0100, Thorsten Blum wrote: >> 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_

Re: [RESEND PATCH] mux: Convert mux_control_ops to a flex array member in mux_chip

2025-03-05 Thread Kees Cook
On Wed, Mar 05, 2025 at 05:31:57PM +, Qing Zhao wrote: > This does look like a bug in the compiler, could you please file a bug > against GCC on this? Okay, thanks for taking a looking! GCC: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119132 Clang: https://github.com/llvm/llvm-project/issue

Re: [RESEND PATCH] mux: Convert mux_control_ops to a flex array member in mux_chip

2025-03-05 Thread Qing Zhao
> On Mar 4, 2025, at 23:57, Kees Cook wrote: > > On Tue, Mar 04, 2025 at 09:58:21AM +0100, Thorsten Blum wrote: >> On 3. Mar 2025, at 19:44, Kees Cook wrote: >>> On Mon, Mar 03, 2025 at 12:02:22AM +0100, Thorsten Blum wrote: Convert mux_control_ops to a flexible array member at the end of

Re: [RESEND PATCH] mux: Convert mux_control_ops to a flex array member in mux_chip

2025-03-05 Thread Qing Zhao
> On Mar 4, 2025, at 23:57, Kees Cook wrote: > > #include > #include > > struct foo { >int count; >int array[] __attribute__((__counted_by__(count))); > }; > > int main(int argc, char *argv[]) { >int num_elems = 2 + argc; > >struct foo *p = malloc(sizeof(*p) + num_elems *

Re: [RESEND PATCH] mux: Convert mux_control_ops to a flex array member in mux_chip

2025-03-04 Thread Kees Cook
On Tue, Mar 04, 2025 at 09:58:21AM +0100, Thorsten Blum wrote: > On 3. Mar 2025, at 19:44, Kees Cook wrote: > > On Mon, Mar 03, 2025 at 12:02:22AM +0100, Thorsten Blum wrote: > >> Convert mux_control_ops to a flexible array member at the end of the > >> mux_chip struct and add the __counted_by() co

Re: [RESEND PATCH] mux: Convert mux_control_ops to a flex array member in mux_chip

2025-03-04 Thread Thorsten Blum
On 3. Mar 2025, at 19:44, Kees Cook wrote: > On Mon, Mar 03, 2025 at 12:02:22AM +0100, Thorsten Blum wrote: >> 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_

Re: [RESEND PATCH] mux: Convert mux_control_ops to a flex array member in mux_chip

2025-03-03 Thread Kees Cook
On Mon, Mar 03, 2025 at 12:02:22AM +0100, Thorsten Blum wrote: > 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 str

[RESEND PATCH] mux: Convert mux_control_ops to a flex array member in mux_chip

2025-03-02 Thread Thorsten Blum
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

[PATCH] mux: Convert mux_control_ops to a flex array member in mux_chip

2025-02-21 Thread Thorsten Blum
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