Skip to content
Commit 1bea2c3e authored by Edward Adam Davis's avatar Edward Adam Davis Committed by Jakub Kicinski
Browse files

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: default avatarRichard Cochran <richardcochran@gmail.com>
Reported-and-tested-by: default avatar <syzbot+df3f3ef31f60781fa911@syzkaller.appspotmail.com>
Fixes: 8f5de6fb

 ("ptp: support multiple timestamp event readers")
Signed-off-by: default avatarEdward Adam Davis <eadavis@qq.com>
Link: https://lore.kernel.org/r/tencent_CD19564FFE8DA8A5918DFE92325D92DD8107@qq.com
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent b714ca2c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment