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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB8B4C433EF for ; Tue, 25 Jan 2022 14:14:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1386486AbiAYOO2 (ORCPT ); Tue, 25 Jan 2022 09:14:28 -0500 Received: from smtp-out2.suse.de ([195.135.220.29]:36692 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1385445AbiAYOLx (ORCPT ); Tue, 25 Jan 2022 09:11:53 -0500 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id E916E1F381; Tue, 25 Jan 2022 14:11:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1643119910; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Rz6I6KvsbC3JmWn5u5HiUD6dpDAY3TCPycX+RIt0T+Q=; b=ghgzhHxMu1tPiPbtdJeYr8a2pdLL3mMziV+Nwc68coiiVOB7r/Jv58qZtMlU9/T0c6oaVt w8fYuYD9YYBpA94gk2GjaCFeRHU2y8c7ozH8bh7wm/a5unrFe6gI73xfKaE+88WVxFbpXN BIpPpe7YE5yJFFU3YblQcRX7wFJWmpk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1643119910; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Rz6I6KvsbC3JmWn5u5HiUD6dpDAY3TCPycX+RIt0T+Q=; b=ULvJZ3taZUVAIUUVzlJqZodE6YiS/D8iIIb+yITXZ45PFf/6JUVzvdoYA2nWCNWm8kCwJk Xrxx+6CBr8rkVZCg== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id F2834A3B84; Tue, 25 Jan 2022 14:11:48 +0000 (UTC) Date: Tue, 25 Jan 2022 15:11:48 +0100 Message-ID: From: Takashi Iwai To: "Gustavo A. R. Silva" Cc: "Geoffrey D. Bennett" , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v2][next] ALSA: usb-audio: scarlett2: Use struct_size() helper in scarlett2_usb() In-Reply-To: <20220120211600.GA28841@embeddedor> References: <20220120211600.GA28841@embeddedor> 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-hardening@vger.kernel.org On Thu, 20 Jan 2022 22:16:00 +0100, Gustavo A. R. Silva wrote: > > Make use of the struct_size() helper instead of an open-coded version, > in order to avoid any potential type mistakes or integer overflows that, > in the worst scenario, could lead to heap overflows. > > Also, address the following sparse warnings: > sound/usb/mixer_scarlett_gen2.c:1064:28: warning: using sizeof on a flexible structure > sound/usb/mixer_scarlett_gen2.c:1065:29: warning: using sizeof on a flexible structure > > Link: https://github.com/KSPP/linux/issues/174 > Signed-off-by: Gustavo A. R. Silva > --- > Changes in v2: > - Use correct format specifier %zu for type size_t argument. Applied now. Thanks. Takashi