summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-01-04 19:38:54 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-01-17 11:35:26 +0300
commitd091a2bb8c2e9801875531b6cb14e1df1729045c (patch)
tree059cef40768e450eed52534266759e9ffdb70a89 /arch
parenta9cad56436f43c781239a58c4904dc2c34fe0921 (diff)
downloadlinux-d091a2bb8c2e9801875531b6cb14e1df1729045c.tar.xz
ALSA: aloop: Fix racy hw constraints adjustment
commit 898dfe4687f460ba337a01c11549f87269a13fa2 upstream. The aloop driver tries to update the hw constraints of the connected target on the cable of the opened PCM substream. This is done by adding the extra hw constraints rules referring to the substream runtime->hw fields, while the other substream may update the runtime hw of another side on the fly. This is, however, racy and may result in the inconsistent values when both PCM streams perform the prepare concurrently. One of the reason is that it overwrites the other's runtime->hw field; which is not only racy but also broken when it's called before the open of another side finishes. And, since the reference to runtime->hw isn't protected, the concurrent write may give the partial value update and become inconsistent. This patch is an attempt to fix and clean up: - The prepare doesn't change the runtime->hw of other side any longer, but only update the cable->hw that is referred commonly. - The extra rules refer to the loopback_pcm object instead of the runtime->hw. The actual hw is deduced from cable->hw. - The extra rules take the cable_lock to protect against the race. Fixes: b1c73fc8e697 ("ALSA: snd-aloop: Fix hw_params restrictions and checking") Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
0 files changed, 0 insertions, 0 deletions