Re: [PATCH] spi: mchp-pci1xxxx: Annotate struct pci1xxxx_spi with __counted_by

2023-09-22 Thread Mark Brown
On Fri, 22 Sep 2023 10:53:23 -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 indexi

Re: [PATCH] regulator: mc13xxx: Annotate struct mc13xxx_regulator_priv with __counted_by

2023-09-22 Thread Mark Brown
On Fri, 22 Sep 2023 10:54:02 -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 indexi

Re: [PATCH][next] ASoC: SOF: ipc4-topology: Use size_add() in call to struct_size()

2023-10-01 Thread Mark Brown
On Fri, Sep 29, 2023 at 12:14:59PM -0700, Kees Cook wrote: > On Fri, 15 Sep 2023 13:09:11 -0600, Gustavo A. R. Silva wrote: > > If, for any reason, the open-coded arithmetic causes a wraparound, > > the protection that `struct_size()` adds against potential integer > > overflows is defeated. Fix t

Re: [PATCH][next] ASoC: SOF: ipc4-topology: Use size_add() in call to struct_size()

2023-10-02 Thread Mark Brown
On Sun, Oct 01, 2023 at 01:37:04PM -0700, Kees Cook wrote: > On Sun, Oct 01, 2023 at 11:25:59AM +0100, Mark Brown wrote: > > Why is this bypassing the ASoC tree? > Hi! Sorry, I can drop it if you want to take it? I tend to collect trivial > hardening changes with reviews th

Re: [PATCH][next] ASoC: SOF: ipc4-topology: Use size_add() in call to struct_size()

2023-10-02 Thread Mark Brown
On Fri, 15 Sep 2023 13:09:11 -0600, Gustavo A. R. Silva wrote: > If, for any reason, the open-coded arithmetic causes a wraparound, > the protection that `struct_size()` adds against potential integer > overflows is defeated. Fix this by hardening call to `struct_size()` > with `size_add()`. > >

Re: [PATCH] ASoC: soc-dapm: Annotate struct snd_soc_dapm_widget_list with __counted_by

2023-10-04 Thread Mark Brown
On Tue, 03 Oct 2023 16:28:53 -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 C

Re: [PATCH] MAINTAINERS: Include additional ASoC paths

2023-10-04 Thread Mark Brown
On Wed, Oct 04, 2023 at 12:34:45PM -0700, Kees Cook wrote: > +++ b/MAINTAINERS > @@ -20116,6 +20116,8 @@ F:Documentation/devicetree/bindings/sound/ > F: Documentation/sound/soc/ > F: include/dt-bindings/sound/ > F: include/sound/soc* > +F: include/sound/sof/ > +F: include/uapi/sou

Re: [PATCH] MAINTAINERS: Include additional ASoC paths

2023-10-04 Thread Mark Brown
On Wed, Oct 04, 2023 at 12:41:14PM -0700, Kees Cook wrote: > >The SOF header is also missing from the entry for SOF. > Ah, right! Can you take this and tweak it with the missing entries, or should > I send a v2? Could you send an incremental patch please? It's already in my CI as is. signatu

Re: [PATCH] MAINTAINERS: Include additional ASoC paths

2023-10-06 Thread Mark Brown
On Wed, 04 Oct 2023 12:34:45 -0700, Kees Cook wrote: > Make sure a few other paths are correctly sent to the ASoC maintainers. > > Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next Thanks! [1/1] MAINTAINERS: Include additional ASoC paths commit: 21

Re: [PATCH] MAINTAINERS: Include sof headers under ASoC

2023-10-06 Thread Mark Brown
On Wed, 04 Oct 2023 19:56:21 -0700, Kees Cook wrote: > Add missing sof header files for ASoC. > > Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next Thanks! [1/1] MAINTAINERS: Include sof headers under ASoC commit: 4b226f15421d160cc07ff497179547f559

Re: [PATCH] ASoC: apple: mca: Annotate struct mca_data with __counted_by

2023-10-06 Thread Mark Brown
On Fri, Oct 06, 2023 at 01:22:55PM -0700, Kees Cook wrote: > On Fri, Sep 22, 2023 at 10:50:50AM -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 bound

Re: [PATCH] regulator: da9063: Annotate struct da9063_regulators with __counted_by

2023-10-06 Thread Mark Brown
On Fri, Oct 06, 2023 at 01:40:08PM -0700, Kees Cook wrote: > On Fri, Sep 22, 2023 at 10:52:07AM -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 bound

Re: [PATCH] regulator: da9062: Annotate struct da9062_regulators with __counted_by

2023-10-09 Thread Mark Brown
On Fri, 22 Sep 2023 10:53:31 -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 indexi

Re: [PATCH] ASoC: apple: mca: Annotate struct mca_data with __counted_by

2023-10-09 Thread Mark Brown
On Mon, Oct 09, 2023 at 10:17:33AM -0700, Kees Cook wrote: > On Fri, Oct 06, 2023 at 09:53:49PM +0100, Mark Brown wrote: > > Please don't send content free pings and please allow a reasonable time > > for review. People get busy, go on holiday, attend conferences and so &g

Re: [PATCH] ASoC: apple: mca: Annotate struct mca_data with __counted_by

2023-10-11 Thread Mark Brown
On Fri, 22 Sep 2023 10:50:50 -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 indexi

Re: [PATCH] regulator: da9063: Annotate struct da9063_regulators with __counted_by

2023-10-11 Thread Mark Brown
On Fri, 22 Sep 2023 10:52: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 checking via CONFIG_UBSAN_BOUNDS > (for array indexi

Re: [PATCH][next] ASoC: sigmadsp: Add __counted_by for struct sigmadsp_data and use struct_size()

2023-10-16 Thread Mark Brown
On Mon, 09 Oct 2023 15:24:23 -0600, Gustavo A. R. Silva 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 index

Re: [PATCH v7 06/10] ASoC: pxa: Suppress SSPA on ARM64

2023-11-02 Thread Mark Brown
On Thu, Nov 02, 2023 at 04:20:29PM +0100, Duje Mihanović wrote: > The SSPA driver currently seems to generate ARM32 assembly, which causes > build errors when building a kernel for an ARM64 ARCH_MMP platform. > > Fixes: fa375d42f0e5 ("ASoC: mmp: add sspa support") > Reported-by: kernel test robot

Re: [PATCH v7 06/10] ASoC: pxa: Suppress SSPA on ARM64

2023-11-06 Thread Mark Brown
On Fri, Nov 03, 2023 at 05:58:05PM +0100, Duje Mihanović wrote: > I just looked at it again and it looks like no code in sound/soc/pxa/* or > sound/arm/pxa* depends on AACI in any way. Therefore, I believe that to fix > this correctly, I would have to remove "select SND_ARM" from sound/soc/pxa/

Re: [PATCH v7 06/10] ASoC: pxa: Suppress SSPA on ARM64

2023-11-11 Thread Mark Brown
On Fri, Nov 10, 2023 at 08:28:56PM +0100, Duje Mihanović wrote: > On Monday, November 6, 2023 11:58:46 AM CET Mark Brown wrote: > > On Fri, Nov 03, 2023 at 05:58:05PM +0100, Duje Mihanović wrote: > > > this correctly, I would have to remove "select SND_ARM" from sou

Re: [RFC PATCH 3/3] lsm: consolidate buffer size handling into lsm_fill_user_ctx()

2023-12-21 Thread Mark Brown
On Thu, Dec 21, 2023 at 10:21:04AM -0500, Paul Moore wrote: > On Thu, Dec 21, 2023 at 8:01 AM Mark Brown wrote: > > On Wed, Dec 20, 2023 at 08:40:24PM -0500, Paul Moore wrote: > > > Suggestions on how to annotate the struct, or the code doing the > > > memcpy() are w

[PATCH] lsm: Add a __counted_by() annotation to lsm_ctx.ctx

2023-12-21 Thread Mark Brown
The ctx in struct lsm_ctx is an array of size ctx_len, tell the compiler about this using __counted_by() where supported to improve the ability to detect overflow issues. Reported-by: Aishwarya TCV Signed-off-by: Mark Brown --- include/uapi/linux/lsm.h | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v2] lsm: Add a __counted_by() annotation to lsm_ctx.ctx

2023-12-22 Thread Mark Brown
The ctx in struct lsm_ctx is an array of size ctx_len, tell the compiler about this using __counted_by() where supported to improve the ability to detect overflow issues. Reported-by: Aishwarya TCV Signed-off-by: Mark Brown --- Changes in v2: - Add explicit stddef.h inclusion in case

Re: [PATCH v2 3/3] ARM: dts: aspeed: System1: IBM system1 BMC board

2024-01-08 Thread Mark Brown
On Mon, Jan 08, 2024 at 02:41:14PM -0600, Ninad Palsule wrote: > + regulator@60 { > + compatible = "maxim,max8952"; > + reg = <0x60>; > + > + max8952,default-mode = <0>; > + max8952,dvs-mode-microvolt = <125>, <120>, > +

Re: [PATCH] ARM: unwind: Add missing "Call trace:" line

2024-01-11 Thread Mark Brown
n CPU Oops nor things > like KASAN, UBSAN, etc that called dump_stack(). Regularize this line > so CI systems and other things (like LKDTM) that depend on parsing > "Call trace:" out of dmesg will see it for ARM. Reviewed-by: Mark Brown signature.asc Description: PGP signature

Re: [PATCH v2] ASoC: ti: j721e-evm: Use devm_kcalloc() instead of devm_kzalloc()

2024-01-22 Thread Mark Brown
On Tue, 09 Jan 2024 19:11:01 +0100, Erick Archer wrote: > Use 2-factor multiplication argument form devm_kcalloc() instead > of devm_kzalloc(). > > Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next Thanks! [1/1] ASoC: ti: j721e-evm: Use devm_kcalloc() in

Re: [PATCH] ASoC: qcom: Use devm_kcalloc() instead of devm_kzalloc()

2024-01-22 Thread Mark Brown
On Sat, 06 Jan 2024 18:16:35 +0100, Erick Archer wrote: > Use 2-factor multiplication argument form devm_kcalloc() instead > of devm_kzalloc(). > > Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next Thanks! [1/1] ASoC: qcom: Use devm_kcalloc() instead of

Re: [PATCH] ARM: fault: Implement copy_from_kernel_nofault_allowed()

2024-01-23 Thread Mark Brown
s. Make sure copy_from_kernel_nofault() does not attempt this > any more. This appears to fix the original issue: https://lava.sirena.org.uk/scheduler/job/497571 (though so did your earlier patch) so: Tested-by: Mark Brown signature.asc Description: PGP signature

Re: (subset) [PATCH 0/7] Xperia 1 V support

2024-02-13 Thread Mark Brown
On Mon, 12 Feb 2024 14:10:08 +0100, Konrad Dybcio wrote: > DTS for the phone and some fly-by fixes > > Patch 1 for Mark/sound > Rest for qcom > > Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next Thanks! [1/7] dt-bindings: ASoC: cs35l45: Add interrupts

Re: [PATCH v4 6/8] spi: Use new helpers from overflow.h in __spi_alloc_controller()

2024-02-28 Thread Mark Brown
On Wed, Feb 28, 2024 at 10:41:36PM +0200, Andy Shevchenko wrote: > We have two new helpers struct_size_with_data() and struct_data_pointer() > that we can utilize in __spi_alloc_controller(). Do it so. Acked-by: Mark Brown signature.asc Description: PGP signature

Re: [PATCH v2 0/3] spi: axi-spi-engine: small cleanups

2024-03-05 Thread Mark Brown
On Mon, 04 Mar 2024 10:04:22 -0600, David Lechner wrote: > This series contains a few small cleanups to the axi-spi-engine driver, > mostly suggested from previous reviews. > Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next Thanks! [1/3] spi: axi-spi-engin

Re: [PATCH v3 1/2] string: Convert selftest to KUnit

2024-03-12 Thread Mark Brown
eported for the > memset() tests: Reviewed-by: Mark Brown signature.asc Description: PGP signature

Re: [PATCH v3 2/2] string: Convert helpers selftest to KUnit

2024-03-12 Thread Mark Brown
pper/lower > testing looks like this: Reviewed-by: Mark Brown signature.asc Description: PGP signature

Re: [PATCH][next] ASoC: SOF: sof-audio: Avoid -Wflex-array-member-not-at-end warnings

2024-08-08 Thread Mark Brown
On Mon, 05 Aug 2024 09:28:55 -0600, Gustavo A. R. Silva wrote: > -Wflex-array-member-not-at-end was introduced in GCC-14, and we are > getting ready to enable it, globally. > > Move the conflicting declaration to the end of the structure. Notice > that `struct snd_sof_pcm` ends in a flexible-array

Re: [PATCH v3 4/5] selftests/mseal: add more tests for mmap

2024-10-18 Thread Mark Brown
On Fri, Oct 18, 2024 at 12:32:37PM -0700, Jeff Xu wrote: > On Fri, Oct 18, 2024 at 11:37 AM Mark Brown wrote: > > On Fri, Oct 18, 2024 at 11:06:20AM -0700, Jeff Xu wrote: > > Test 106 here is called "test_munmap_free_multiple_ranges_with_split: > > line:2573" which

Re: [PATCH v3 4/5] selftests/mseal: add more tests for mmap

2024-10-18 Thread Mark Brown
On Thu, Oct 17, 2024 at 12:49:40PM -0700, Jeff Xu wrote: > So it is not a problem with the MACRO, but where is it used ? > ret = sys_mseal(ptr, size); > FAIL_TEST_IF_FALSE(!ret); > Take this example, it would be > assert(!ret) The problem is that the macro name is confusing and

Re: [PATCH v3 4/5] selftests/mseal: add more tests for mmap

2024-10-18 Thread Mark Brown
On Fri, Oct 18, 2024 at 11:06:20AM -0700, Jeff Xu wrote: > On Fri, Oct 18, 2024 at 6:04 AM Mark Brown wrote: > > The problem is that the macro name is confusing and not terribly > > consistent with how the rest of the selftests work. The standard > > kselftes

Re: [PATCH v3 4/5] selftests/mseal: add more tests for mmap

2024-10-21 Thread Mark Brown
On Fri, Oct 18, 2024 at 05:10:01PM -0700, Jeff Xu wrote: > On Fri, Oct 18, 2024 at 2:05 PM Mark Brown wrote: > > That's not the entire issue - it is also a problem that the test name > > is not the same between passes and failures so automated systems can't > >

Re: [PATCH] ASoC: dapm: fix bounds checker error in dapm_widget_list_create

2024-10-29 Thread Mark Brown
On Tue, Oct 29, 2024 at 01:37:05PM +, Aleksei Vetrov wrote: > Sent v2. That doesn't seem to have shown up here? signature.asc Description: PGP signature

Re: [PATCH] ASoC: dapm: fix bounds checker error in dapm_widget_list_create

2024-10-29 Thread Mark Brown
On Mon, 28 Oct 2024 22:50:30 +, Aleksei Vetrov wrote: > The widgets array in the snd_soc_dapm_widget_list has a __counted_by > attribute attached to it, which points to the num_widgets variable. This > attribute is used in bounds checking, and if it is not set before the > array is filled, then

Re: [PATCH] ASoC: dapm: fix bounds checker error in dapm_widget_list_create

2024-10-29 Thread Mark Brown
On Tue, Oct 29, 2024 at 03:14:53PM +, Aleksei Vetrov wrote: > On Tue, Oct 29, 2024 at 02:08:32PM +0000, Mark Brown wrote: > > For this fix I couldn't send v2, because it has been already applied by > > Mark Brown. Guess I would need to send a separate message to the st

Re: [PATCH v3 4/5] selftests/mseal: add more tests for mmap

2024-09-18 Thread Mark Brown
On Fri, Sep 13, 2024 at 03:50:00PM -0700, Jeff Xu wrote: > Even though the number of lines is large in these patches, its main > intention is to test Pedro's in-place change (from can_modify_mm to > can_modify_vma). Before this patch, the test had a common pattern: > setup memory layout, seal the

Re: [PATCH] ASoC: Intel: sof_sdw: initialize ret in asoc_sdw_rt_amp_spk_rtd_init()

2025-02-11 Thread Mark Brown
On Mon, Feb 10, 2025 at 11:08:27PM -0500, Ethan Carter Edwards wrote: > There is a possibility for an uninitialized *ret* variable to be > returned in some code paths. > > Setting to 0 prevents a random value from being returned. That'll shut up the warning but is the warning trying to tell us th

Re: [PATCH v2?] ASoC: q6dsp: q6apm: replace kzalloc() with kcalloc() in q6apm_map_memory_regions()

2025-02-24 Thread Mark Brown
On Sun, Feb 23, 2025 at 10:50:08AM +0100, Markus Elfring wrote: > … > > We are trying to get rid of all multiplications from allocation > > functions to prevent integer overflows[1]. … > > Is an imperative wording more desirable for such a change description? > https://git.kernel.org/pub/scm/linux

Re: [PATCH] ASoC: q6dsp: q6apm: replace kzalloc() with kcalloc() in q6apm_map_memory_regions()

2025-02-25 Thread Mark Brown
On Sat, 22 Feb 2025 14:55:20 -0500, Ethan Carter Edwards wrote: > We are trying to get rid of all multiplications from allocation > functions to prevent integer overflows[1]. Here the multiplication is > obviously safe, but using kcalloc() is more appropriate and improves > readability. This patch