Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3647602rdg; Wed, 18 Oct 2023 01:33:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IETXNKX6oTkhLIBtT78RwDera9GimWtD0d7Z5yK6ybQ+hbbJtpKMIKgRsVc4AnTR4iswG6O X-Received: by 2002:a17:902:da89:b0:1ca:86a9:cad1 with SMTP id j9-20020a170902da8900b001ca86a9cad1mr4600121plx.36.1697617984793; Wed, 18 Oct 2023 01:33:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697617984; cv=none; d=google.com; s=arc-20160816; b=bbQrUk9Q6COA/HvCEgMrvXMauPUbHpkC7T+79lFVuHpcYn5y3iahqj3j+1dLP5bxKT 3xZaJSFMn/chohfm/6pBCQggd2/L9YLX4S9pxWvM7cVLshPapq6xBVtPK+a3tSOoFhpg ++GgAxAvWd+0wEvMltUkszJsTJyhTlq6ktS16OS7vcHf26MMErUGHQr4KN310ZnxYCiZ JADnCFGAp0Pq01Egu3PurJq3j4pda9NikMEuIkEa4fRupfzPJaSpn0WyI533sadRWq9R sR+QrKdY8gy2PPuysfW2Sp2M7Sy9vuWgdJhlWXwwoAeQloJYG1LqkL4bbdXZGLuTWmvc R7/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:message-id:user-agent:cc:to:references :in-reply-to:from:subject:content-transfer-encoding:mime-version :dkim-signature; bh=UIJtHKZ/gWzW4a9MI0+A39BQUqEPgdlMlnAP3j0yCRo=; fh=/5Ctfx2ilDt7yiT0kTR9x2aGarm1cw3mbdZUCnlD9Bk=; b=xdkGAiExBWUbcQ8OqAkGeHyNHhe7WIVO8bAR523acxeq55107dpyIeaIs8iAye8a5Z S2BZZaYglX7sehmv2QjFSFZNvqah1zNHRUwHh58roEBByK3K3PSSRGPBDODCIyplKg6b 90gKt34iyMM/UptzGeyN6YYe90yrAr67p9NKKuDeK+XAnkrzq2ydTpnaVtmse4JCGh4p EtMRstoWsreYjZuu3xKjeD3dYzsphYjkzLPucbuuoloCb0QkvGiorw9TbPSqbJnPO/YH mDXwIZg5e9P+el1cclpogjTst2TaiKKlI0wWFr6mqitd9ZSziR7CHPxEHSsNkoXNHuKq e2LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CjNGqGSW; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id q9-20020a17090311c900b001c9ca0a03ecsi3817065plh.2.2023.10.18.01.33.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 01:33:04 -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=@kernel.org header.s=k20201202 header.b=CjNGqGSW; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 6ED9C80FF024; Wed, 18 Oct 2023 01:32:59 -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 S1344701AbjJRIc6 (ORCPT + 52 others); Wed, 18 Oct 2023 04:32:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344691AbjJRIc5 (ORCPT ); Wed, 18 Oct 2023 04:32:57 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECA10C6; Wed, 18 Oct 2023 01:32:55 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D0D0C433C7; Wed, 18 Oct 2023 08:32:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697617975; bh=+prAov5OlbashqVGxd23DwmWrUyjOJwX2ICX0AH4eVk=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=CjNGqGSWvHrtKbQ8zCQwdIxW0T3ZUh4VZ0mPhRZeGATCcL2Ix/xxbr5jmNFcLAnkh 2QR2tCY99zo5BP6mUMV8iFdkZOr7vQypBc6Bjfn1nHce/YLNSSu2bGa5KLxygL6lpd AoZW9A0owRuwaKaikjkw5mVdS4sR5r2sudCe77sVPPpmlFXz4AMKRV611Ldb4Nq3L1 eOS6aFHzYuL2MayCdF5RsHwrzVIoY2Z5URWo1sJDcWMby+MM+Q1zgVIeCK+450zs04 cz/rfPAoX1BSRhm92C1OlpLXXNFUJjgZLzWvMMRG4bMmFVjUTLBFyFc7c5MiiKHIcz M/f4ABa127O2Q== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH] ath6kl: replace deprecated strncpy with memcpy From: Kalle Valo In-Reply-To: <20231013-strncpy-drivers-net-wireless-ath-ath6kl-init-c-v1-1-d69c599b49a9@google.com> References: <20231013-strncpy-drivers-net-wireless-ath-ath6kl-init-c-v1-1-d69c599b49a9@google.com> To: Justin Stitt Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, Justin Stitt User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.11.2 Message-ID: <169761797261.48072.1075267340140520177.kvalo@kernel.org> Date: Wed, 18 Oct 2023 08:32:54 +0000 (UTC) X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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]); Wed, 18 Oct 2023 01:32:59 -0700 (PDT) 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 > interfaces. > > The affected code's purpose is to truncate strings that are too long > with "..." like: > foobar -> fo... > > The lengths have been carefully calculated and as such this has decayed > to a simple byte copy from one buffer to another -- let's use memcpy(). > > Note: build-tested only. > > Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] > Link: https://github.com/KSPP/linux/issues/90 > Cc: linux-hardening@vger.kernel.org > Signed-off-by: Justin Stitt > Signed-off-by: Kalle Valo Patch applied to ath-next branch of ath.git, thanks. 40990961d983 wifi: ath6kl: replace deprecated strncpy with memcpy -- https://patchwork.kernel.org/project/linux-wireless/patch/20231013-strncpy-drivers-net-wireless-ath-ath6kl-init-c-v1-1-d69c599b49a9@google.com/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches