diff options
| author | Miklos Szeredi <[email protected]> | 2021-07-28 12:47:20 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2021-07-28 17:18:00 +0000 |
| commit | cbcf01128d0a92e131bd09f1688fe032480b65ca (patch) | |
| tree | 9671f98e796537f07cac82a38527183d11a6f0c0 /drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | |
| parent | Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma (diff) | |
| download | kernel-cbcf01128d0a92e131bd09f1688fe032480b65ca.tar.gz kernel-cbcf01128d0a92e131bd09f1688fe032480b65ca.zip | |
af_unix: fix garbage collect vs MSG_PEEK
unix_gc() assumes that candidate sockets can never gain an external
reference (i.e. be installed into an fd) while the unix_gc_lock is
held. Except for MSG_PEEK this is guaranteed by modifying inflight
count under the unix_gc_lock.
MSG_PEEK does not touch any variable protected by unix_gc_lock (file
count is not), yet it needs to be serialized with garbage collection.
Do this by locking/unlocking unix_gc_lock:
1) increment file count
2) lock/unlock barrier to make sure incremented file count is visible
to garbage collection
3) install file into fd
This is a lock barrier (unlike smp_mb()) that ensures that garbage
collection is run completely before or completely after the barrier.
Cc: <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Miklos Szeredi <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c')
0 files changed, 0 insertions, 0 deletions
