Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1138420ybf; Thu, 27 Feb 2020 05:45:39 -0800 (PST) X-Google-Smtp-Source: APXvYqxQbFUq9ALvEje3ackoaPcHrdQGQl8orzDndcIFEiaDlGlbNZLcoNfJlPHFUBNgkmvgy/HZ X-Received: by 2002:a9d:d06:: with SMTP id 6mr3468624oti.176.1582811139325; Thu, 27 Feb 2020 05:45:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582811139; cv=none; d=google.com; s=arc-20160816; b=dIIXXs2KYoOC3THwwlFA499QOYJC11YZt/gucVwFJYHVDYxlKIDpcoh26BDOyeRcHm k/ffrQ7gk6siCASTmT9nzJxAa8xUjX43obtN/EfAcK1weSFhmXB3pIQy4hv2UC6m/vNg 8O/0E+nK47woEj7uEekEzgX+OpiAv13D22Qc3uj5MAp2z3mZPKxIEiY0tCi8nvq/897J Q9tV++rBVcgDPeA1iBEAOsx+LfdiMMO28voCF01skwCuKdMkgGLgz2Qx9jQ3pzvy23hX 6GHLWBPM5lCJVv+gcfUs46eh4wmFnA7BzIvv3EkhrpK7iviE2GoDU7890iI+6USjd7Sz oD4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bkvlGwXRqHl0OWnJeL/9CdOo983ixlE756RS50qZud4=; b=c5XNaI1aJsESZ5dxQ2hPaeYZ/+/rjslfSlY7mngMvAyIycylHsz67PRe8g9P0cYPY9 qSD7xNuHBtzpJW2mk3ub5huVo6P+QM99CokmIC2RthGF3FeoyMBSgZ5v7brZbu8aqHWO UhY3AmmraK9mki7qWnZKKHxUQ7ZbSZ1U/x2gz3D7iJYQEm2f6OHM8i0mJV5WKMKiyD2L ierifluQJfRWWy9f03zqu2VLxGqNjBi9cxdKkpzIdZrLz/Ty1mWyO98pG6tWWkIy1DFY 9d4vLvt4N0wV0I7sTGo6h3jFG57BgK3YlOli8eQhcpGzIihjburK+dcWIvnw3frVtJLC bIOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MuM6bx50; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v26si1683310otj.0.2020.02.27.05.45.27; Thu, 27 Feb 2020 05:45:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MuM6bx50; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730263AbgB0Nos (ORCPT + 99 others); Thu, 27 Feb 2020 08:44:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:40202 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730249AbgB0Nol (ORCPT ); Thu, 27 Feb 2020 08:44:41 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9ED7220578; Thu, 27 Feb 2020 13:44:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582811081; bh=KQwUHAoHkKcrkxEfYWpKsiCRMt+TCx0PRmOlYP6sgUs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MuM6bx50NhEENTAlYAXMoO233ukSqASS9mkth0hS0SeueTi6Yvhgd9OBgup4W7ZUM 507uW4MK+8joZBMufW8h4Qck4w3x5f/vE/Fvoqh8dDQzYacH3sQNwmf2yq8O2uKxNI rbaoXKGpi+s3XXkDQf8VvrpgkRszo+KdNhFKC3k0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+576cc007eb9f2c968200@syzkaller.appspotmail.com, Takashi Iwai Subject: [PATCH 4.4 110/113] ALSA: rawmidi: Avoid bit fields for state flags Date: Thu, 27 Feb 2020 14:37:06 +0100 Message-Id: <20200227132229.406937993@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200227132211.791484803@linuxfoundation.org> References: <20200227132211.791484803@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Takashi Iwai 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 Signed-off-by: Greg Kroah-Hartman --- include/sound/rawmidi.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/include/sound/rawmidi.h +++ b/include/sound/rawmidi.h @@ -92,9 +92,9 @@ struct snd_rawmidi_substream { struct list_head list; /* list of all substream for given stream */ int stream; /* direction */ int number; /* substream number */ - unsigned int opened: 1, /* open flag */ - append: 1, /* append flag (merge more streams) */ - active_sensing: 1; /* send active sensing when close */ + bool opened; /* open flag */ + bool append; /* append flag (merge more streams) */ + bool active_sensing; /* send active sensing when close */ int use_count; /* use counter (for output) */ size_t bytes; struct snd_rawmidi *rmidi;