Skip to content

Commit ef749c8

Browse files
committed
ALSA: seq: Avoid client data changes during proc reads
The proc read of each client should protect against the concurrent data changes to keep the data consistent; although they are supposed to be safe and won't crash things, it doesn't guarantee the consistency between the read values. Take client->ioctl_mutex for protecting against the concurrent changes. Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent e3cd33a commit ef749c8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sound/core/seq/seq_clientmgr.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2706,6 +2706,7 @@ void snd_seq_info_clients_read(struct snd_info_entry *entry,
27062706
continue;
27072707
}
27082708

2709+
mutex_lock(&client->ioctl_mutex);
27092710
snd_iprintf(buffer, "Client %3d : \"%s\" [%s %s]\n",
27102711
c, client->name,
27112712
client->type == USER_CLIENT ? "User" : "Kernel",
@@ -2723,6 +2724,7 @@ void snd_seq_info_clients_read(struct snd_info_entry *entry,
27232724
snd_iprintf(buffer, " Input pool :\n");
27242725
snd_seq_info_pool(buffer, client->data.user.fifo->pool, " ");
27252726
}
2727+
mutex_unlock(&client->ioctl_mutex);
27262728
snd_seq_client_unlock(client);
27272729
}
27282730
}

0 commit comments

Comments
 (0)