Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2157025rda; Tue, 24 Oct 2023 14:19:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFqWdURTEgJ1/aAnAQKgWIeFIaRHiqV4nOTdpsuGn7/hlqBdVBtBJPK+UZC2BKYSSdhLn4K X-Received: by 2002:aa7:9622:0:b0:68b:eb3d:8030 with SMTP id r2-20020aa79622000000b0068beb3d8030mr13779480pfg.1.1698182394645; Tue, 24 Oct 2023 14:19:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698182394; cv=none; d=google.com; s=arc-20160816; b=LmaQl2Y+IRIr/wCT81LM0yZak+mXFXj3Ode7rIxQopWwDFkRXTv4EkD923ioVw3dj6 +t2cGGn2ErPOtlB0ntTEyUmo+wNqGpauZhyoQC9WHmQjExgmQcvt0lwmW871lIL+GGbq p6IN6IJdB4YHSZjbF+KWLUTR/8Yk0MCP3Z2YN5xNXi0EwTzs79L7B4FtuH5sd5Qk9GmL I6WW3pxsCfhgI8rtUiEPv1/BnGpACRABI03M4EncUkq0qilPGH7nPxFcfpclGhR41lS4 OzHmV8W8OdjGqco9qprZxLohESbHupwCIZbaDdDlNxGBkATn6C5r7ddeKzt61PER/inO biWg== 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=5RD2uVI53YPOZ0BFcyzyDDbxRYlHoJPCjbTQOo+qzUU=; fh=HXMPivYbk2IWPABVFWyw9WxQLVN6KcyjeMH5dddfB9U=; b=dR2lhqgkVFbx+R99pEy5Ujmjy9rr4HgiMNg9sJwtggAz79RaQ1G4ISL/uG8b5aTxt3 C3Z8/WgesBGNlN2QH6sMG0ufFzFPShHDoFQR/KcW9zKWsJ7XnR4IlV4Qirmwvt4IYC9K 9Wn68Nd7+yOYi0tgoMRDlfnjjI+kSSWUneEpRR9Xn8dJZw7I7LhX+Z4589J/8pLUXDCD kPLLzeH8eT4YhBtPbsCIjQ0MmtgdkEddgujh4EglBF3Ph6tR56MDtlsynWmQJM4UvtVQ mqgzY8VvOeX3MDGyMnkty5lF9SaWS3EpHcU52AaLjE2qhqJZZxlMLrePwxxybsWCNc0P TWVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="aLJOV/z2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id k124-20020a636f82000000b005aad5164a40si8777692pgc.246.2023.10.24.14.19.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 14:19:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="aLJOV/z2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id B479B80B6C37; Tue, 24 Oct 2023 14:19:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344432AbjJXVTb (ORCPT + 99 others); Tue, 24 Oct 2023 17:19:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234969AbjJXVTS (ORCPT ); Tue, 24 Oct 2023 17:19:18 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0570B10EB for ; Tue, 24 Oct 2023 14:19:12 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-6ba54c3ed97so4787648b3a.2 for ; Tue, 24 Oct 2023 14:19:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1698182351; x=1698787151; 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=5RD2uVI53YPOZ0BFcyzyDDbxRYlHoJPCjbTQOo+qzUU=; b=aLJOV/z21vV6m75Xb711cUpOEuqg9A1mLVfSpxFxZ2adW4XZGWqgdaI3E478R7lm6U t1oQVSIp/P9CpA/wQk75WxNjgLJMBBKTdWOdS9ZeHPK4DR5P77+CLdEMwq+HMg3TNHIV TQAQSqa47yQpwf1QTuhFJgUoWmvpyYZNStKfs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698182351; x=1698787151; 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=5RD2uVI53YPOZ0BFcyzyDDbxRYlHoJPCjbTQOo+qzUU=; b=QAk2Oq+WaqzjL41hNrFaXNp7E/7fy5boHrPOA9fSBfGohD1bQYfg0xNbUy2CxOyIZW ep2XKSSz6+ArFk+l3qY2eMWmsL07jTsuqakwBr8GuhOh2bgEHRP8gpsRAyDT0vvGeqYD Ur4uTKwnVzWPWh1eAKKsYwx60glJnwrf8qoCC79GwFIYetUBGFi27Ld7203si8vXXUxp 3BYMCwpPuO+vlO3mSPNnq7aO0Acy/cy0rn5Aw2vRpfaxg93uA/njJ3gYZg2zBYawoAT4 iAk7Y3FpawgM88XeluoxE/CD+eGhttNKZ7oK9Zq6ZKTglDJE59wSenCaeTmZMVCsHkuY A54w== X-Gm-Message-State: AOJu0YzpSWyhhr8ovuKmjOcMW8k7D8F5q1OGgmyzIqe4aCc0nUDLRyEu TjVuhfCVCay22KhjAHj3utrWSg== X-Received: by 2002:a05:6a21:338b:b0:16c:b580:2a03 with SMTP id yy11-20020a056a21338b00b0016cb5802a03mr4592125pzb.24.1698182351538; Tue, 24 Oct 2023 14:19:11 -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 t3-20020a6564c3000000b005ac384b71cbsm6440046pgv.60.2023.10.24.14.19.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 14:19:08 -0700 (PDT) From: Kees Cook To: Jean Delvare , Guenter Roeck , Justin Stitt Cc: Kees Cook , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v5] hwmon: (acpi_power_meter) replace open-coded kmemdup_nul Date: Tue, 24 Oct 2023 14:18:53 -0700 Message-Id: <169818232967.2100071.14037828991402814804.b4-ty@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230926-strncpy-drivers-hwmon-acpi_power_meter-c-v5-1-3fc31a9daf99@google.com> References: <20230926-strncpy-drivers-hwmon-acpi_power_meter-c-v5-1-3fc31a9daf99@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 howler.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 (howler.vger.email [0.0.0.0]); Tue, 24 Oct 2023 14:19:52 -0700 (PDT) On Tue, 26 Sep 2023 06:59:15 +0000, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > Let's refactor this kcalloc() + strncpy() into a kmemdup_nul() which has > more obvious behavior and is less error prone. > > Applied to for-next/hardening, thanks! [1/1] hwmon: (acpi_power_meter) replace open-coded kmemdup_nul https://git.kernel.org/kees/c/9cca73d7b4bf Take care, -- Kees Cook