Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5164069rwb; Mon, 21 Nov 2022 17:57:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Sm4LlwgruFkoou7dTYz6leafBLFwLSDCxFEx3UZ6zdn4nhOo+Y2eVWW7SknAwNfLqQ8zx X-Received: by 2002:aa7:8513:0:b0:563:3d81:7faf with SMTP id v19-20020aa78513000000b005633d817fafmr1714320pfn.45.1669082261449; Mon, 21 Nov 2022 17:57:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669082261; cv=none; d=google.com; s=arc-20160816; b=swPnzSEz1iBnYS21cBOMJzrFZDT/8O/7qYSYxitf11qMY6oClZ5sA3qetO0zPLNqny 2fXGIxmOY6V4bCQh+lilaPmq/1cDSpLuf1ZSPDPY0/+5i9PWWRByK00BOh47KSf5luIk BLFWzNlvd1Xyd6DZ5dwaLJow8HOOSyvDD8SHiKbZ7C9CCHaDhq60ZzcPtSie039lDQDS Ddcgt6+PEjnirnj8ui4h89JJqnu5M5/GA/TsYcFLDPeSSkbvHTeXpQ1UMo26ywARjjnC Cfl9QTtPDv0KikoetkGmH5eqPh+N15JcqXMAXNhGv77Iy1YVlSfzyyA081VPjrAiDj/C 9Sug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=oldztoEmb+3Uztdd1dUQHA0W++WgZaHezQU6lzne2QA=; b=FjZLZRE0aXjGyJgJSp0gBdeThII2UpZrdU4vZShvkGKwnmnYhmGuqPteyBkFoHLB03 wFuMMTH5TTZ8pxVyMSiU3NW+MRXTobRxQgROj0iPYb+K2NIdmneSzapC78CRYvXaX6jW z86Bw7K1xWiGvD0D5S14Zb2xi2q+S9beRP8QfaV4/R4o1LS76QiZ+786ePw4QxqjXSfI sRIcArtWEzhDuqF15n+kopNbfvOlU/ql9sRUo3BckIF/6LSDuUtXyNTq9/zBtaqH4reu u7kFGNH1Nrh+rPj8FEtb3dJHMXGSQk7L/AX4/WAhwIFtf/AhAIV2H84KdJkMxMTzxXq2 pQaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=oHLX+xi6; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p2-20020a170902e74200b00187075ae5f6si13838018plf.461.2022.11.21.17.57.30; Mon, 21 Nov 2022 17:57:41 -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=@linux-foundation.org header.s=korg header.b=oHLX+xi6; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231844AbiKVBJb (ORCPT + 91 others); Mon, 21 Nov 2022 20:09:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231947AbiKVBJM (ORCPT ); Mon, 21 Nov 2022 20:09:12 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1062E51C3E for ; Mon, 21 Nov 2022 17:07:56 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A081061511 for ; Tue, 22 Nov 2022 01:07:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3139C433C1; Tue, 22 Nov 2022 01:07:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1669079275; bh=FEHU+EA0QIJa2/Zyh7aNKFWHV9/Z3wyDKiYpKyAXro4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=oHLX+xi6GPTX6AfGjrrOIE4Aauvnpyh/vYHM1v7YLLm4PiUoH5m6II9+WMHsKJAPA Vx7UUJuJkmf4CnARym4fpsszBg9S9EHQkkEZOAsZ0bpPJtlECj+lSe/+xqNBmR3erX 9sUZvmebzTs++hvQpiaAlIPznHvgYM8A/jCgpghs= Date: Mon, 21 Nov 2022 17:07:54 -0800 From: Andrew Morton To: Cc: , , , , Subject: Re: [PATCH linux-next] relay: use strscpy() is more robust and safer Message-Id: <20221121170754.b5f7f57960596a146832d189@linux-foundation.org> In-Reply-To: <202211220853259244666@zte.com.cn> References: <202211220853259244666@zte.com.cn> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, 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 Tue, 22 Nov 2022 08:53:25 +0800 (CST) wrote: > From: Xu Panda > > The implementation of strscpy() is more robust and safer. > That's now the recommended way to copy NUL terminated strings. I really see no benefit to this switch in this situation. What am I missing? But I guess this: hp2:/usr/src/linux-6.1-rc4> grep -r strlcpy . | wc 400 1913 34402 hp2:/usr/src/linux-6.1-rc4> grep -r strscpy . | wc 2824 11990 266471 is a good enough reason for applying.