Re: [PATCH v4 1/4] interconnect: qcom: icc-rpmh: Add QoS configuration support

2024-05-07 Thread Mike Tipton
On Sat, Apr 13, 2024 at 09:31:47PM +0200, Konrad Dybcio wrote: > On 3.04.2024 10:45 AM, Odelu Kukatla wrote: > > > > > > On 3/27/2024 2:26 AM, Konrad Dybcio wrote: > >> On 25.03.2024 7:16 PM, Odelu Kukatla wrote: > >>> It adds QoS support for QNOC device and includes support for > >>> configuring

Re: [PATCH] scsi: sr: fix unintentional arithmetic wraparound

2024-05-07 Thread Kees Cook
On Wed, May 08, 2024 at 12:02:27AM +, Justin Stitt wrote: > Running syzkaller with the newly reintroduced signed integer overflow > sanitizer produces this report: > > [ 65.194362] [ cut here ] > [ 65.197752] UBSAN: signed-integer-overflow in > ../drivers/scsi/sr_i

Re: [PATCH] fs: remove accidental overflow during wraparound check

2024-05-07 Thread Kees Cook
On Tue, May 07, 2024 at 11:17:57PM +, Justin Stitt wrote: > Running syzkaller with the newly enabled signed integer overflow > sanitizer produces this report: > > [ 195.401651] [ cut here ] > [ 195.404808] UBSAN: signed-integer-overflow in ../fs/open.c:321:15 > [ 195

Re: [PATCH] cdrom: rearrange last_media_change check to avoid unintentional overflow

2024-05-07 Thread Kees Cook
On Tue, May 07, 2024 at 04:54:04AM +, Justin Stitt wrote: > When running syzkaller with the newly reintroduced signed integer wrap > sanitizer we encounter this splat: > > [ 366.015950] UBSAN: signed-integer-overflow in > ../drivers/cdrom/cdrom.c:2361:33 > [ 366.021089] -9223372036854775808

Re: [PATCH] fs: remove accidental overflow during wraparound check

2024-05-07 Thread Al Viro
On Tue, May 07, 2024 at 11:17:57PM +, Justin Stitt wrote: > I wonder, though, why isn't loff_t an unsigned type? Consider lseek(fd, -10, SEEK_CUR) PS: the above is *not* an endorsement of the proposed patch or KASAN overflow nonsense in general.

[PATCH] scsi: sr: fix unintentional arithmetic wraparound

2024-05-07 Thread Justin Stitt
speed *= 177; /* Nx to kbyte/s */ --- base-commit: 0106679839f7c69632b3b9833c3268c316c0a9fc change-id: 20240507-b4-b4-sio-sr_select_speed-e68c0d426891 Best regards, -- Justin Stitt

[RFC] Mitigating unexpected arithmetic overflow

2024-05-07 Thread Kees Cook
Hi, Over the last decade or so, our work hardening against weaknesses in various kernel APIs and eliminating the ambiguities in C language semantics have traditionally been somewhat off in one corner or another of the Linux codebase. This topic is going to be much different as it is ultimately abo

[PATCH] fs: remove accidental overflow during wraparound check

2024-05-07 Thread Justin Stitt
b->s_maxbytes) || ((offset + len) < 0)) + /* Check for wraparound */ + if (check_add_overflow(offset, len, &sum)) + return -EFBIG; + + /* Now, check bounds */ + if (sum > inode->i_sb->s_maxbytes || sum < 0) return -EFBIG;

Re: [PATCH net-next 0/2] gve: Minor cleanups

2024-05-07 Thread Jakub Kicinski
On Fri, 03 May 2024 21:31:25 +0100 Simon Horman wrote: > This short patchset provides two minor cleanups for the gve driver. > > These were found by tooling as mentioned in each patch, > and otherwise by inspection. > > No change in run time behaviour is intended. > Each patch is compile tested o

Re: [PATCH] cdrom: rearrange last_media_change check to avoid unintentional overflow

2024-05-07 Thread Phillip Potter
On Tue, May 07, 2024 at 04:54:04AM +, Justin Stitt wrote: > When running syzkaller with the newly reintroduced signed integer wrap > sanitizer we encounter this splat: > > [ 366.015950] UBSAN: signed-integer-overflow in > ../drivers/cdrom/cdrom.c:2361:33 > [ 366.021089] -9223372036854775808

Re: [PATCH 05/12] dmaengine: Add STM32 DMA3 support

2024-05-07 Thread Frank Li
On Tue, May 07, 2024 at 01:33:31PM +0200, Amelie Delaunay wrote: > Hi Vinod, > > Thanks for the review. > > On 5/4/24 14:40, Vinod Koul wrote: > > On 23-04-24, 14:32, Amelie Delaunay wrote: > > > STM32 DMA3 driver supports the 3 hardware configurations of the STM32 DMA3 > > > controller: > > > -

Re: [PATCH net-next 0/2] gve: Minor cleanups

2024-05-07 Thread Shailend Chand
On Fri, May 3, 2024 at 1:31 PM Simon Horman wrote: > > Hi, > > This short patchset provides two minor cleanups for the gve driver. > > These were found by tooling as mentioned in each patch, > and otherwise by inspection. > > No change in run time behaviour is intended. > Each patch is compile tes

Re: [PATCH net-next] netdevice: define and allocate &net_device _properly_

2024-05-07 Thread Eric Dumazet
On Tue, May 7, 2024 at 2:40 PM Alexander Lobakin wrote: > > In fact, this structure contains a flexible array at the end, but > historically its size, alignment etc., is calculated manually. > There are several instances of the structure embedded into other > structures, but also there's ongoing e

Re: [PATCH net-next] netdevice: define and allocate &net_device _properly_

2024-05-07 Thread Jakub Kicinski
On Tue, 7 May 2024 14:39:37 +0200 Alexander Lobakin wrote: > There are several instances of the structure embedded into other > structures, but also there's ongoing effort to remove them and we > could in the meantime declare &net_device properly. Is there a reason you're reposting this before th

[PATCH v2] uapi: stddef.h: Provide UAPI macros for __counted_by_{le, be}

2024-05-07 Thread Erick Archer
This commit can be considered an addition to commit ca7e324e8ad3 ("compiler_types: add Endianness-dependent __counted_by_{le,be}") [1]. In the commit referenced above the __counted_by_{le,be}() attributes were defined based on platform's endianness with the goal to that the structures contain flex

Re: [PATCH net-next 0/2] gve: Minor cleanups

2024-05-07 Thread Larysa Zaremba
On Fri, May 03, 2024 at 09:31:25PM +0100, Simon Horman wrote: > Hi, > > This short patchset provides two minor cleanups for the gve driver. > > These were found by tooling as mentioned in each patch, > and otherwise by inspection. > > No change in run time behaviour is intended. > Each patch is

Re: [RFC PATCH v3 3/5] KVM: x86: Add notifications for Heki policy configuration and violation

2024-05-07 Thread Sean Christopherson
On Tue, May 07, 2024, Mickaël Salaün wrote: > > Actually, potential bad/crazy idea. Why does the _host_ need to define > > policy? > > Linux already knows what assets it wants to (un)protect and when. What's > > missing > > is a way for the guest kernel to effectively deprivilege and re-authent

Re: [PATCH net-next] netdevice: define and allocate &net_device _properly_

2024-05-07 Thread Przemek Kitszel
On 5/7/24 14:39, Alexander Lobakin wrote: In fact, this structure contains a flexible array at the end, but historically its size, alignment etc., is calculated manually. There are several instances of the structure embedded into other structures, but also there's ongoing effort to remove them an

Re: [PATCH] wifi: nl80211: Avoid address calculations via out of bounds array indexing

2024-05-07 Thread Nathan Chancellor
On Tue, May 07, 2024 at 12:46:46PM +0200, Johannes Berg wrote: > On Thu, 2024-04-25 at 11:13 -0700, Nathan Chancellor wrote: > > On Wed, Apr 24, 2024 at 03:01:01PM -0700, Kees Cook wrote: > > > Before request->channels[] can be used, request->n_channels must be set. > > > Additionally, address calc

Re: [PATCH] uapi: stddef.h: Provide UAPI macros for __counted_by_{le, be}

2024-05-07 Thread Alexander Lobakin
From: Erick Archer Date: Mon, 6 May 2024 19:42:08 +0200 > Provide UAPI macros for UAPI structs that will gain annotations for > __counted_by_{le, be} attributes. Pls add me to Cc next time. Why is this change needed? __counted_by_{le, be}() aren't used anywhere in the uAPI headers. > > Signe

[PATCH v2 12/12] arm64: dts: st: add HPDMA nodes on stm32mp251

2024-05-07 Thread Amelie Delaunay
The High Performance Direct Memory Access (HPDMA) controller is used to perform programmable data transfers between memory-mapped peripherals and memories (or between memories) via linked-lists. There are 3 instances of HPDMA on stm32mp251, using stm32-dma3 driver, with 16 channels per instance an

[PATCH v2 11/12] dmaengine: stm32-dma3: defer channel registration to specify channel name

2024-05-07 Thread Amelie Delaunay
On STM32 DMA3, channels can be reserved, so they are non available for Linux. This non-availability creates a mismatch between dma_chan id and DMA3 channel id. Use dma_async_device_channel_register() to register the channels after controller registration and change the default channel name, so tha

[PATCH v2 10/12] dmaengine: add channel device name to channel registration

2024-05-07 Thread Amelie Delaunay
Channel device name is used for sysfs, but also by dmatest filter function. With dynamic channel registration, channels can be registered after dma controller registration. Users may want to have specific channel names. If name is NULL, the channel name relies on previous implementation, dmachan.

[PATCH v2 05/12] dmaengine: Add STM32 DMA3 support

2024-05-07 Thread Amelie Delaunay
STM32 DMA3 driver supports the 3 hardware configurations of the STM32 DMA3 controller: - LPDMA (Low Power): 4 channels, no FIFO - GPDMA (General Purpose): 16 channels, FIFO from 8 to 32 bytes - HPDMA (High Performance): 16 channels, FIFO from 8 to 256 bytes Hardware configuration of the channels is

[PATCH v2 09/12] dmaengine: stm32-dma3: improve residue granularity

2024-05-07 Thread Amelie Delaunay
Implement own device_tx_status ops to compute the residue with a finer granularity, up to bytes. STM32 DMA3 has a bitfield, BNDT, in CxTR1 register which reflects the number of bytes read from the source. It also has a bitfield, FIFOL, in CxSR register which reflects the FIFO level in units of prog

[PATCH v2 06/12] dmaengine: stm32-dma3: add DMA_CYCLIC capability

2024-05-07 Thread Amelie Delaunay
Add DMA_CYCLIC capability and relative device_prep_dma_cyclic ops with stm32_dma3_prep_dma_cyclic(). It reuses stm32_dma3_chan_prep_hw() and stm32_dma3_chan_prep_hwdesc() helpers. Signed-off-by: Amelie Delaunay --- drivers/dma/stm32/stm32-dma3.c | 77 ++ 1 file ch

[PATCH v2 07/12] dmaengine: stm32-dma3: add DMA_MEMCPY capability

2024-05-07 Thread Amelie Delaunay
Add DMA_MEMCPY capability and relative device_prep_dma_memcpy ops with stm32_dma3_prep_dma_memcpy(). It reuses stm32_dma3_chan_prep_hw() and stm32_dma3_prep_hwdesc() helpers. As this driver relies on both device_config and of_xlate ops to pre-configure the channel for transfer, add a new helper (st

[PATCH v2 08/12] dmaengine: stm32-dma3: add device_pause and device_resume ops

2024-05-07 Thread Amelie Delaunay
STM32 DMA3 controller is able to suspend an ongoing transfer (the transfer is suspended after the ongoing burst is flushed to the destination) and resume it from the point it was suspended. No need to reconfigure any register. Signed-off-by: Amelie Delaunay --- drivers/dma/stm32/stm32-dma3.c | 3

[PATCH v2 02/12] dmaengine: stm32: New directory for STM32 DMA controllers drivers

2024-05-07 Thread Amelie Delaunay
Gather the STM32 DMA controllers under drivers/dma/stm32/ Signed-off-by: Amelie Delaunay --- drivers/dma/Kconfig| 34 ++- drivers/dma/Makefile | 4 +-- drivers/dma/stm32/Kconfig | 37 ++ drivers/dma/s

[PATCH v2 04/12] dt-bindings: dma: Document STM32 DMA3 controller bindings

2024-05-07 Thread Amelie Delaunay
The STM32 DMA3 is a Direct Memory Access controller with different features depending on its hardware configuration. The channels have not the same capabilities, some have a larger FIFO, so their performance is higher. This patch describes STM32 DMA3 bindings, used to select a channel that fits cli

[PATCH v2 01/12] dt-bindings: dma: New directory for STM32 DMA controllers bindings

2024-05-07 Thread Amelie Delaunay
Gather the STM32 DMA controllers bindings under ./dma/stm32/. Then fix reference to old path in spi/st,stm32-spi.yaml: update the dmas property description by referring to all STM32 DMA controllers bindings. Signed-off-by: Amelie Delaunay --- v2: - fix reference in spi/st,stm32-spi.yaml with an u

[PATCH v2 00/12] Introduce STM32 DMA3 support

2024-05-07 Thread Amelie Delaunay
STM32 DMA3 is a direct memory access controller with different features depending on its hardware configuration. It is either called LPDMA (Low Power), GPDMA (General Purpose) or HPDMA (High Performance), and it can be found in new STM32 MCUs and MPUs. In STM32MP25 SoC [1], 3 HPDMAs and 1 LPDMA ar

[PATCH v2 03/12] MAINTAINERS: Add entry for STM32 DMA controllers drivers and documentation

2024-05-07 Thread Amelie Delaunay
Add an entry to make myself a maintainer of STM32 DMA controllers drivers and documentation. Signed-off-by: Amelie Delaunay --- MAINTAINERS | 9 + 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index cfc11cc17564..0462e61ea488 100644 --- a/MAINTAINERS +++ b/MAINT

[PATCH net-next] netdevice: define and allocate &net_device _properly_

2024-05-07 Thread Alexander Lobakin
In fact, this structure contains a flexible array at the end, but historically its size, alignment etc., is calculated manually. There are several instances of the structure embedded into other structures, but also there's ongoing effort to remove them and we could in the meantime declare &net_devi

Re: [PATCH 05/12] dmaengine: Add STM32 DMA3 support

2024-05-07 Thread Amelie Delaunay
Hi Christophe, Thanks for the review. On 5/4/24 16:27, Christophe JAILLET wrote: Le 23/04/2024 à 14:32, Amelie Delaunay a écrit : STM32 DMA3 driver supports the 3 hardware configurations of the STM32 DMA3 controller: - LPDMA (Low Power): 4 channels, no FIFO - GPDMA (General Purpose): 16 chann

Re: [PATCH 05/12] dmaengine: Add STM32 DMA3 support

2024-05-07 Thread Amelie Delaunay
Hi Vinod, Thanks for the review. On 5/4/24 14:40, Vinod Koul wrote: On 23-04-24, 14:32, Amelie Delaunay wrote: STM32 DMA3 driver supports the 3 hardware configurations of the STM32 DMA3 controller: - LPDMA (Low Power): 4 channels, no FIFO - GPDMA (General Purpose): 16 channels, FIFO from 8 to

Re: [PATCH] wifi: nl80211: Avoid address calculations via out of bounds array indexing

2024-05-07 Thread Johannes Berg
On Thu, 2024-04-25 at 11:13 -0700, Nathan Chancellor wrote: > On Wed, Apr 24, 2024 at 03:01:01PM -0700, Kees Cook wrote: > > Before request->channels[] can be used, request->n_channels must be set. > > Additionally, address calculations for memory after the "channels" array > > need to be calculate

Re: [PATCH] printk: cleanup deprecated uses of strncpy/strcpy

2024-05-07 Thread Petr Mladek
On Mon 2024-04-29 23:06:54, Justin Stitt wrote: > Cleanup some deprecated uses of strncpy() and strcpy() [1]. > > There doesn't seem to be any bugs with the current code but the > readability of this code could benefit from a quick makeover while > removing some deprecated stuff as a benefit. > >

Re: [RFC PATCH v3 3/5] KVM: x86: Add notifications for Heki policy configuration and violation

2024-05-07 Thread Mickaël Salaün
On Mon, May 06, 2024 at 06:34:53PM GMT, Sean Christopherson wrote: > On Mon, May 06, 2024, Mickaël Salaün wrote: > > On Fri, May 03, 2024 at 07:03:21AM GMT, Sean Christopherson wrote: > > > > --- > > > > > > > > Changes since v1: > > > > * New patch. Making user space aware of Heki properties was

Re: [PATCH v2 2/3] leds: sy7802: Add support for Silergy SY7802 flash LED controller

2024-05-07 Thread Lee Jones
On Sat, 04 May 2024, André Apitzsch wrote: > Am Freitag, dem 03.05.2024 um 08:19 +0100 schrieb Lee Jones: > > On Thu, 11 Apr 2024, Lee Jones wrote: > > > > > On Mon, 01 Apr 2024, André Apitzsch via B4 Relay wrote: > > > > > > > From: André Apitzsch > > > > > > > > Add support for SY7802 flash