mbox series

[00/21] dmaengine: Annotate with __counted_by

Message ID 20230817235428.never.111-kees@kernel.org
Headers show
Series dmaengine: Annotate with __counted_by | expand

Message

Kees Cook Aug. 17, 2023, 11:58 p.m. UTC
Hi,

This annotates several structures with the coming __counted_by attribute
for bounds checking of flexible arrays at run-time. For more details, see
commit dd06e72e68bc ("Compiler Attributes: Add __counted_by macro").

Thanks!

-Kees

Kees Cook (21):
  dmaengine: apple-admac: Annotate struct admac_data with __counted_by
  dmaengine: at_hdmac: Annotate struct at_desc with __counted_by
  dmaengine: axi-dmac: Annotate struct axi_dmac_desc with __counted_by
  dmaengine: fsl-edma: Annotate struct fsl_edma_desc with __counted_by
  dmaengine: hisilicon: Annotate struct hisi_dma_dev with __counted_by
  dmaengine: moxart-dma: Annotate struct moxart_desc with __counted_by
  dmaengine: qcom: bam_dma: Annotate struct bam_async_desc with
    __counted_by
  dmaengine: sa11x0: Annotate struct sa11x0_dma_desc with __counted_by
  dmaengine: sf-pdma: Annotate struct sf_pdma with __counted_by
  dmaengine: sprd: Annotate struct sprd_dma_dev with __counted_by
  dmaengine: st_fdma: Annotate struct st_fdma_desc with __counted_by
  dmaengine: stm32-dma: Annotate struct stm32_dma_desc with __counted_by
  dmaengine: stm32-mdma: Annotate struct stm32_mdma_desc with
    __counted_by
  dmaengine: stm32-mdma: Annotate struct stm32_mdma_device with
    __counted_by
  dmaengine: tegra: Annotate struct tegra_dma_desc with __counted_by
  dmaengine: tegra210-adma: Annotate struct tegra_adma with __counted_by
  dmaengine: ti: edma: Annotate struct edma_desc with __counted_by
  dmaengine: ti: omap-dma: Annotate struct omap_desc with __counted_by
  dmaengine: uniphier-xdmac: Annotate struct uniphier_xdmac_desc with
    __counted_by
  dmaengine: uniphier-xdmac: Annotate struct uniphier_xdmac_device with
    __counted_by
  dmaengine: usb-dmac: Annotate struct usb_dmac_desc with __counted_by

 drivers/dma/apple-admac.c      |  2 +-
 drivers/dma/at_hdmac.c         |  2 +-
 drivers/dma/dma-axi-dmac.c     |  5 ++---
 drivers/dma/fsl-edma-common.h  |  2 +-
 drivers/dma/hisi_dma.c         |  2 +-
 drivers/dma/moxart-dma.c       |  5 ++---
 drivers/dma/qcom/bam_dma.c     |  2 +-
 drivers/dma/sa11x0-dma.c       |  6 +++---
 drivers/dma/sf-pdma/sf-pdma.h  |  2 +-
 drivers/dma/sh/usb-dmac.c      |  2 +-
 drivers/dma/sprd-dma.c         |  2 +-
 drivers/dma/st_fdma.h          |  2 +-
 drivers/dma/stm32-dma.c        | 11 ++++-------
 drivers/dma/stm32-mdma.c       |  9 ++++-----
 drivers/dma/tegra186-gpc-dma.c |  2 +-
 drivers/dma/tegra210-adma.c    |  2 +-
 drivers/dma/ti/edma.c          |  2 +-
 drivers/dma/ti/omap-dma.c      |  5 ++---
 drivers/dma/uniphier-xdmac.c   |  8 ++++----
 19 files changed, 33 insertions(+), 40 deletions(-)

Comments

Kees Cook Sept. 15, 2023, 8:08 p.m. UTC | #1
Hi,

Just a ping on the series... how do these look to you, Vinod?

If you want I can carry them in my tree. Please let me know.

Thanks!

-Kees

On Thu, Aug 17, 2023 at 04:58:37PM -0700, Kees Cook wrote:
> Hi,
> 
> This annotates several structures with the coming __counted_by attribute
> for bounds checking of flexible arrays at run-time. For more details, see
> commit dd06e72e68bc ("Compiler Attributes: Add __counted_by macro").
> 
> Thanks!
> 
> -Kees
> 
> Kees Cook (21):
>   dmaengine: apple-admac: Annotate struct admac_data with __counted_by
>   dmaengine: at_hdmac: Annotate struct at_desc with __counted_by
>   dmaengine: axi-dmac: Annotate struct axi_dmac_desc with __counted_by
>   dmaengine: fsl-edma: Annotate struct fsl_edma_desc with __counted_by
>   dmaengine: hisilicon: Annotate struct hisi_dma_dev with __counted_by
>   dmaengine: moxart-dma: Annotate struct moxart_desc with __counted_by
>   dmaengine: qcom: bam_dma: Annotate struct bam_async_desc with
>     __counted_by
>   dmaengine: sa11x0: Annotate struct sa11x0_dma_desc with __counted_by
>   dmaengine: sf-pdma: Annotate struct sf_pdma with __counted_by
>   dmaengine: sprd: Annotate struct sprd_dma_dev with __counted_by
>   dmaengine: st_fdma: Annotate struct st_fdma_desc with __counted_by
>   dmaengine: stm32-dma: Annotate struct stm32_dma_desc with __counted_by
>   dmaengine: stm32-mdma: Annotate struct stm32_mdma_desc with
>     __counted_by
>   dmaengine: stm32-mdma: Annotate struct stm32_mdma_device with
>     __counted_by
>   dmaengine: tegra: Annotate struct tegra_dma_desc with __counted_by
>   dmaengine: tegra210-adma: Annotate struct tegra_adma with __counted_by
>   dmaengine: ti: edma: Annotate struct edma_desc with __counted_by
>   dmaengine: ti: omap-dma: Annotate struct omap_desc with __counted_by
>   dmaengine: uniphier-xdmac: Annotate struct uniphier_xdmac_desc with
>     __counted_by
>   dmaengine: uniphier-xdmac: Annotate struct uniphier_xdmac_device with
>     __counted_by
>   dmaengine: usb-dmac: Annotate struct usb_dmac_desc with __counted_by
> 
>  drivers/dma/apple-admac.c      |  2 +-
>  drivers/dma/at_hdmac.c         |  2 +-
>  drivers/dma/dma-axi-dmac.c     |  5 ++---
>  drivers/dma/fsl-edma-common.h  |  2 +-
>  drivers/dma/hisi_dma.c         |  2 +-
>  drivers/dma/moxart-dma.c       |  5 ++---
>  drivers/dma/qcom/bam_dma.c     |  2 +-
>  drivers/dma/sa11x0-dma.c       |  6 +++---
>  drivers/dma/sf-pdma/sf-pdma.h  |  2 +-
>  drivers/dma/sh/usb-dmac.c      |  2 +-
>  drivers/dma/sprd-dma.c         |  2 +-
>  drivers/dma/st_fdma.h          |  2 +-
>  drivers/dma/stm32-dma.c        | 11 ++++-------
>  drivers/dma/stm32-mdma.c       |  9 ++++-----
>  drivers/dma/tegra186-gpc-dma.c |  2 +-
>  drivers/dma/tegra210-adma.c    |  2 +-
>  drivers/dma/ti/edma.c          |  2 +-
>  drivers/dma/ti/omap-dma.c      |  5 ++---
>  drivers/dma/uniphier-xdmac.c   |  8 ++++----
>  19 files changed, 33 insertions(+), 40 deletions(-)
> 
> -- 
> 2.34.1
>
Kees Cook Sept. 22, 2023, 5:16 p.m. UTC | #2
On Fri, Sep 15, 2023 at 01:08:30PM -0700, Kees Cook wrote:
> Just a ping on the series... how do these look to you, Vinod?
> 
> If you want I can carry them in my tree. Please let me know.

I'm now carrying this in my for-next/hardening tree. Let me know if
you'd prefer I drop it.

Thanks!

-Kees
Vinod Koul Sept. 28, 2023, 11:11 a.m. UTC | #3
On 22-09-23, 10:16, Kees Cook wrote:
> On Fri, Sep 15, 2023 at 01:08:30PM -0700, Kees Cook wrote:
> > Just a ping on the series... how do these look to you, Vinod?
> > 
> > If you want I can carry them in my tree. Please let me know.
> 
> I'm now carrying this in my for-next/hardening tree. Let me know if
> you'd prefer I drop it.

Sorry was busy in travel etc, it should be in dmaengine/next tomorrow.
You can drop it

Thanks
Vinod Koul Sept. 28, 2023, 11:56 a.m. UTC | #4
On Thu, 17 Aug 2023 16:58:37 -0700, Kees Cook wrote:
> This annotates several structures with the coming __counted_by attribute
> for bounds checking of flexible arrays at run-time. For more details, see
> commit dd06e72e68bc ("Compiler Attributes: Add __counted_by macro").
> 
> Thanks!
> 
> -Kees
> 
> [...]

Applied, thanks!

[01/21] dmaengine: apple-admac: Annotate struct admac_data with __counted_by
        commit: 83c5d35bf9112577da097c1b4fbfedef93b951e6
[02/21] dmaengine: at_hdmac: Annotate struct at_desc with __counted_by
        commit: 81cd3cb3b3dd37df1fc45c5b6443a07bc2a7fee4
[03/21] dmaengine: axi-dmac: Annotate struct axi_dmac_desc with __counted_by
        commit: f1bc0d01cb349da43d55548b57c915ef8fe024c7
[04/21] dmaengine: fsl-edma: Annotate struct fsl_edma_desc with __counted_by
        (no commit info)
[05/21] dmaengine: hisilicon: Annotate struct hisi_dma_dev with __counted_by
        commit: 7d4b82185521538eab8b0532b9bd7b8c8ca3e63b
[06/21] dmaengine: moxart-dma: Annotate struct moxart_desc with __counted_by
        commit: fd1cb31a037bf8894a710392c2354281c5276d09
[07/21] dmaengine: qcom: bam_dma: Annotate struct bam_async_desc with __counted_by
        commit: b9fe0bd5903140cc3e1ae4e542ae7ff38c90d011
[08/21] dmaengine: sa11x0: Annotate struct sa11x0_dma_desc with __counted_by
        commit: 04b5433b8c0e1b014f081f4bf79767bbc207a7b0
[09/21] dmaengine: sf-pdma: Annotate struct sf_pdma with __counted_by
        commit: 1539a22e144106eefc0ef05e7b91f68ad20a71ad
[10/21] dmaengine: sprd: Annotate struct sprd_dma_dev with __counted_by
        commit: 8360c11aef5775745fc10438e24db95ab2329b1d
[11/21] dmaengine: st_fdma: Annotate struct st_fdma_desc with __counted_by
        commit: 8279f0b476f37c51de2ed8bd70d770b2893dd2fa
[12/21] dmaengine: stm32-dma: Annotate struct stm32_dma_desc with __counted_by
        commit: 195e46df2d996ff4bbf624891b1d3ae8ea9f315d
[13/21] dmaengine: stm32-mdma: Annotate struct stm32_mdma_desc with __counted_by
        commit: 035472170a2a21fc62d8258883a9f566943058b7
[14/21] dmaengine: stm32-mdma: Annotate struct stm32_mdma_device with __counted_by
        commit: 7ba0035dc02ce0c877004dc4052c6d5f873539db
[15/21] dmaengine: tegra: Annotate struct tegra_dma_desc with __counted_by
        commit: 32b5e2d7cd14c80de1fa1cdffcc6ec211b615d82
[16/21] dmaengine: tegra210-adma: Annotate struct tegra_adma with __counted_by
        commit: 15f2c636dde8c4370db87ceabce5cc8325460d77
[17/21] dmaengine: ti: edma: Annotate struct edma_desc with __counted_by
        commit: 5f240e0cdbcb0cc60d6a75ea7d492ce93b7fd52e
[18/21] dmaengine: ti: omap-dma: Annotate struct omap_desc with __counted_by
        commit: b85178611c1156deb3c09e7f8d8cdd662b8df99c
[19/21] dmaengine: uniphier-xdmac: Annotate struct uniphier_xdmac_desc with __counted_by
        commit: 5a67a8f93f02027e4ac8583715d2f4bd2de20e10
[20/21] dmaengine: uniphier-xdmac: Annotate struct uniphier_xdmac_device with __counted_by
        commit: 7935de861aed45f97a4262d9b215d9feb172516b
[21/21] dmaengine: usb-dmac: Annotate struct usb_dmac_desc with __counted_by
        commit: a04bbeaa37d8789de5592506fa776256e784b69c

Best regards,
Kees Cook Sept. 28, 2023, 11:42 p.m. UTC | #5
On Thu, Sep 28, 2023 at 05:26:08PM +0530, Vinod Koul wrote:
> 
> On Thu, 17 Aug 2023 16:58:37 -0700, Kees Cook wrote:
> > This annotates several structures with the coming __counted_by attribute
> > for bounds checking of flexible arrays at run-time. For more details, see
> > commit dd06e72e68bc ("Compiler Attributes: Add __counted_by macro").
> > 
> > Thanks!
> > 
> > -Kees
> > 
> > [...]
> 
> Applied, thanks!

Thanks! I've dropped them from my tree. :)

Also, I found 1 more, which I'll send separately.

-Kees