Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2177065rwb; Wed, 30 Nov 2022 03:29:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf4LKyZQ4uuhzUi8kVgrPDjPyV5cw9TJDtBobFRLwJ2ImKxCtO3XKyQ1MyqJ2DMWpi5Lq+aO X-Received: by 2002:a17:902:ec92:b0:189:377c:9aa with SMTP id x18-20020a170902ec9200b00189377c09aamr39291222plg.90.1669807779810; Wed, 30 Nov 2022 03:29:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669807779; cv=none; d=google.com; s=arc-20160816; b=NyVLCOmJgWLpZBwL8fxpCUEGQDxGrAlYPyWk2bRRZVZoaF9D8SlvHUYkiXd+ZtBkoS kHwoJXCZxIZ+Ly2AQ+evYN6DYI/thB+IRLJUBkW32O/y9joO0rfhoBV5RR648Z4ljj4F IM8LG/RwMffquqHihgcEf/68yIfeUo5irYDdX+oSlFSUu56n/+fitmXVrDjHmcc9CR6y aqAfr6aTyO3Bf9wSJ1Ooh8Y79VjmdzsYi0eiCuMs66Og8OuKNdY4ZtkrAnOefF21O2N+ x+uyenEFJYayrItaOb/JxhLNQxSaeuXNtWE2LSlEr9+KzyZjXE2dczTKfzXL5u4ymWaE Zyog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=alKqO1KGiM0TlNElNW5lsmrdGfe14gnWP99nD8V4u7U=; b=m1WInSIn3TzJ+lkssO92F9AC6riQl/baw0KPPbo/zvffQOjCToWgAhmjmxC3yD0R1i mTma3pRWTQEgbyH+t2/VZaxRfOI9KhEH3ixWXMYKJ71ZWJEu4GC6qLHeVqhfSuFEbxtU 51+qCUXuduUGTcm7LE5sy+00gHCewjWayif21ZEAmqTbxRwTBfvz9D1oJr4shumoefJt AMbD/oNkPXaDjNAy5dJElgprcYsQURWqedz4N4pSjvn09SxUcZb1/nC/j6M2SH3rMISX qu7r9a7x9PE8sk4KIpgbX90dnx9CmKj31aRGqmiqtpoA0dc8fONHrl791D9BU+De3xxB qA8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=MfLEPmx1; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s64-20020a632c43000000b0047856c2590esi1112152pgs.35.2022.11.30.03.29.27; Wed, 30 Nov 2022 03:29:39 -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=@suse.com header.s=susede1 header.b=MfLEPmx1; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230367AbiK3Knt (ORCPT + 84 others); Wed, 30 Nov 2022 05:43:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231190AbiK3Knn (ORCPT ); Wed, 30 Nov 2022 05:43:43 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 965455B846 for ; Wed, 30 Nov 2022 02:43:41 -0800 (PST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 4F93A1F37C; Wed, 30 Nov 2022 10:43:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1669805020; 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=alKqO1KGiM0TlNElNW5lsmrdGfe14gnWP99nD8V4u7U=; b=MfLEPmx1GqDicl6wJDqhh0WdD/ohz7P+3OVwMUYOXhg1gOd4NsDX5BCFTyhtNBF0hZ7eeb DE7z3K5X9yNWRR2gjM48vRXMETf7kRdLU3Dhwh93JAv9KvEzTCLaSxkr5OAZtUsUhGS7nb 0n62cEzgM+uN+LZRGnjWcmRNRkfgrYM= Received: from suse.cz (unknown [10.100.208.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 2FD742C149; Wed, 30 Nov 2022 10:43:40 +0000 (UTC) Date: Wed, 30 Nov 2022 11:43:39 +0100 From: Petr Mladek To: John Ogness Cc: yang.yang29@zte.com.cn, senozhatsky@chromium.org, rostedt@goodmis.org, linux-kernel@vger.kernel.org, xu.panda@zte.com.cn Subject: Re: [PATCH linux-next] printk: use strscpy() to instead of strlcpy() Message-ID: References: <202211301601416229001@zte.com.cn> <874jugx0wk.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <874jugx0wk.fsf@jogness.linutronix.de> 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 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 Wed 2022-11-30 10:17:07, John Ogness wrote: > 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(). I agree that it would be nice to replace strncpy() as well. But it might be done in a separate patch. Yang, Xu, would you like to do it, please? Best Regards, Petr