Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp242958rdh; Sat, 23 Sep 2023 08:31:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDMVaesV5kypJLra6GXA2kM++o3zMEGqXLmaOkL710rkXyANPb+Kf/6zwz4NzSNLcOU7iK X-Received: by 2002:a17:90b:1b06:b0:262:ded7:63d with SMTP id nu6-20020a17090b1b0600b00262ded7063dmr1838867pjb.17.1695483098679; Sat, 23 Sep 2023 08:31:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695483098; cv=none; d=google.com; s=arc-20160816; b=e42nT7jqjSkepHXZytnGym/0W/QsORWsV1dNESZAYiIMgqA6G3kODHulrBwz8J0duB iXOClcOtGHSkgUJSKTcYqJnftACjKdBPO491eeCEohoScQc327JuLRJex8BxBWyGKgbk VJmUunnKt+lpnuXqi6tjITPUNZt4IRddvbP77kygOaua9sHp9X3EvdTBa8R1q8dQfZb9 tpIpOFXF3SEx3sZSrCusvg9IJ+AG4b77UWbgMoWu9i3BwX2Bn6zR4KnBNOPj1Z1acBaE ZlLGYeOsVCwQdav1EQ1VGD1fAPNSm6OFPgH7waCacV73GFChnJPAQYwrBFkAsmZXXx0W hfkg== 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:dkim-signature:dkim-signature; bh=2W9BF97SqiNwR44UTKyJIL2C/qyxi5M9MCWRyPEaLmw=; fh=9oNjSA6lsj6sbbPHxCdTkTd/bKFhs94iZEyabocgRoI=; b=RVt0bRq868/4DniMOPcrmOhfHZrHh9wn9Loyc0UwA0qavQylRvb3oBHhHQdcP/NVaF MjH7oz8ktavvG/Hxx9b2NMiLVUn6bAEqyk5ccOxPGd4ucneyXdAEs2nATMHK4xGU56Er NN4AM+EfICG6jiUh6BvDHD6QVLGBmuFfmamSpx4U3Pg65gH0J4A+OKUXeSl6s37Vjxvr mZI/KEZE9BA4k0ikVar3LOOtMWhS1PYW58qDAteyBTRXcN77SUksb6krA2zKEno4/HFD 7/VXVtJ+33WDYxz02ZyNp+een/rLmHvIPt7I9a+khtfzun5KPbcJCCIr6hrY2psf/6zU MtrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=JuvpEpMq; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id on7-20020a17090b1d0700b0025de453ee4csi7014487pjb.168.2023.09.23.08.31.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 08:31:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=JuvpEpMq; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 2239D81E5CEF; Sat, 23 Sep 2023 03:37:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229538AbjIWKhk (ORCPT + 99 others); Sat, 23 Sep 2023 06:37:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229902AbjIWKhj (ORCPT ); Sat, 23 Sep 2023 06:37:39 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3B89A9; Sat, 23 Sep 2023 03:37:30 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id C4D8321B1D; Sat, 23 Sep 2023 10:37:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1695465447; 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=2W9BF97SqiNwR44UTKyJIL2C/qyxi5M9MCWRyPEaLmw=; b=JuvpEpMqV9y6fLJbjdzMQwg0h+Lsx2O4wFgIem1jQy2SwHoPlS56wrP58UaOLsuEIbr795 ark93U4IZpw51JiDfUhS9fhTaT9MBKVM5fZNKyW2WfYZU9i86j6IXimOPF2Gd1acl8mZzy AYBzIS199Kx/yveg+WnzkfkTguGYa4M= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1695465447; 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=2W9BF97SqiNwR44UTKyJIL2C/qyxi5M9MCWRyPEaLmw=; b=NSa4rUvK8i4/moouamWix2DGnqjmSWbUDYD33kKY4vanvTr5WtgjXl93Mu5I8XwlVh4iGh EUYD6YXmGg66HXCQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 84B781390B; Sat, 23 Sep 2023 10:37:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id i9IlH+e/DmUQZwAAMHmgww (envelope-from ); Sat, 23 Sep 2023 10:37:27 +0000 Date: Sat, 23 Sep 2023 12:37:26 +0200 Message-ID: <87h6nlb2ft.wl-tiwai@suse.de> From: Takashi Iwai To: Kees Cook Cc: Jaroslav Kysela , Takashi Iwai , Cezary Rojewski , alsa-devel@alsa-project.org, Nathan Chancellor , Nick Desaulniers , Tom Rix , Kai Vehmanen , Jason Montleon , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, linux-hardening@vger.kernel.org Subject: Re: [PATCH] ALSA: hda: Annotate struct hda_conn_list with __counted_by In-Reply-To: <20230922175042.work.547-kees@kernel.org> References: <20230922175042.work.547-kees@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sat, 23 Sep 2023 03:37:40 -0700 (PDT) X-Spam-Level: ** On Fri, 22 Sep 2023 19:50:42 +0200, Kees Cook wrote: > > Prepare for the coming implementation by GCC and Clang of the __counted_by > attribute. Flexible array members annotated with __counted_by can have > their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS > (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family > functions). > > As found with Coccinelle[1], add __counted_by for struct hda_conn_list. > > [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > Cc: Jaroslav Kysela > Cc: Takashi Iwai > Cc: Cezary Rojewski > Cc: alsa-devel@alsa-project.org > Signed-off-by: Kees Cook Applied now. Thanks. Takashi