Skip to content
This repository has been archived by the owner on May 28, 2021. It is now read-only.

Commit

Permalink
ALSA: seq: Use bool for snd_seq_queue internal flags
Browse files Browse the repository at this point in the history
commit 4ebd47037027c4beae99680bff3b20fdee5d7c1e upstream.

The snd_seq_queue struct contains various flags in the bit fields.
Those are categorized to two different use cases, both of which are
protected by different spinlocks.  That implies that there are still
potential risks of the bad operations for bit fields by concurrent
accesses.

For addressing the problem, this patch rearranges those flags to be
a standard bool instead of a bit field.

Reported-by: syzbot+63cbe31877bb80ef58f5@syzkaller.appspotmail.com
Link: https://lore.kernel.org/r/20201206083456.21110-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
tiwai authored and gregkh committed Jan 9, 2021
1 parent a51a49b commit c1fcb6d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sound/core/seq/seq_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ struct snd_seq_queue {

struct snd_seq_timer *timer; /* time keeper for this queue */
int owner; /* client that 'owns' the timer */
unsigned int locked:1, /* timer is only accesibble by owner if set */
klocked:1, /* kernel lock (after START) */
check_again:1,
check_blocked:1;
bool locked; /* timer is only accesibble by owner if set */
bool klocked; /* kernel lock (after START) */
bool check_again; /* concurrent access happened during check */
bool check_blocked; /* queue being checked */

unsigned int flags; /* status flags */
unsigned int info_flags; /* info for sync */
Expand Down

0 comments on commit c1fcb6d

Please sign in to comment.