Re: [PATCH] Bluetooth: hci_core: Prefer struct_size over open coded arithmetic

2024-05-13 Thread Erick Archer
Hi Kees and Luiz, First of all, thanks for the reviews. On Mon, May 13, 2024 at 12:31:29PM -0400, Luiz Augusto von Dentz wrote: > Hi Eric, > > On Sun, May 12, 2024 at 11:08 PM Kees Cook wrote: > > > > On Sun, May 12, 2024 at 04:17:06PM +0200, Erick Archer wrote: > > > [...] > > > Also remove the

Re: [PATCH] Bluetooth: hci_core: Prefer struct_size over open coded arithmetic

2024-05-13 Thread Luiz Augusto von Dentz
Hi Eric, On Sun, May 12, 2024 at 11:08 PM Kees Cook wrote: > > On Sun, May 12, 2024 at 04:17:06PM +0200, Erick Archer wrote: > > This is an effort to get rid of all multiplications from allocation > > functions in order to prevent integer overflows [1][2]. > > > > As the "dl" variable is a pointe

Re: [PATCH] Bluetooth: hci_core: Prefer struct_size over open coded arithmetic

2024-05-12 Thread Kees Cook
On Sun, May 12, 2024 at 04:17:06PM +0200, Erick Archer wrote: > This is an effort to get rid of all multiplications from allocation > functions in order to prevent integer overflows [1][2]. > > As the "dl" variable is a pointer to "struct hci_dev_list_req" and this > structure ends in a flexible a

[PATCH] Bluetooth: hci_core: Prefer struct_size over open coded arithmetic

2024-05-12 Thread Erick Archer
This is an effort to get rid of all multiplications from allocation functions in order to prevent integer overflows [1][2]. As the "dl" variable is a pointer to "struct hci_dev_list_req" and this structure ends in a flexible array: struct hci_dev_list_req { [...] struct hci_dev_re