Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1752780pxj; Wed, 19 May 2021 13:06:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDuGrWV8ltDbG9QsiE15pZwsdOYmFT8hvEUULRcKK/2n+2rMDhGBfPUu3RW0/AEroTzxsV X-Received: by 2002:a05:6402:74f:: with SMTP id p15mr772719edy.333.1621454794748; Wed, 19 May 2021 13:06:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621454794; cv=none; d=google.com; s=arc-20160816; b=tbmaAsQ5kFEfPpIkYkUBlZu6rUpHXsAl+B9JOFy0xmRC1FkeFCyXUbEBWjHjuTDEzw iy2YdJyCGFt1eKpqzopttqlwui74G4kyqLKkyQ8iahRg41vNPyR3RlAe8IYX8Hz1nE9C 3WXBvn4bOQ0JgKymTax04/bwJiaRRCKu0uGla78VaToGt+NpSPg+SqCQPkzs1cMVeKpA BSnpjnPBz6vaJUmYYkMNQOFhwG4uzF58trBmgGsOb6PCf8ZQGv/FPGPV6aOug2ZsfDi/ KdKr4ZsfQR0bJoHJZ/hp1byXMJ9GUQd69oiJ2o/ZOL7xAFWEz/Es5MaycGtLSsFbtBpQ i7jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date; bh=TJLPXH7MQ47lvYsE0A2E+9zB9J2CNqjsWv3ng4fo7eU=; b=UaZ65KULOq4JoAVMlr6nmnGmYDVw0zD++2e5/DhNQlk2WVONkPGZlxR12YRggbDQIh Ba3plJuxgyfE+13EJi3Q9NoDYxMC6ib0XWxr55C9IjT2CGhA/C2fYAGUIiAzFMhGlPgD ppFgsv28EkdNy0r7hBR/J72BLJ7xjgdgi42+hnwFNL+VcHinmFjrNv20dYYQX7W5Xvk5 U2jjJloAWH3RPEroN5MR/ilQk6n9z97BvZz3ti4X8RCn0+3Gi7pUHNL4wmlPKm8Qwys+ WAWeDYCkIDGrFH2XIgTfv6PFM1REZ5kghpPAHOmb7U7y2trhFm0A0rjDT1QTUlzb+Y/V wXKw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zm10si775276ejb.67.2021.05.19.13.06.10; Wed, 19 May 2021 13:06:34 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242454AbhESOWG (ORCPT + 99 others); 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: linux-kernel@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