]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: seq: Fix race of get-subscription call vs port-delete ioctls
authorTakashi Iwai <tiwai@suse.de>
Tue, 9 Apr 2019 16:04:17 +0000 (18:04 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 9 Apr 2019 16:54:13 +0000 (18:54 +0200)
commit7f1f054e910a39621485e091a0d7a37ad86a5d7d
tree13103ccf8a6c0f07e9200403fcd26a30b30200c6
parent006e3de29ed83c7026d914fdafe19df70bb2ad46
ALSA: seq: Fix race of get-subscription call vs port-delete ioctls

The snd_seq_ioctl_get_subscription() retrieves the port subscriber
information as a pointer, while the object isn't protected, hence it
may be deleted before the actual reference.  This race was spotted by
syzkaller and may lead to a UAF.

The fix is simply copying the data in the lookup function that
performs in the rwsem to protect against the deletion.

Reported-by: syzbot+9437020c82413d00222d@syzkaller.appspotmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/seq/seq_clientmgr.c
sound/core/seq/seq_ports.c
sound/core/seq/seq_ports.h