[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <159249892720.8894.3932380546197111188.b4-ty@kernel.org>
Date: Thu, 18 Jun 2020 17:48:47 +0100
From: Mark Brown <broonie@...nel.org>
To: linux-kernel@...r.kernel.org,
Zhenzhong Duan <zhenzhong.duan@...il.com>
Cc: linux-spi@...r.kernel.org
Subject: Re: [PATCH 1/2] spi: spidev: fix a race between spidev_release and spidev_remove
On Thu, 18 Jun 2020 11:21:24 +0800, Zhenzhong Duan wrote:
> Imagine below scene, spidev is referenced after it's freed.
>
> spidev_release() spidev_remove()
> ...
> spin_lock_irq(&spidev->spi_lock);
> spidev->spi = NULL;
> spin_unlock_irq(&spidev->spi_lock);
> mutex_lock(&device_list_lock);
> dofree = (spidev->spi == NULL);
> if (dofree)
> kfree(spidev);
> mutex_unlock(&device_list_lock);
> mutex_lock(&device_list_lock);
> list_del(&spidev->device_entry);
> device_destroy(spidev_class, spidev->devt);
> clear_bit(MINOR(spidev->devt), minors);
> if (spidev->users == 0)
> kfree(spidev);
> mutex_unlock(&device_list_lock);
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/2] spi: spidev: fix a race between spidev_release and spidev_remove
commit: abd42781c3d2155868821f1b947ae45bbc33330d
[2/2] spi: spidev: fix a potential use-after-free in spidev_release()
commit: 06096cc6c5a84ced929634b0d79376b94c65a4bd
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
Powered by blists - more mailing lists