Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp51787rdb; Fri, 29 Sep 2023 16:26:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH+JzmMxtkjF3EtILmRmCKM4a56Ymetu4ZuTEAf8AZBzGQeMna81GZnrihRK6wNtUzF6GX8 X-Received: by 2002:a17:90a:2dc2:b0:274:cf7e:f11c with SMTP id q2-20020a17090a2dc200b00274cf7ef11cmr8992127pjm.19.1696029988441; Fri, 29 Sep 2023 16:26:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696029988; cv=none; d=google.com; s=arc-20160816; b=ALlqWTbvhZU7jDw5zBvhsVG3UReYSuLcj6ukJeV46LgfvI2cKNhCqtyQgH2+6JZpCp bwHWQLcOwrJKSoXzpZKO6trY5+eiLXrED2Kty33Bfn9WjpHcuaS03ZFpAwcMbI2Rps9G Reox9E9h3bdvyr8BX63jEEdyvG6mTkT7fHHbyRoME6p4FkwAcLw6/gZV76JyFCdypxso lzj5Fwsb0/ES2JEoRnOPbKoly9c4k2OlHqu4ryKMU0y0yyavjKTuxJtf17/5v95PESV9 CVB+cJGpY/q1bzknuJhQBdAbraCgV+Iky2THR3tuyQi6GQwvZNnzISkrwqG7jg/mwYJL 3K1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=viFu6r0UYe+M2GIK9v2NmILPjJMba2+ouWRdc3CGGmo=; fh=DXHY4AHPmwsl843hL5CSWR0oq5KWBRm1zYq+7nQupd4=; b=RB0vrTpyx5KcrVarOx2Tv/O0mj13QxpRbJLDWw8tdyXANpQx7BmhVWIUBlUNUGJobL xhzo2FlLYHtwT99MIeZQNpSch0k5NjgzA6gscEBWzV+CY9TDQEiQ0mZwK0wAaMVLFULF cvx+ik2d2xeBTDwgMOLky5Sx+50+dbxg0c0XfBXPVgONymQ4LKTBvBvcjhtRJCNxqcBS i+j+Y0opWpfK+mB0gtjLN+cXQvAP2l3Ts91lyO8HFsSUv9Fnu0CalL4OzEqtMDEmspAG GcPfS1S/QJ7rKoq81FC20tyH1YSC9i0gmpti+x+KNzyLr/MiWRmDL4ENUzaA0rqLdwDA xVJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jMV9oe6E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id s1-20020a17090a2f0100b00263e299dff6si2432512pjd.74.2023.09.29.16.26.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 16:26:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jMV9oe6E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 52713805AA0E; Fri, 29 Sep 2023 11:56:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233733AbjI2S4r (ORCPT + 99 others); Fri, 29 Sep 2023 14:56:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233559AbjI2S4p (ORCPT ); Fri, 29 Sep 2023 14:56:45 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EBF919F for ; Fri, 29 Sep 2023 11:56:43 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1c5db4925f9so7789795ad.1 for ; Fri, 29 Sep 2023 11:56:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696013802; x=1696618602; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=viFu6r0UYe+M2GIK9v2NmILPjJMba2+ouWRdc3CGGmo=; b=jMV9oe6EEaoKvB+JTAdGlNYnF6xqS9J9ZjjSU7N94MPptoxN5tlNNXxAi6SLmrzfpj KE6yD8l6kmKZTg31bmYU4IDBGYZMUYUcWS9COrjbkKHmYtyB9cBZwCH0SQUBoc1WtL90 i10wwRzklmZaMkxdx5Lcv9/yCiM4W4/YslX6o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696013802; x=1696618602; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=viFu6r0UYe+M2GIK9v2NmILPjJMba2+ouWRdc3CGGmo=; b=NWbj6hPtE49eR3j323l7ee29FB6WK5mZvjUbpcwjlGwJiYyf5tek4K/fExTL31OTns iC7uUYIG9KaihIlkv7NeAx++zw7/4DYLGh+9HS7TARFgxn9lfmPrC/RLPeuZWjIUGcoH BvcaTRu42LChZfs3f9cfVmVoG/KOlTlfkIK7Iup+lAkXi9YFJ92VL70vpGlexQBOrMt7 X9sDaTkZJQXmygpYe3mBqvrclPQJiCI/2ARGE9jrNwQL6XpCg4JaNJU3XNbeOBR478mM /YSg9Ed4f3VozmSaPmFx7JuERFZZwTHeE50JXo6tp4fzoXHc0xCQxgZdLz1znJhjsVJl G+6A== X-Gm-Message-State: AOJu0YxN3yjkS9TeYSbd5IoUqneIBeVcLFcs9AR9DCd4qMOINENhX2Ej rVXH3mVRZFpQFEJlF6Yu5x3AHQ== X-Received: by 2002:a17:902:c948:b0:1bf:193a:70b6 with SMTP id i8-20020a170902c94800b001bf193a70b6mr8030559pla.5.1696013802531; Fri, 29 Sep 2023 11:56:42 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id ix5-20020a170902f80500b001c733c0e456sm3829091plb.22.2023.09.29.11.56.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 11:56:42 -0700 (PDT) From: Kees Cook To: Jean Delvare , Guenter Roeck , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Justin Stitt Cc: Kees Cook , linux-hwmon@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v2] hwmon: (ibmpowernv) refactor deprecated strncpy Date: Fri, 29 Sep 2023 11:55:45 -0700 Message-Id: <169601374243.3010937.14194696181874272859.b4-ty@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230919-strncpy-drivers-hwmon-ibmpowernv-c-v2-1-37d3e64172bc@google.com> References: <20230919-strncpy-drivers-hwmon-ibmpowernv-c-v2-1-37d3e64172bc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 29 Sep 2023 11:56:57 -0700 (PDT) On Tue, 19 Sep 2023 05:22:51 +0000, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > A suitable replacement is `memcpy` as we've already precisely calculated > the number of bytes to copy while `buf` has been explicitly > zero-initialized: > | char buf[8] = { 0 }; > > [...] Applied to for-next/hardening, thanks! (I've updated the Subject here and with the older "refactor" subjects...) Take care, -- Kees Cook