Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp432389rdb; Thu, 5 Oct 2023 09:58:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHfAAx6K8YudP+rERLaIiH3numlS1PjkfmM5wR3bwE5X8GEbVQfwRkSkkYFnt4Hq/J1Z+oN X-Received: by 2002:a05:6358:280e:b0:143:4909:729b with SMTP id k14-20020a056358280e00b001434909729bmr6265887rwb.32.1696525094151; Thu, 05 Oct 2023 09:58:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696525094; cv=none; d=google.com; s=arc-20160816; b=w2O6rigNADKlAozVFXwtGB9poNZh0XZZOYRt9BNTJmTPxlxuIedGoBDeu1M+lk13ke PEiqP1+hbGz1ie+UsBudxCBVtnJ9zBuxQECevUVLJquGUdOtbRC3JS/0wJZCVOs/0Qum kfEdjm2JjgzskGggwgXQ1KgsuWaVOX0IUnhGk5ImlQFGmL97RDXCqolWpuO65x+/zR9b lGDJfZNMaSAgM2MFHAN47buWPqGl4+f/FdK+6f/xAv5BzqvJX6UYWQOHuE0c3RpctIA+ nCZukt9ZlTf8vlF4btuLNezrU8vniKrOJozmTGB+JA7RWm+4+MJ2KaoEbvJQor7ZcZ9I Z+MA== 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=aC3vmtsMplEH+RxAjyp3uzmOqoOqrVPhV6qAz/nGJcs=; fh=T091zJeZVwjvA9PL+8lANFV8rOCzQTlOF/zWuxN368U=; b=zdLntlSQOfD0mQhV1wQJVwLVfmBp9wsZZIJvOU0c0Bywr26dA4hOnNHazWDXypAsYn 8iB8pGVldKTM+t2ZFyrOSb5qiYKfGA8YTCBVqL8NWCcWS4TPvH4TN+L+EQg87K14jwKO nwMDGXdEn6Xf1S0sf/g97dW6ruBX3uJ9Vp5GuTUuk4nJ2w02LnEPhL4Y5OHw4EjmPcxl CZKW6X5OgbVsFp3vTuG95um4ZqRQha4LKQbhK9OPxkX5pjilrYPsf9StcXxKcgJ0UevS O0a9WMzf0kN84CW785yMlPIseqX40lDlWeiKp4EdcIj89ct07hJtrr0bmXddF0Eq6V1X 02pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jNPF+pmf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id e2-20020a637442000000b005859da6172bsi1743388pgn.727.2023.10.05.09.58.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 09:58:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@chromium.org header.s=google header.b=jNPF+pmf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id B576C801F8E4; Fri, 29 Sep 2023 11:44:56 -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 S233459AbjI2Som (ORCPT + 99 others); Fri, 29 Sep 2023 14:44:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233321AbjI2Sok (ORCPT ); Fri, 29 Sep 2023 14:44:40 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0B7419F for ; Fri, 29 Sep 2023 11:44:38 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-279013f9875so3459944a91.2 for ; Fri, 29 Sep 2023 11:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696013078; x=1696617878; 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=aC3vmtsMplEH+RxAjyp3uzmOqoOqrVPhV6qAz/nGJcs=; b=jNPF+pmfpOrk7dDWm+R7ca8CI5cmfU35+RwiIvt9sFgcFqIZXf4kh5OEbfWogEW6Sa +NpEsPmDcsujg8qmSyPaDmX7idxklTMLlvOy4pR2NzX35h76wJNhoNSYIiZPG/0k++2d P8Tecf7+XIOG9PKCvXhCVmO6io384UCApJjEk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696013078; x=1696617878; 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=aC3vmtsMplEH+RxAjyp3uzmOqoOqrVPhV6qAz/nGJcs=; b=RvyjmM3gseR9B+9T6UYN/KTIxTgakFxq8+kpKxx+5eXXOE0M+t0bZlDe1C60c4+WXu Q9sISj13whmq5H5pUTLrYMl/EnC5WKblOkJeTFwnxzZsb9VhnkeVcrNeg83v3gEdsWI0 6bc/J04RokRsOFEr9iANFxkWUeyI792czINI2lOfSIHDsDfqHzfeu3QCno6jiIqeSK31 dX8FRFtwekhdgDnMr+MFQpW5TpSjPcskyiLE70Zai9mVkLKXd+ZjzBUc024NJwgqknBx olAkrLhDcQS83f37TGL4PCgXoVTYsSJTfPm4ba9ElrhUHw9qeOvuOr0pgC5zG7vx4Tx/ RWkg== X-Gm-Message-State: AOJu0Yz0kmuiwKK+4V4+ZlYbvyg0yxfoUdHgN6qi2o1aL9ep8ZcuO1QB IJPByg55sk1IV+hz5eSjStghuQ== X-Received: by 2002:a17:90a:4f0d:b0:268:ca76:64a with SMTP id p13-20020a17090a4f0d00b00268ca76064amr4370278pjh.49.1696013078334; Fri, 29 Sep 2023 11:44:38 -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 15-20020a17090a198f00b002776350b50dsm1954643pji.29.2023.09.29.11.44.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 11:44:38 -0700 (PDT) From: Kees Cook To: "Rafael J. Wysocki" , Viresh Kumar , Justin Stitt Cc: Kees Cook , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] cpufreq: refactor deprecated strncpy Date: Fri, 29 Sep 2023 11:44:36 -0700 Message-Id: <169601307508.3009351.8138166691228989474.b4-ty@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230913-strncpy-drivers-cpufreq-cpufreq-c-v1-1-f1608bfeff63@google.com> References: <20230913-strncpy-drivers-cpufreq-cpufreq-c-v1-1-f1608bfeff63@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 morse.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 (morse.vger.email [0.0.0.0]); Fri, 29 Sep 2023 11:44:56 -0700 (PDT) On Wed, 13 Sep 2023 00:07:21 +0000, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > We should prefer more robust and less ambiguous string interfaces. > > Both `policy->last_governor` and `default_governor` are expected to be > NUL-terminated which is shown by their heavy usage with other string > apis like `strcmp`. > > [...] Applied to for-next/hardening, thanks! [1/1] cpufreq: refactor deprecated strncpy https://git.kernel.org/kees/c/598b1b1c8f35 Take care, -- Kees Cook