lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <170083276888.771401.2511759200122212610.b4-ty@kernel.org>
Date:   Fri, 24 Nov 2023 19:02:48 +0530
From:   Vinod Koul <vkoul@...nel.org>
To:     Maxime Coquelin <mcoquelin.stm32@...il.com>,
        Alexandre Torgue <alexandre.torgue@...s.st.com>,
        Pierre Yves MORDRET <pierre-yves.mordret@...com>,
        M'boumba Cedric Madianga <cedric.madianga@...il.com>,
        Amelie Delaunay <amelie.delaunay@...s.st.com>
Cc:     Arnd Bergmann <arnd@...db.de>, stable@...r.kernel.org,
        kernel test robot <lkp@...el.com>, dmaengine@...r.kernel.org,
        linux-stm32@...md-mailman.stormreply.com,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] dmaengine: stm32-dma: avoid bitfield overflow
 assertion


On Mon, 06 Nov 2023 14:48:32 +0100, Amelie Delaunay wrote:
> stm32_dma_get_burst() returns a negative error for invalid input, which
> gets turned into a large u32 value in stm32_dma_prep_dma_memcpy() that
> in turn triggers an assertion because it does not fit into a two-bit field:
> drivers/dma/stm32-dma.c: In function 'stm32_dma_prep_dma_memcpy':
> include/linux/compiler_types.h:354:38: error: call to '__compiletime_assert_282' declared with attribute error: FIELD_PREP: value too large for the field
>      _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
>                                          ^
>    include/linux/compiler_types.h:335:4: note: in definition of macro '__compiletime_assert'
>        prefix ## suffix();    \
>        ^~~~~~
>    include/linux/compiler_types.h:354:2: note: in expansion of macro '_compiletime_assert'
>      _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
>      ^~~~~~~~~~~~~~~~~~~
>    include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
>     #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
>                                         ^~~~~~~~~~~~~~~~~~
>    include/linux/bitfield.h:68:3: note: in expansion of macro 'BUILD_BUG_ON_MSG'
>       BUILD_BUG_ON_MSG(__builtin_constant_p(_val) ?  \
>       ^~~~~~~~~~~~~~~~
>    include/linux/bitfield.h:114:3: note: in expansion of macro '__BF_FIELD_CHECK'
>       __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \
>       ^~~~~~~~~~~~~~~~
>    drivers/dma/stm32-dma.c:1237:4: note: in expansion of macro 'FIELD_PREP'
>        FIELD_PREP(STM32_DMA_SCR_PBURST_MASK, dma_burst) |
>        ^~~~~~~~~~
> 
> [...]

Applied, thanks!

[1/1] dmaengine: stm32-dma: avoid bitfield overflow assertion
      commit: 54bed6bafa0f38daf9697af50e3aff5ff1354fe1

Best regards,
-- 
~Vinod


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ