All of lore.kernel.org
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Fei Shao <fshao@chromium.org>, Mark Brown <broonie@kernel.org>
Cc: Daniel Kurtz <djkurtz@chromium.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	linux-spi@vger.kernel.org
Subject: Re: [PATCH v2 1/2] spi: spi-mt65xx: Fix NULL pointer access in interrupt handler
Date: Thu, 21 Mar 2024 09:58:43 +0100	[thread overview]
Message-ID: <bf15d64c-79b4-4414-afdc-56a3050b93ae@collabora.com> (raw)
In-Reply-To: <20240321070942.1587146-2-fshao@chromium.org>

Il 21/03/24 08:08, Fei Shao ha scritto:
> The TX buffer in spi_transfer can be a NULL pointer, so the interrupt
> handler may end up writing to the invalid memory and cause crashes.
> 
> Add a check to trans->tx_buf before using it.
> 
> Fixes: 1ce24864bff4 ("spi: mediatek: Only do dma for 4-byte aligned buffers")
> Signed-off-by: Fei Shao <fshao@chromium.org>

Honestly, the code in the !host->can_dma conditional is probably a good candidate
for just going into its own function, as it is effectively an alternative flow for
the ISR (fifo vs dma xceiv) but whatever, as long as it doesn't get any "longer",
it's still fine I guess.... so:

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>


WARNING: multiple messages have this Message-ID (diff)
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Fei Shao <fshao@chromium.org>, Mark Brown <broonie@kernel.org>
Cc: Daniel Kurtz <djkurtz@chromium.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	linux-spi@vger.kernel.org
Subject: Re: [PATCH v2 1/2] spi: spi-mt65xx: Fix NULL pointer access in interrupt handler
Date: Thu, 21 Mar 2024 09:58:43 +0100	[thread overview]
Message-ID: <bf15d64c-79b4-4414-afdc-56a3050b93ae@collabora.com> (raw)
In-Reply-To: <20240321070942.1587146-2-fshao@chromium.org>

Il 21/03/24 08:08, Fei Shao ha scritto:
> The TX buffer in spi_transfer can be a NULL pointer, so the interrupt
> handler may end up writing to the invalid memory and cause crashes.
> 
> Add a check to trans->tx_buf before using it.
> 
> Fixes: 1ce24864bff4 ("spi: mediatek: Only do dma for 4-byte aligned buffers")
> Signed-off-by: Fei Shao <fshao@chromium.org>

Honestly, the code in the !host->can_dma conditional is probably a good candidate
for just going into its own function, as it is effectively an alternative flow for
the ISR (fifo vs dma xceiv) but whatever, as long as it doesn't get any "longer",
it's still fine I guess.... so:

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2024-03-21  8:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21  7:08 [PATCH v2 0/2] Fixes NULL pointer access in spi-mt65xx.c Fei Shao
2024-03-21  7:08 ` Fei Shao
2024-03-21  7:08 ` Fei Shao
2024-03-21  7:08 ` [PATCH v2 1/2] spi: spi-mt65xx: Fix NULL pointer access in interrupt handler Fei Shao
2024-03-21  7:08   ` Fei Shao
2024-03-21  7:08   ` Fei Shao
2024-03-21  8:58   ` AngeloGioacchino Del Regno [this message]
2024-03-21  8:58     ` AngeloGioacchino Del Regno
2024-03-21  7:08 ` [PATCH v2 2/2] spi: spi-mt65xx: Rename a variable " Fei Shao
2024-03-21  7:08   ` Fei Shao
2024-03-21  7:08   ` Fei Shao
2024-03-21  8:58   ` AngeloGioacchino Del Regno
2024-03-21  8:58     ` AngeloGioacchino Del Regno
2024-03-21 15:01 ` [PATCH v2 0/2] Fixes NULL pointer access in spi-mt65xx.c Mark Brown
2024-03-21 15:01   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bf15d64c-79b4-4414-afdc-56a3050b93ae@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=broonie@kernel.org \
    --cc=djkurtz@chromium.org \
    --cc=fshao@chromium.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.