Commit 3bc293d
spi: tegra210-quad: Protect curr_xfer in tegra_qspi_combined_seq_xfer
[ Upstream commit bf4528a ]
The curr_xfer field is read by the IRQ handler without holding the lock
to check if a transfer is in progress. When clearing curr_xfer in the
combined sequence transfer loop, protect it with the spinlock to prevent
a race with the interrupt handler.
Protect the curr_xfer clearing at the exit path of
tegra_qspi_combined_seq_xfer() with the spinlock to prevent a race
with the interrupt handler that reads this field.
Without this protection, the IRQ handler could read a partially updated
curr_xfer value, leading to NULL pointer dereference or use-after-free.
Fixes: b4e002d ("spi: tegra210-quad: Fix timeout handling")
Signed-off-by: Breno Leitao <leitao@debian.org>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://patch.msgid.link/20260126-tegra_xfer-v2-4-6d2115e4f387@debian.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 2d3c012 commit 3bc293d
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1089 | 1089 | | |
1090 | 1090 | | |
1091 | 1091 | | |
| 1092 | + | |
1092 | 1093 | | |
1093 | 1094 | | |
1094 | 1095 | | |
| |||
1207 | 1208 | | |
1208 | 1209 | | |
1209 | 1210 | | |
| 1211 | + | |
1210 | 1212 | | |
| 1213 | + | |
1211 | 1214 | | |
1212 | 1215 | | |
1213 | 1216 | | |
1214 | 1217 | | |
1215 | 1218 | | |
| 1219 | + | |
1216 | 1220 | | |
| 1221 | + | |
1217 | 1222 | | |
1218 | 1223 | | |
1219 | 1224 | | |
| |||
0 commit comments