Re: [PATCH][next] ALSA: 6fire: Fix undefined behavior bug in struct comm_runtime

2023-09-30 Thread Gustavo A. R. Silva
On 9/29/23 19:26, Kees Cook wrote: On Fri, Sep 29, 2023 at 05:59:22PM +0200, Gustavo A. R. Silva wrote: `struct urb` is a flexible structure, which means that it contains a flexible-array member at the bottom. This could potentially lead to an overwrite of the objects following `receiver` in

Re: [PATCH] dmaengine: ep93xx_dma: Annotate struct ep93xx_dma_engine with __counted_by

2023-09-30 Thread Gustavo A. R. Silva
On 9/29/23 01:43, 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 CONFIG_FORTIFY_SOURCE

Re: [PATCH] comedi: Annotate struct comedi_lrange with __counted_by

2023-09-30 Thread Gustavo A. R. Silva
On 9/30/23 11:14, 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 (for array indexing) and CONF

Re: [PATCH 5/5] cxgb4: Annotate struct smt_data with __counted_by

2023-09-30 Thread Gustavo A. R. Silva
On 9/29/23 20:11, 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 checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIF

Re: [PATCH 4/5] cxgb4: Annotate struct sched_table with __counted_by

2023-09-30 Thread Gustavo A. R. Silva
On 9/29/23 20:11, 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 checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIF

Re: [PATCH 3/5] cxgb4: Annotate struct cxgb4_tc_u32_table with __counted_by

2023-09-30 Thread Gustavo A. R. Silva
On 9/29/23 20:11, 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 checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIF

Re: [PATCH 2/5] cxgb4: Annotate struct clip_tbl with __counted_by

2023-09-30 Thread Gustavo A. R. Silva
On 9/29/23 20:11, 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 checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIF

Re: [PATCH 1/5] chelsio/l2t: Annotate struct l2t_data with __counted_by

2023-09-30 Thread Gustavo A. R. Silva
On 9/29/23 20:11, 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 checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIF

Re: [PATCH] comedi: Annotate struct comedi_lrange with __counted_by

2023-09-30 Thread Kees Cook
On Sat, Sep 30, 2023 at 11:14:47AM +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] iio: adc: stm32-adc: replace deprecated strncpy

2023-09-30 Thread Kees Cook
On Sat, Sep 30, 2023 at 06:41:18PM +0100, Jonathan Cameron wrote: > On Sat, 23 Sep 2023 20:15:09 -0700 > Kees Cook wrote: > > > On Thu, Sep 21, 2023 at 04:54:00AM +, Justin Stitt wrote: > > > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > > > > > We should pre

Re: [PATCH] iio: adc: stm32-adc: replace deprecated strncpy

2023-09-30 Thread Jonathan Cameron
On Sat, 23 Sep 2023 20:15:09 -0700 Kees Cook wrote: > On Thu, Sep 21, 2023 at 04:54:00AM +, Justin Stitt wrote: > > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > > > We should prefer more robust and less ambiguous string interfaces. > > > > We expect adc->ch

Re: [PATCH] input: mt: Annotate struct input_mt with __counted_by

2023-09-30 Thread Dmitry Torokhov
On Fri, Sep 22, 2023 at 10:50:37AM -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 checking via CONFIG_UBSAN_BOUNDS > (for array

Re: [PATCH] Input: Annotate struct input_leds with __counted_by

2023-09-30 Thread Dmitry Torokhov
On Fri, Sep 22, 2023 at 10:50:32AM -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 checking via CONFIG_UBSAN_BOUNDS > (for array

Re: [PATCH] input: Annotate struct evdev_client with __counted_by

2023-09-30 Thread Dmitry Torokhov
On Fri, Sep 22, 2023 at 10:50:28AM -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 checking via CONFIG_UBSAN_BOUNDS > (for array

Re: [PATCH v2] Input: axp20x-pek - avoid needless newline removal

2023-09-30 Thread Dmitry Torokhov
On Mon, Sep 25, 2023 at 04:31:05AM +, Justin Stitt wrote: > This code is doing more work than it needs to. > > Before handing off `val_str` to `kstrtouint()` we are eagerly removing > any trailing newline which requires copying `buf`, validating it's > length and checking/replacing any potenti

Re: [PATCH] Input: synaptics-rmi4 - replace deprecated strncpy

2023-09-30 Thread Dmitry Torokhov
On Thu, Sep 21, 2023 at 09:58:11AM +, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings [1] > > Let's use memcpy() as the bounds have already been checked and this > decays into a simple byte copy from one buffer to another removing any > ambiguity tha

Re: [PATCH RESEND v5 7/8] arm64: dts: Add DTS for Marvell PXA1908 and samsung,coreprimevelte

2023-09-30 Thread Linus Walleij
On Sat, Sep 30, 2023 at 10:25 AM Duje Mihanović wrote: > On Saturday, September 30, 2023 12:05:41 AM CEST Linus Walleij wrote: > > But it exists, so I can't say you can't use it. Not my choice. > > I understand it is convenient. > > > > It is possible to switch later, but only if you have a unique

Re: Fwd: Performance regression: resume_console takes 100ms longer in S2idle/S3 resume in v6.6-rc1

2023-09-30 Thread Bagas Sanjaya
On 28/09/2023 07:17, Bagas Sanjaya wrote: > Hi, > > I notice a regression report on Bugzilla [1]. Quoting from it: > >> Ever since 6.6.0-rc1 we've seen S3 and S2idle resume take 100ms longer >> because of resume_comsole. resume_console ordinarily takes only a few >> milliseconds, but now it's c

Re: [PATCH RESEND v5 3/8] dt-bindings: clock: Add Marvell PXA1908 clock bindings

2023-09-30 Thread Conor Dooley
On Fri, Sep 29, 2023 at 05:41:59PM +0200, Duje Mihanović wrote: > Add dt bindings and documentation for the Marvell PXA1908 clock > controller. > > Signed-off-by: Duje Mihanović Reviewed-by: Conor Dooley Thanks, Conor. > --- > .../devicetree/bindings/clock/marvell,pxa1908.yaml | 48 +

[PATCH] comedi: Annotate struct comedi_lrange with __counted_by

2023-09-30 Thread Christophe JAILLET
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 (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family funct

Re: [PATCH RESEND v5 7/8] arm64: dts: Add DTS for Marvell PXA1908 and samsung,coreprimevelte

2023-09-30 Thread Duje Mihanović
On Saturday, September 30, 2023 12:05:41 AM CEST Linus Walleij wrote: > But it exists, so I can't say you can't use it. Not my choice. > I understand it is convenient. > > It is possible to switch later, but only if you have a unique > pin controller compatible so please add that. Maybe a dumb qu

Re: [PATCH][next] media: usb: siano: Fix undefined behavior bug in struct smsusb_urb_t

2023-09-30 Thread Greg Kroah-Hartman
On Fri, Sep 29, 2023 at 06:20:10PM +0200, Jann Horn wrote: > On Fri, Sep 29, 2023 at 5:42 PM Gustavo A. R. Silva > wrote: > > `struct urb` is a flexible structure, which means that it contains a > > flexible-array member at the bottom. This could potentially lead to an > > overwrite of the object