Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3310741rdg; Tue, 17 Oct 2023 10:29:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGW5cSxVk5hg2n/FKb6h9+BZPG7ewI80ZpahO63Mz/Hzv2RyIy7bKW6O4Cpv4OoVEHujdLM X-Received: by 2002:a17:90a:8b85:b0:27c:efd2:9a0b with SMTP id z5-20020a17090a8b8500b0027cefd29a0bmr2915670pjn.39.1697563782666; Tue, 17 Oct 2023 10:29:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697563782; cv=none; d=google.com; s=arc-20160816; b=K8vWKZF4WRB4AnXYHupVnLJ+xuJi12MPk3IHwsP/pDklJCXOlQn+0XX5gx1NbLaeJ8 4DfqJHfdU5LsNSPYcS/gwXJbvJVYGziWGXtIEez5cbwXF+pTyjeViCfqzPRu7OrcTLqM X0e4P8Idve2QMvNT8pzuwchYRIs1OwyGYfgp+ELFfJIWA6LtOEmS3gxD+gLB4IPLldIS FHM7iHC8vBnaYw0knzSRrGLOYgGkWx79h/k0huif597z/rlpwhCL8YBLB1OW4SfHZyKO m0zQe+dIbbibxd0dvDVvRBACWfJpKmBmHhi+KCDLrA9xfq+LMvyvDz6qKz1WCsL+LMsV d/eg== 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=yVjPvtK7dBS1HEVTVRVRRx6/uZvdlxYNu1++CMU25iQ=; fh=R6ziv0GUKSWMt+u70gvg0jS+Brc5v/WVf7MGxjWK00I=; b=SFqahppUtfSvsC9Oo2tn4K+Z+bIkmV5hvyi/+7TubqJDp5ea2PjVrn0qrgG5MZ8MCK yFdS4rSP9cWD1mXcMmgDVbSbVUrWOmxLpFP4zMY1bZtoOQqSPMeo6/+1AGFbq86dWz5M pud+rSVOPlFm8X7Vi1YvTDaFz7a2U7FG9EQYlTqN5ww1eLvJ4c02vKyZ5KOPqYgMOml+ yrMB/A4bOCgKef63B/nvjicJanbNzSG3+RXsDI55/quOYjerR/oRcbhGZKXWaI5ypf6a kr2XJ8HEJ2SyWdBZ2cnX5KCdj7a91EUf7un+UBdNbF41c9mw1ig+mwu433nPnisjv0Ks V3Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="KxgD2+/v"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id i11-20020a17090acf8b00b0027ced9acac0si8831752pju.2.2023.10.17.10.29.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 10:29:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="KxgD2+/v"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id D0856803C455; Tue, 17 Oct 2023 10:29:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235027AbjJQR3d (ORCPT + 52 others); Tue, 17 Oct 2023 13:29:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235020AbjJQR3a (ORCPT ); Tue, 17 Oct 2023 13:29:30 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8776C98 for ; Tue, 17 Oct 2023 10:29:27 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-5230a22cfd1so10394056a12.1 for ; Tue, 17 Oct 2023 10:29:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1697563766; x=1698168566; darn=vger.kernel.org; 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=yVjPvtK7dBS1HEVTVRVRRx6/uZvdlxYNu1++CMU25iQ=; b=KxgD2+/vY/Y3n88Q6cLm8ZH4KYfWGUiq9uXOxPxYjJKvUBWAbgAqS7uwwdFShf3ZI9 Du+Tiblgk3pi8+wEuIkcbAStfd1Gm536twbgQtxTZmIq2SUZJ84eJgq7s4ghamrLzve6 5/O0JQU12d+ofBgjQ0fyfu1PGVoQHvsGtTu++bQVRPwOHgWqlZ8mFjZSZSYvzgm//MCc /ys/5aJdURpV2l8GrKABJw8o8bIM7n09ABe/1wvHFH5pgODJaAvR8g7MO+DBrJ9lOgoJ 4KbWlAj3EgqhQ0n28FEzjCNICOP8wFjfaXJND/DxwliduZ6f4JB2zB3Ia+OJVZUmZyf3 yo2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697563766; x=1698168566; 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=yVjPvtK7dBS1HEVTVRVRRx6/uZvdlxYNu1++CMU25iQ=; b=Vl1NE2PEkbEalGG5jxOg1v+2rb+4VaE5CGnCnXq4QVGW5B0LnC9opD2K/uHYLEYU4r dY4eqZDUflJeySPax213PYpXwcMrec+jslcbQXafCwFzyruH8HyCyg/9knW8+f1phyLV Z+4+ov2mli+iB+7Wa2hq+GnFtd4WYsc/7SrL0AzXdZx6oOApoTgYeVj5bGARYZD/U5o3 seEwRk2YM18YqGm55nFP8TXL6AjfxEC2mb3F/+LNPa8aM2Xs/CcrmcXqZvRqm2jCyw6h A5zRJnRHnDG8Rizgbg8VZT819gJTtVB+KFcMd8yOYHXizw5wSRTYuUVDHy/Q3jZ+7bX/ ZRDg== X-Gm-Message-State: AOJu0Yy9qHAOcl5Ked+G7YH4IWlD9haG0gmEJ5a7UWndpWwhTr81irYp 1BUGekdoxGk4vaoCbfAaQnDrsQYAbjLdQ335lN5T8g== X-Received: by 2002:a50:cd82:0:b0:53d:a17a:7576 with SMTP id p2-20020a50cd82000000b0053da17a7576mr2202416edi.8.1697563765976; Tue, 17 Oct 2023 10:29:25 -0700 (PDT) MIME-Version: 1.0 References: <20231016-strncpy-drivers-net-wireless-broadcom-brcm80211-brcmfmac-cfg80211-c-v2-1-6c7567e1d3b8@google.com> <875y352nrg.fsf@kernel.org> In-Reply-To: <875y352nrg.fsf@kernel.org> From: Justin Stitt Date: Tue, 17 Oct 2023 10:29:14 -0700 Message-ID: Subject: Re: [PATCH v2] brcmfmac: replace deprecated strncpy To: Kalle Valo Cc: Franky Lin , Arend van Spriel , Hante Meuleman , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 17 Oct 2023 10:29:38 -0700 (PDT) On Tue, Oct 17, 2023 at 9:54=E2=80=AFAM Kalle Valo wrote= : > > Franky Lin writes: > > > Hi Justin, > > > > On Mon, Oct 16, 2023 at 3:14=E2=80=AFPM Justin Stitt wrote: > >> > >> strncpy() is deprecated for use on NUL-terminated destination strings > >> [1] and as such we should prefer more robust and less ambiguous string > >> interfaces. > >> > >> This patch replaces multiple strncpy uses. For easier reading, I'll li= st > >> each destination buffer and mention whether it requires either > >> NUL-termination or NUL-padding. > > > > Kudos to the detailed analysis of each instance. One thing I can think > > of to make this better is to split it into smaller patches so if any > > regression is observed, only the specific code causing it needs to be > > reverted. Maybe instance 2, 3, 4 can be handled in one patch since > > they are touching the country code in one file. The other instances > > each can be an individual patch. > > > > The "brcmfmac" in the title is not accurate. The change touches both > > brcmfmac and brcmsmac. So "brcm80211" would be more appropriate. > > Please also add "wifi:" to the title, see the wiki link below for more > info. Sure thing :) > > -- > https://patchwork.kernel.org/project/linux-wireless/list/ > > https://wireless.wiki.kernel.org/en/developers/documentation/submittingpa= tches Thanks Justin