All of lore.kernel.org
 help / color / mirror / Atom feed
* A data race between snd_seq_oss_midi_open and snd_seq_oss_midi_filemode
@ 2023-05-29 20:11 Gong, Sishuai
  2023-06-05 15:59 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Gong, Sishuai @ 2023-05-29 20:11 UTC (permalink / raw)
  To: tiwai@suse.com; +Cc: alsa-devel@alsa-project.org

Hi there,

We found a data race could happen between snd_seq_oss_midi_open() and
snd_seq_oss_midi_filemode() over the variable mdev->opened.

When running concurrently, snd_seq_oss_midi_open() makes the return
value of snd_seq_oss_midi_filemode() non-deterministic:
Thread-1							Thread-2
//snd_seq_oss_midi_filemode()		//snd_seq_oss_midi_open()
if (mdev->opened & PERM_WRITE)
	mode |= SNDRV_SEQ_OSS_FILE_WRITE;
								mdev->opened |= PERM_READ;
if (mdev->opened & PERM_READ)
	mode |= SNDRV_SEQ_OSS_FILE_READ;

It is not clear to us that whether this is a serious problem but we would like
to report this just in case.

Thanks,
Sishuai

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-06-05 16:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-29 20:11 A data race between snd_seq_oss_midi_open and snd_seq_oss_midi_filemode Gong, Sishuai
2023-06-05 15:59 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.