Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4721367rwb; Tue, 8 Aug 2023 12:44:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHKX+8qufs9uQKzls8tnqS+sDNUcJYsm26SURGZl4YTpcgJDOMR9OuyFlmAsTT7/oH+HChe X-Received: by 2002:a17:90a:8a0f:b0:267:de82:c37b with SMTP id w15-20020a17090a8a0f00b00267de82c37bmr496554pjn.18.1691523857386; Tue, 08 Aug 2023 12:44:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691523857; cv=none; d=google.com; s=arc-20160816; b=F/Gyy45zaUy0YrWPSkpo3qOpZ624vwcCU+SlKyjHnJKKql5DAII8A0QHVj0uKnv/16 GyrDcV+Jq4xpnzizdHzWkgfN2mtArv7GbhaJtGRV3Ke3fu1r1s4NSq2RLCYrU2x73ALv iDYMKetVz/9J0t5LmAk8NMNi0FR4GyFxEK7YOVylozhodhxDE/j42KjD8dmekofxivci YY/ZjateVt+xeHs9fEg3JqYyqTFP67PMUD1oE16UeS0djyd7BU+m9DKtn3LbH9Z2R6yp L41/haMwWXCUOl9FRcazfIvdh+wXY0ZmnK/bItiEAUP9Yt5xi+O10DBCxXeSN9j8mD0n TF4w== 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=sTTAM2ewHCdNL83Dn8kQGuHuJBbBf1ARyCINKwKh7S8=; fh=R+ubuhW6vvJikIFu7TDicNrBjTrMJIaIbOn4SwRWtkU=; b=hsRiKtxpqoxGJyYEGkC0lrAM3JkcMkdirFqjnCxpNOj2liZ6y+tpdOIOvZCNez4eXf pS5Z+n1RNDseWhbovKQzwH7ox/jvI7UafHkalRM1WBoPakfbkBxHDDuqRJLaEwZRECeh 6SYrIrPvkKcwjHIXsitYhUQXHasnmSW1aAFs4E0a8vRnl8S4O/EfCGn5RMbuvLGUhqXk FJ0ZISUG2lS5t5DrEPclMC++GWSwU2tNUJS8hcL75M1xBLq+aMQVee6xV/5HMpCqctn8 X8B6UgItpT027gAek6KKuYtXixjuhhpmkwmv7iaBu2LZUxIsa2fZnCFHLm6LRgqKuh6B OcQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=LGtjAWgw; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t18-20020a17090aba9200b00265e48c115csi11079008pjr.114.2023.08.08.12.44.04; Tue, 08 Aug 2023 12:44:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=LGtjAWgw; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235084AbjHHRzW (ORCPT + 99 others); Tue, 8 Aug 2023 13:55:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229980AbjHHRy4 (ORCPT ); Tue, 8 Aug 2023 13:54:56 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9918DA5D2; Tue, 8 Aug 2023 09:24:43 -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-out2.suse.de (Postfix) with ESMTPS id D810D1F45E; Tue, 8 Aug 2023 12:46:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1691498786; 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=sTTAM2ewHCdNL83Dn8kQGuHuJBbBf1ARyCINKwKh7S8=; b=LGtjAWgwhvMtYdsh4CDF8bs3PBoq9wjj8RAHQINh/lmm6yUz6ZijmsHNnRqme0yIcKDnRc avZxRP55eUl0waV2+YyCESxmfOvW7hc9NewyzzzhsfkpFxc77lAjN9fLnQye9M2uLhT/rg 8bB5FBAsWQJOlhKVBKO2P2TOQqblS7M= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1691498786; 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=sTTAM2ewHCdNL83Dn8kQGuHuJBbBf1ARyCINKwKh7S8=; b=HB19ZP5A+Ezp68cGH3OplEVuBpjs1Ie0b/cj+gcQ8xZz1TUVn0/dLkDZvuWCuo5nqUzKxv SkBij4uGd1YSp8Cw== 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 9CE9D139D1; Tue, 8 Aug 2023 12:46:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id LfdbJSI50mTxAgAAMHmgww (envelope-from ); Tue, 08 Aug 2023 12:46:26 +0000 Date: Tue, 08 Aug 2023 14:46:26 +0200 Message-ID: <87o7jhhfbx.wl-tiwai@suse.de> From: Takashi Iwai To: Justin Stitt Cc: Jaroslav Kysela , Takashi Iwai , Thierry Reding , Jonathan Hunter , alsa-devel@alsa-project.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, Kees Cook , linux-hardening@vger.kernel.org Subject: Re: [PATCH] ALSA: hda/tegra: refactor deprecated strncpy In-Reply-To: <20230807-sound-pci-hda-v1-1-6d9cdcd085ca@google.com> References: <20230807-sound-pci-hda-v1-1-6d9cdcd085ca@google.com> 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=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 07 Aug 2023 19:49:28 +0200, Justin Stitt wrote: > > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > A suitable replacement is `strscpy` [2] due to the fact that it > guarantees NUL-termination on its destination buffer argument which is > _not_ the case for `strncpy`! > > It should be noted that the current implementation is unlikely to have a > bug because `drv_name` is a string literal with a size of 9 while > `card->driver` has a size of 16. However, it is probably worthwhile to > switch to a more robust and less ambiguous interface. > > [1]: www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings > [2]: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html > > Link: https://github.com/KSPP/linux/issues/90 > Cc: linux-hardening@vger.kernel.org > Signed-off-by: Justin Stitt Thanks, applied. Takashi