ALSA: rawmidi: Avoid bit fields for state flags
authorTakashi Iwai <tiwai@suse.de>
Fri, 14 Feb 2020 11:13:16 +0000 (12:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Feb 2020 15:38:59 +0000 (16:38 +0100)
commit63495d1e1c7c4c6333359ce831ab865859c2d87d
treee65e224530f7e400cee7d9f2fbe418a63e0f39a3
parentbf3043d27755a8cb53cb99e4f04139a5279761e0
ALSA: rawmidi: Avoid bit fields for state flags

commit dfa9a5efe8b932a84b3b319250aa3ac60c20f876 upstream.

The rawmidi state flags (opened, append, active_sensing) are stored in
bit fields that can be potentially racy when concurrently accessed
without any locks.  Although the current code should be fine, there is
also no any real benefit by keeping the bitfields for this kind of
short number of members.

This patch changes those bit fields flags to the simple bool fields.
There should be no size increase of the snd_rawmidi_substream by this
change.

Reported-by: syzbot+576cc007eb9f2c968200@syzkaller.appspotmail.com
Link: https://lore.kernel.org/r/20200214111316.26939-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/sound/rawmidi.h