From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 047352452D for ; Wed, 9 Aug 2023 21:58:58 +0000 (UTC) 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> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,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 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?