Re: [PATCH 1/2] dmaengine: pxa_dma: Remove an erroneous BUG_ON() in pxad_free_desc()

2023-10-08 Thread Vinod Koul
On Sat, 07 Oct 2023 13:13:09 +0200, Christophe JAILLET wrote: > If pxad_alloc_desc() fails on the first dma_pool_alloc() call, then > sw_desc->nb_desc is zero. > In such a case pxad_free_desc() is called and it will BUG_ON(). > > Remove this erroneous BUG_ON(). > > It is also useless, because i

Re: [PATCH 2/2] dmaengine: pxa_dma: Annotate struct pxad_desc_sw with __counted_by

2023-10-08 Thread Kees Cook
On Sat, Oct 07, 2023 at 01:13:10PM +0200, Christophe JAILLET wrote: > Prepare for the coming implementation by GCC and Clang of the __counted_by > attribute. Flexible array members annotated with __counted_by can have > their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS > (f

Re: [PATCH 1/2] dmaengine: pxa_dma: Remove an erroneous BUG_ON() in pxad_free_desc()

2023-10-08 Thread Kees Cook
On Sat, Oct 07, 2023 at 01:13:09PM +0200, Christophe JAILLET wrote: > If pxad_alloc_desc() fails on the first dma_pool_alloc() call, then > sw_desc->nb_desc is zero. > In such a case pxad_free_desc() is called and it will BUG_ON(). > > Remove this erroneous BUG_ON(). Perhaps it could be changed t

Re: [PATCH] media: v4l2-event: Annotate struct v4l2_subscribed_event with __counted_by

2023-10-08 Thread Kees Cook
On Sat, Oct 07, 2023 at 11:21:26AM +0200, Hans Verkuil wrote: > On 06/10/2023 22:28, Kees Cook wrote: > > On Fri, 22 Sep 2023 10:49:52 -0700, Kees Cook wrote: > >> Prepare for the coming implementation by GCC and Clang of the __counted_by > >> attribute. Flexible array members annotated with __coun

Re: [PATCH] VMCI: Annotate struct vmci_handle_arr with __counted_by

2023-10-08 Thread Kees Cook
On Sat, Oct 07, 2023 at 04:32:34PM +0200, Christophe JAILLET wrote: > Prepare for the coming implementation by GCC and Clang of the __counted_by > attribute. Flexible array members annotated with __counted_by can have > their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS > (f

[PATCH] randstruct: Fix gcc-plugin performance mode to stay in group

2023-10-08 Thread Kees Cook
The performance mode of the gcc-plugin randstruct was shuffling struct members outside of the cache-line groups. Limit the range to the specified group indexes. Cc: linux-hardening@vger.kernel.org Reported-by: Lukas Loidolt Closes: https://lore.kernel.org/all/f3ca77f0-e414-4065-83a5-ae4c4d255...

Re: Missing cache considerations in randstruct performance feature

2023-10-08 Thread Kees Cook
On Sat, Oct 07, 2023 at 12:38:28PM +0200, Lukas Loidolt wrote: > On 07.10.23 06:12, Kees Cook wrote: > > On Sat, Oct 07, 2023 at 12:30:01AM +0200, Lukas Loidolt wrote: > > > In my tests, however, the performance version behaves more or less like > > > the > > > full version of randstruct. > > > >

Re: [PATCH] pinctrl: samsung: Annotate struct exynos_muxed_weint_data with __counted_by

2023-10-08 Thread Krzysztof Kozlowski
On Fri, 06 Oct 2023 13:17:07 -0700, Kees Cook wrote: > Prepare for the coming implementation by GCC and Clang of the __counted_by > attribute. Flexible array members annotated with __counted_by can have > their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for > array indexing) and