Skip to content

Commit 927a003

Browse files
Norman BintangChromeos LUCI
Norman Bintang
authored and
Chromeos LUCI
committed
adhd: Restrict client from creating sidetone streams
Restrict client from creating sidetone streams. Sidetone streams should only be created by sending a D-Bus message to the server. Now it's causing the rclient_message fuzz to fail because the client only creates a single input/output stream, where for sidetone, it expects to have a pair of input and output stream. BUG=b:346963849 BUG=b:328145742 TEST=run fuzzer test case TEST=tast run ${DUT} audio.CrasSidetone Change-Id: I70fee530907ea2d0e54e1adee8c1ad946393c315 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/5632936 Commit-Queue: Norman Bintang <[email protected]> Tested-by: [email protected] <[email protected]> Tested-by: Norman Bintang <[email protected]> Reviewed-by: Li-Yu Yu <[email protected]>
1 parent 7ab455b commit 927a003

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cras/src/server/cras_rclient_util.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ int rclient_handle_client_stream_connect(struct cras_rclient* client,
177177
if (client->client_type != CRAS_CLIENT_TYPE_UNKNOWN) {
178178
stream_config.client_type = client->client_type;
179179
}
180+
if ((stream_config.flags & SIDETONE_STREAM) == SIDETONE_STREAM) {
181+
syslog(LOG_ERR, "Creating a sidetone stream from a client is not allowed");
182+
rc = -EINVAL;
183+
goto cleanup_config;
184+
}
180185
rc = stream_list_add(cras_iodev_list_get_stream_list(), &stream_config,
181186
&stream);
182187
if (rc) {

0 commit comments

Comments
 (0)