Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4986556rwb; Tue, 8 Aug 2023 18:10:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHEkEJcF8BRWA+a2Rf+uGHFZTQYYDaJ13c0qnY7nKDmI0Lf4FCdO5UaghKX2OW0RpPUZVId X-Received: by 2002:a05:6870:c20b:b0:1a9:caa1:9571 with SMTP id z11-20020a056870c20b00b001a9caa19571mr1509141oae.34.1691543440742; Tue, 08 Aug 2023 18:10:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691543440; cv=none; d=google.com; s=arc-20160816; b=O5ux3T+igz8cfsWJUfDwNVL0IS5R0mE8tmGCQ0J7VWmb8H2xalVdw5XL5veChq6l+5 5GfvjTCXTg99GfFHmUJpT0spn0ryHu04X6WbjRLHnHg6Q/2nQZD1b8pgJxTGTAbxUapT bb1l2JeqtsZPv10zMaIMPaKG+BOqMTp8ibyKEy0kro9gykpueFpwrRochK5HUxNEDl9t 7g4sBkrnOWOqzfShJwXMurAhFWgpF4933raFJdDh+fzSFKppzCvXpLT2aQUJXNANV7bT qyTN4xHit1tfTtnIThvYlmDgpN1x11ZG7IK4QGtYtiwRIMVT1JI1FvJm6ZZDWuc9zXZK Pzug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=53bleXI1rwMamZX0JWcAtU23Wr0BIzKJAx0qsLh8yXA=; fh=ARhBgX6hpJU2mxKRE8l90SfXg6GxT90GFJ7M0cbKOLk=; b=o0wnkJkfGce9s7JBCKxGhhq0LoUZ+uNbq4fEPsGMtA2hg2ZhhIpaJWoBH2uSfxugXg XhAipahtzAfD9J14TXEuf073UfGjExma3h8ilLe3G/+BF6ZQ05qLJ/7Wso1V+qiPvMgc l3X8YQAqqTs0YBf6INaxj3LrCO9fyyNEN7cRqbDRbtaGAiHDsviYrI3kJQaHMrJPrk1g NsRUxOcGaJfK5xqOB4GTVUNrJF3UBCZ2qQtaJz71ZlLPLIR9oakDA3pC99LnZVRQRQDm HTyyGbK1AqU0vM5znirKsaBVA2J2GNdOurkq1RssuCq6LJ3U1hUuHztYVs5RrF3SSjKz iHKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b="P+2/9o3r"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y18-20020a056a00191200b00687507df746si8297298pfi.170.2023.08.08.18.10.29; Tue, 08 Aug 2023 18:10:40 -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; dkim=pass header.i=@google.com header.s=20221208 header.b="P+2/9o3r"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230455AbjHIAlR (ORCPT + 99 others); Tue, 8 Aug 2023 20:41:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbjHIAlQ (ORCPT ); Tue, 8 Aug 2023 20:41:16 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E701C10D1 for ; Tue, 8 Aug 2023 17:41:15 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-99cdb0fd093so368572966b.1 for ; Tue, 08 Aug 2023 17:41:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1691541674; x=1692146474; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=53bleXI1rwMamZX0JWcAtU23Wr0BIzKJAx0qsLh8yXA=; b=P+2/9o3rsXDweHtlRPZzhxI1iPCzdYp9atAuwlSGbuCtNsTg5F1zH06KhH1cW5Xlyy /Km0R6yfUAhnTFrbOCO6sdKHEZ4Y7ljRokGXJXX5dDPTduAIQ8kNl2t+P4Ah84gbtO/1 cQc0By1FBfOsuEQhzbEWjf6w5eXtd+aEcKNLed5lFmRBL3JXeXJOyvbfNoJx0YPfxghY k5AI//fgNi2wlHUiN/f2psVTQBNoVGHFqbdmYKRLu9cf3e6qVMd0KVS5KH74h8v/J9uu rv9niSeuRyxYyNwhuLqZZNqWMQ+pPiddBL/eualB55TM9RpcrqiCml9iYLd8BA6LSUmX K8eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691541674; x=1692146474; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=53bleXI1rwMamZX0JWcAtU23Wr0BIzKJAx0qsLh8yXA=; b=hvkKJhfrrFXMTi/r5W1+uUEdXjUqRhXLiz8YdR1uIsi9NE48mCCEK2sJ5i5WnPSaZG l92SQe5vHuhpPC9KSwqZ4IQ6MCfahZ/mZH+Ss4QRlVx/AL+G+DAg9vbOTVj+j4U6dPS0 eLCA8bazRglqU+YFwk7MGzcoVdTGh3Tr1D6ACEuOZ9FxBxtgezZo5iX9xLa9Kn2WOjU3 wsb3XYvzF8Qef2/fbRSFGsZ6b/9amZDNqpzRVcZDb2MPqVm6EgMHoNhP431bRIfXk4Su eUpWogWbDF4LCjM3eyfeYVlkkynazn2oal5rzM/R1UmD8xG9yhx9T/Pg2pR7Ugu2oaA0 wlFg== X-Gm-Message-State: AOJu0Ywq71gEy7OTTt2AYyma0RH/vGAaPVKWbVjxr54fGU31STJpEP7U D66Qthb6r3c+h6j4f+4gxwioF/WOWu4HhXQJrMNwuQ== X-Received: by 2002:a17:906:218a:b0:988:6491:98e1 with SMTP id 10-20020a170906218a00b00988649198e1mr892372eju.42.1691541674457; Tue, 08 Aug 2023 17:41:14 -0700 (PDT) MIME-Version: 1.0 References: <20230808-net-netfilter-v1-0-efbbe4ec60af@google.com> <20230808-net-netfilter-v1-2-efbbe4ec60af@google.com> <20230808234001.GJ9741@breakpoint.cc> In-Reply-To: <20230808234001.GJ9741@breakpoint.cc> From: Justin Stitt Date: Tue, 8 Aug 2023 17:41:01 -0700 Message-ID: Subject: Re: [PATCH 2/7] netfilter: nf_tables: refactor deprecated strncpy To: Florian Westphal Cc: 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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, Aug 8, 2023 at 4:40=E2=80=AFPM Florian Westphal wrot= e: > > Justin Stitt wrote: > > Prefer `strscpy` over `strncpy`. > > Just like all other nft_*.c changes, this relies on zeroing > the remaining buffer, so please use strscpy_pad if this is > really needed for some reason. I'm soon sending a v2 series that prefers `strscpy_pad` to `strscpy` as per Florian and Kees' feedback. It should be noted that there was a similar refactor that took place in this tree as well [1]. Wolfram Sang opted for `strscpy` as a replacement to `strlcpy`. I assume the zero-padding is not needed in such instances, right? [1]: https://lore.kernel.org/all/20220818210224.8563-1-wsa+renesas@sang-eng= ineering.com/ Thanks.