Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp348731pxu; Thu, 7 Jan 2021 06:40:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJwIsmrXlYRmLGt1h+/1ol4N9WQ103WW/VvS1G4bzD9FgqQZ/ZjgjXvOOtalcHKfLenAD07X X-Received: by 2002:a17:906:4ec7:: with SMTP id i7mr6750426ejv.252.1610030415009; Thu, 07 Jan 2021 06:40:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610030415; cv=none; d=google.com; s=arc-20160816; b=mI/jIs3MhFWik+fkilqde1USvOzIePIDCCSlAFXFd7hYLjUj3ViTJ3wrMVihUUel+V sRObGaN4gvUaREAIXOlUDUefWw3O6PYw3/Ci/w+7pDszjRRZL/XMV+q1x+V7P9sUFiXd Trhr8BQQMbSNo02CrdnIqx2PAkz09quc3HpIraSGZSP6aJlizX909QcqrVRNYmFt2Rf8 z9BZ6UjU6C9wuVO6JdJZenWd9T7SavzqzuG/pzWeYnT5HZjlCqqaddKrtCF+Qs0ac7qd rJTJMKBudPI+muDLI1E4uNM5hu3jYUDqBI/eQYbA1M2QwsHbEaKg/cQhKO0Sn9Vhxm7J 1PzA== 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=nnpa8Ogffk4K8gvuzX8Kdh5dmuJ4X4zLmGvUWNmr9PU=; b=VkvqgdYy6M97KKI7xg1KqBfg2XCOnTcFDLzzfQldr/DuR91NwmMEChFOebSOA8dtox LO4PtqrO+GwgJuOzF4nFqjja/+KpH+oQLRPeP05VkqlEgIc/+O2MBykCA1tieXgYzsjq brT5Km4qKPl1J5oDFqNFFcgBChQWV8h/1QQjjuKueBhprfd7NvH3fxkezZs/7fQA5Uo1 fQb6nr61VEhRHRADuRvzR+ChO+VT7KtBeqB0/AmYe1+Hf5cF1dUuuMcJuKpT2gHIea6X f/C0L6F1XhHIcd30hxTJOt7eRGDd8WqGU7xyfTQsx0dumbVoDYbmhDpq+5aGmj5o+ql3 5E9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BJoXpboa; 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 h1si2415772edj.73.2021.01.07.06.39.51; Thu, 07 Jan 2021 06:40:14 -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=BJoXpboa; 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 S1729045AbhAGObw (ORCPT + 99 others); Thu, 7 Jan 2021 09:31:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:45880 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729019AbhAGObu (ORCPT ); Thu, 7 Jan 2021 09:31:50 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 438F923380; Thu, 7 Jan 2021 14:30:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610029851; bh=0q8qmvE5+73hTUDZwLg/Tgkq28+KghNjI0B15Ui87Mw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BJoXpboaMYcQGjHivhGw/BtvjQEv/o7acWFJYwxGff0sRXMqyecbYYZpZfdWPnuax zQ/GfuZQznFIzjIwMP8yeU/Iv1vHsIsoPUzM+REyEy/5Sho+KI+u5cMCQRXB44qIFi GUtMLvWs63cq1jXYxbLlpPvGOcXm00iUgjVQl78E= 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 4.14 18/29] ALSA: seq: Use bool for snd_seq_queue internal flags Date: Thu, 7 Jan 2021 15:31:33 +0100 Message-Id: <20210107143055.476091798@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210107143052.973437064@linuxfoundation.org> References: <20210107143052.973437064@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 @@ -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 */