A data race between snd_seq_oss_midi_open and snd_seq_oss_midi_filemode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux