linux-stable/drivers/ptp
Edward Adam Davis 1bea2c3e6d ptp: fix corrupted list in ptp_open
There is no lock protection when writing ptp->tsevqs in ptp_open() and
ptp_release(), which can cause data corruption, use spin lock to avoid this
issue.

Moreover, ptp_release() should not be used to release the queue in ptp_read(),
and it should be deleted altogether.

Acked-by: Richard Cochran <richardcochran@gmail.com>
Reported-and-tested-by: syzbot+df3f3ef31f60781fa911@syzkaller.appspotmail.com
Fixes: 8f5de6fb24 ("ptp: support multiple timestamp event readers")
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
Link: https://lore.kernel.org/r/tencent_CD19564FFE8DA8A5918DFE92325D92DD8107@qq.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-11-08 18:47:07 -08:00
..
Kconfig
Makefile
ptp_chardev.c ptp: fix corrupted list in ptp_open 2023-11-08 18:47:07 -08:00
ptp_clock.c ptp: fix corrupted list in ptp_open 2023-11-08 18:47:07 -08:00
ptp_clockmatrix.c
ptp_clockmatrix.h
ptp_dfl_tod.c
ptp_dte.c
ptp_idt82p33.c
ptp_idt82p33.h
ptp_ines.c
ptp_kvm_arm.c
ptp_kvm_common.c
ptp_kvm_x86.c
ptp_mock.c
ptp_ocp.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-10-05 13:16:47 -07:00
ptp_pch.c
ptp_private.h ptp: fix corrupted list in ptp_open 2023-11-08 18:47:07 -08:00
ptp_qoriq.c
ptp_qoriq_debugfs.c
ptp_sysfs.c ptp: support multiple timestamp event readers 2023-10-15 20:07:52 +01:00
ptp_vclock.c
ptp_vmw.c