Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13929632pxu; Mon, 4 Jan 2021 08:13:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJwtzPd/hgmXl4Mcawq2cNCAApnTpFGQdVilI7sLNgKvSCOH+K2tLOO31iKmzY/X8ycmn+ca X-Received: by 2002:a50:f304:: with SMTP id p4mr15626035edm.118.1609776789502; Mon, 04 Jan 2021 08:13:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609776789; cv=none; d=google.com; s=arc-20160816; b=v2aoZCRWzdH2Noh2nGoBhCndU+29n7azVn54LecjJgyuUKUUoX0w03A8fRn0Rp3t3G u9VCtJwT5kNrvt4jCDUGCjkHuP1z5ckNWmuODSzr++bc5dz/PAiXvgK4+fZlev4uBti7 KzqL9onoVrZCZ8u9iS2eKUsB70THymLnGB5aikbS1p0S3hkxABqlLRl2QPpoD0b4AaeB T/9DcwuBtLML5t30S5XCMqcO0zvLwMwUSVZVP2ZqfnRY/xJEImYXD0Nx985M2Z2JlBQG xhUk77K5DTc9MgriNdbj8gm+SvH6JwNGnZz4p7A7mv+4YwJL59JvuZf6gkFZmeQqwR3V oC+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6NoykBUByF0zrj0qNlPvzrOThnpabV5/E+6qm1JKPCg=; b=jVjJCf+1XQ/zIQ+46IA0fywHhdweag8ML3WTkMDDm8maWlhvIviTJluHp+vilEq1LX TiECEc7UGb/kXvJ2e3djgoM5BA9fmEKH+fr9EZp7/4rBJfR6bz9bTEJO2qYweXcY8ocF gFlQDJD/G859RkL4FjQwFTkrSsWBe6wpguKSnnWCyZMfVwOhRAUlTBGsNUUabx/TyUp9 ax7Prnv4PWrjBYB0D4vWTtGmcsvqydFuZT0L8xQV/WUcdDextrTyD9f2ypLW8oxRWIRs bhP+/KY2wy9AGFwZGLl+UYs/RF1ywBqCHGfWqzswR0KJME1QT/Er8OPJDSM5LfQJZHP5 K1LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ffaOhczT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t23si30956637edt.60.2021.01.04.08.12.46; Mon, 04 Jan 2021 08:13:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ffaOhczT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728353AbhADQKW (ORCPT + 99 others); Mon, 4 Jan 2021 11:10:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:37174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728346AbhADQA0 (ORCPT ); Mon, 4 Jan 2021 11:00:26 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E11A621D93; Mon, 4 Jan 2021 16:00:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609776011; bh=6zdH5roabkyv1jqJKZ/W9CjW64Nw+qncqbFDtN5aM6M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ffaOhczTl7PzEvHXGS8/GcB/QV9NJvnxg5rZIiz1YvBSrd0Fun3Y5g5b+7V/dGlnO lTnLb4JGvKKtkAAfF2bFcf3GOD1OAnkRSghqRklo5udU1ictlUKJSAd7dXISKdwWxx xhpDkyKO6opz0MQmotljRCiJyfC9QGJCT+phqebw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+63cbe31877bb80ef58f5@syzkaller.appspotmail.com, Takashi Iwai Subject: [PATCH 5.4 30/47] ALSA: seq: Use bool for snd_seq_queue internal flags Date: Mon, 4 Jan 2021 16:57:29 +0100 Message-Id: <20210104155707.199891282@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210104155705.740576914@linuxfoundation.org> References: <20210104155705.740576914@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Takashi Iwai 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 Signed-off-by: Greg Kroah-Hartman --- sound/core/seq/seq_queue.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/sound/core/seq/seq_queue.h +++ b/sound/core/seq/seq_queue.h @@ -26,10 +26,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 */