Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp334976rwl; Wed, 9 Aug 2023 15:34:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEohGc0tE+S8y48Xt0n/OmPHyPy9/aNEUNOANDr1H2+PrwfJFhX0U52/V+atDgfkcpg0SRi X-Received: by 2002:a17:907:7848:b0:982:c69c:8c30 with SMTP id lb8-20020a170907784800b00982c69c8c30mr350494ejc.55.1691620442772; Wed, 09 Aug 2023 15:34:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691620442; cv=none; d=google.com; s=arc-20160816; b=S44kWizFUt87dabrjRshVgbu9OjYKRBXGOvOgnF7AJlMPdSndQvcvebLj1dA9V3VdL cjEjQWNb6L8WTIo8ovBBcgLY56VOcWeflQ2BZ1pvjnoUO/IXXtJso5XO3lQI5TrP5DUg 2v73bsNdevdrwelbgf6wJjAK4wkkovFRXB/ZwlXZm8nC0L0Za6AZRkbatN1f1pAwql5m K3GazVnbRufyZkuUXy1dIl3m3IqpZPbSDm8pr/oUVbollAbPKadE5w/ngMc+pEzD8rXa i5f3eDJwr05GOWrAKzj95cXgl6cDj3eGMLupKhYyxC2ypWFg9h33Foo25NJibMfbd5iD NWCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=kHEh+KQC0D06deMY159UWWddznmBCpcl+hAHZ9OsUZo=; fh=mYD/XI8EtiQINJti5d8VYPy2B4xzBte5fsMvLXTKXUU=; b=1KvPP7JYiydCi6SLFz4jKEaAbvswLJUwOQ++QftbyfDAab6FJy7gCIOyEx6W3D1o1I yJV9LziaJueD7SOQXt3blIg4Mxs484dBPxHYFznXWd+XYvq/T7/0Du7UZdxu/mgorIyS KVS8hihKjmDW7NNSqN85XPyf2TOqOTGvGPlgLWZuJMYRZWvudl3TwF8xuGkadaiKvKIQ 95t5Ypwrbgp71N3C2e36dEtRAKU5G5jiOekx0rNQVi5nFfdO7HbaS1vfWqNlyQoRwEIB 8mk8f0fyvli/v7cFyDOHw5E+V3rc5aqfWJYTmYYkJWq9EMWKe9yQmD6tp4x73ytnZJgv +xcA== ARC-Authentication-Results: i=1; mx.google.com; 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 gu2-20020a170906f28200b0099367350a8asi161797ejb.899.2023.08.09.15.33.37; Wed, 09 Aug 2023 15:34:02 -0700 (PDT) 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; 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 S232879AbjHIV67 (ORCPT + 99 others); Wed, 9 Aug 2023 17:58:59 -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) 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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?