a2dp: disallow multiple SetConfiguration to same local SEP
authorPauli Virtanen <pav@iki.fi>
Sun, 5 Jun 2022 12:29:26 +0000 (15:29 +0300)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 15 May 2023 09:25:54 +0000 (14:55 +0530)
commit2a493555367922feab9b39b103410efa19f4f9d8
tree74056f63ff43db92de34ddf7f4a9298ec1b10658
parentebd542a2125a97187890f31a4fb57df57a5774d9
a2dp: disallow multiple SetConfiguration to same local SEP

Using the remote SEP SetConfiguration DBus API, it's possible to make
multiple remote endpoints use the same local SEP, if they are endpoints
from different connected devices. This is invalid: successful
configuration shall prevent a different device configuring the same SEP
(AVDTP v1.3 Sec. 5.3).  Moreover, this breaks the assumption in the
AVDTP code that each SEP has at most a single stream, and causes
misbehavior later on (subsequent transport acquires fail with EPERM).

Fix this by first checking the SEP is free before proceeding in the DBus
API call.  Also add a sanity check in avdtp_set_configuration, to reject
configuring an already configured SEP similarly as in avdtp_setconf_cmd.

Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
profiles/audio/a2dp.c
profiles/audio/avdtp.c