From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A96C1C4332F for ; Tue, 22 Nov 2022 01:09:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231924AbiKVBJb (ORCPT ); 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 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.