Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2056294rwb; Wed, 30 Nov 2022 01:30:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf4L41Jt0GWEfY/Nqw0T5PQQRzyzip0veJH4d73ZW75BqLyo47sj6wfqlDydRiX440j+Yy3F X-Received: by 2002:a05:6402:3892:b0:454:cbef:c161 with SMTP id fd18-20020a056402389200b00454cbefc161mr37781123edb.365.1669800650443; Wed, 30 Nov 2022 01:30:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669800650; cv=none; d=google.com; s=arc-20160816; b=kNZUfB1vUtIU+jPQACNoYO5oUdaIZcBTN3cYOGaTkA6GNtBIKCvkmO0tcamlD8JKGI ej2zeppxA63IT3vliPkIxI7D6XWAUmdpBl9YHHf+IP0MUVqEFXEnb05yEeJhf+3zacO+ Af7YZkbHC8ASPjUjrwmfzRJ6n+eFXcVEpu5zMb6aNROr2OxdTXj5zQuANXEqLFZnFuAc r1otA4Eur7VZu8vvNjS1D16mWYi7sT4YLEL6p0DEwqTU8gBua+Cg46Va5vp6xOX25AgC H6dpouCEits2dgbBnQLu0XdyE2WuU6kIpQYwvUzKeohOT0DyvB0/DupBl80F+PVeoC6s Uh3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=gYVcaZfHsDnq3Jr0MQcZMxi6w0dAYqbQqAdgN1gLAIc=; b=zDTdEpTCAUjdt8Wz95Q3Ae2Yff8TxYpC95FbAy8VZKLo+c4Dhdj+fd3TpY65srwIKa pokaBbZs4g+n8iItW7ZktB32cnquKhyZGEkp84r90bYfwV7V5SP0GC+wUoxVPRm3zNyq ZpZgw0L/liJxFMLXtUaoa8DMG+3CBgxjnz3iRx7PXc89KNTTOxKuA9z2e468SfhM0zo+ uvn4AQ68R9FIhJOdPUDjJKwf5TEaZ+OdWoRzNYxf3JAoBT5ImAAYS+eCak0TKrKQg9dG 1THMWBZQzj7JYFLvP9Rrpc9ENPqam2wminLeux6p9jmXYhFmEV3y11d24DPtLoBa0vip p6Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=M9Cmst7V; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Teh74LVu; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id km12-20020a1709079a8c00b0078dad3ace2esi801577ejc.676.2022.11.30.01.30.30; Wed, 30 Nov 2022 01:30:50 -0800 (PST) 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=@linutronix.de header.s=2020 header.b=M9Cmst7V; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Teh74LVu; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231250AbiK3JL0 (ORCPT + 85 others); Wed, 30 Nov 2022 04:11:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230291AbiK3JLY (ORCPT ); Wed, 30 Nov 2022 04:11:24 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1B853C6FB for ; Wed, 30 Nov 2022 01:11:23 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669799482; h=from:from:reply-to:subject:subject: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=gYVcaZfHsDnq3Jr0MQcZMxi6w0dAYqbQqAdgN1gLAIc=; b=M9Cmst7VuI4zXCi/VmFjfeAe3sGGjF3cLaBLESfNqU19KMcL82k7okkWQLJJKZPi/Idn5A q4ujoFJ4SODJBWvGg/MUZeFdvtp4oSJPbkG3Hf5GZTXGCIqJJdDRVFGYWF2EUJeKW/34A+ R0QLZdTJEjPJHftpdbuT2uUlvu/5cB7R1pGuzBpzm6I6nuh4l/nLAWiLm8I2R+wqjRShy7 Ld//59TruGPQzbWZAtNgD6HSz5iCZmmF0UVkHiwvj25TjCdGx119N2+7SYO6bsS/OZv9W1 YRx16z1CjUN1yGpV4XRt9Anoo2478brFt1zWt6I1xz8THUgspgadVfvWxLc2ag== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669799482; h=from:from:reply-to:subject:subject: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=gYVcaZfHsDnq3Jr0MQcZMxi6w0dAYqbQqAdgN1gLAIc=; b=Teh74LVuWlkiETMMXA72/ttIvMTYlCwFvnZUj69tRsX0J5/sCKylDVOOcb5zIvi6baM94m PHMLJiAbtV+kDyAQ== To: yang.yang29@zte.com.cn, pmladek@suse.com Cc: senozhatsky@chromium.org, rostedt@goodmis.org, linux-kernel@vger.kernel.org, xu.panda@zte.com.cn, yang.yang29@zte.com.cn Subject: Re: [PATCH linux-next] printk: use strscpy() to instead of strlcpy() In-Reply-To: <202211301601416229001@zte.com.cn> References: <202211301601416229001@zte.com.cn> Date: Wed, 30 Nov 2022 10:17:07 +0106 Message-ID: <874jugx0wk.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,INVALID_DATE_TZ_ABSURD, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS 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 2022-11-30, wrote: > From: Xu Panda > > The implementation of strscpy() is more robust and safer. > That's now the recommended way to copy NUL terminated strings. > > Signed-off-by: Xu Panda > Signed-off-by: Yang Yang This looks fine, but I am wondering if we should also replace all strncpy() usage as well. AFAICT they can all be replaced. It would also avoid the manual termination in console_setup(). John Ogness