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 78990C41513 for ; Wed, 9 Aug 2023 21:58:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229623AbjHIV66 (ORCPT ); Wed, 9 Aug 2023 17:58:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230375AbjHIV66 (ORCPT ); Wed, 9 Aug 2023 17:58:58 -0400 Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:237:300::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A6B22103; Wed, 9 Aug 2023 14:58:56 -0700 (PDT) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1qTrCY-0002Gf-QW; Wed, 09 Aug 2023 23:58:46 +0200 Date: Wed, 9 Aug 2023 23:58:46 +0200 From: Florian Westphal To: Justin Stitt Cc: Florian Westphal , Pablo Neira Ayuso , Jozsef Kadlecsik , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-hardening@vger.kernel.org, Kees Cook , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/7] netfilter: ipset: refactor deprecated strncpy Message-ID: <20230809215846.GE3325@breakpoint.cc> References: <20230809-net-netfilter-v2-0-5847d707ec0a@google.com> <20230809-net-netfilter-v2-1-5847d707ec0a@google.com> <20230809201926.GA3325@breakpoint.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Justin Stitt wrote: > On Wed, Aug 9, 2023 at 1:19 PM Florian Westphal wrote: > > > > Justin Stitt wrote: > > > Use `strscpy_pad` instead of `strncpy`. > > > > I don't think that any of these need zero-padding. > It's a more consistent change with the rest of the series and I don't > believe it has much different behavior to `strncpy` (other than > NUL-termination) as that will continue to pad to `n` as well. > > Do you think the `_pad` for 1/7, 6/7 and 7/7 should be changed back to > `strscpy` in a v3? I really am shooting in the dark as it is quite > hard to tell whether or not a buffer is expected to be NUL-padded or > not. No, you can keep it as-is. Which tree are you targetting with this?