summaryrefslogtreecommitdiffstats
path: root/Documentation/trace
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2022-03-11 13:24:36 +0000
committerLinus Torvalds <torvalds@linux-foundation.org>2022-03-11 10:17:13 -0800
commit2ed147f015af2b48f41c6f0b6746aa9ea85c19f3 (patch)
tree9274d9f2ec7e074fa4a2fb9ab4696ee82f9bd853 /Documentation/trace
parent7ea1a0124b6da246b5bc8c66cddaafd36acf3ecb (diff)
downloadlinux-2ed147f015af2b48f41c6f0b6746aa9ea85c19f3.tar.bz2
watch_queue: Fix lack of barrier/sync/lock between post and read
There's nothing to synchronise post_one_notification() versus pipe_read(). Whilst posting is done under pipe->rd_wait.lock, the reader only takes pipe->mutex which cannot bar notification posting as that may need to be made from contexts that cannot sleep. Fix this by setting pipe->head with a barrier in post_one_notification() and reading pipe->head with a barrier in pipe_read(). If that's not sufficient, the rd_wait.lock will need to be taken, possibly in a ->confirm() op so that it only applies to notifications. The lock would, however, have to be dropped before copy_page_to_iter() is invoked. Fixes: c73be61cede5 ("pipe: Add general notification queue support") Reported-by: Jann Horn <jannh@google.com> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/trace')
0 files changed, 0 insertions, 0 deletions