From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 928E9C433B4 for ; Wed, 19 May 2021 14:20:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7507F61244 for ; Wed, 19 May 2021 14:20:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346204AbhESOWG (ORCPT ); Wed, 19 May 2021 10:22:06 -0400 Received: from mx2.suse.de ([195.135.220.15]:39538 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241978AbhESOWF (ORCPT ); Wed, 19 May 2021 10:22:05 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 1002BAFB1; Wed, 19 May 2021 14:20:45 +0000 (UTC) Date: Wed, 19 May 2021 16:20:44 +0200 Message-ID: From: Takashi Iwai To: Colin King Cc: Jaroslav Kysela , Takashi Iwai , David Henningsson , alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][next] ALSA: rawmidi: fix incorrect array bounds check on clock_names In-Reply-To: <20210519105424.55221-1-colin.king@canonical.com> References: <20210519105424.55221-1-colin.king@canonical.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: kernel-janitors@vger.kernel.org On Wed, 19 May 2021 12:54:24 +0200, Colin King wrote: > > From: Colin Ian King > > The array bounds check on clock_names is currently checking the size > of the entire array rather than the number of elements in the array > leading to a potential array bounds read error. Fix this by using > the ARRAY_SIZE macro instead of sizeof. > > Addresses-Coverity: ("Out-of-bounds read") > Fixes: 08fdced60ca0 ("ALSA: rawmidi: Add framing mode") > Signed-off-by: Colin Ian King Thanks, applied. Takashi