Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp107520rdb; Fri, 29 Sep 2023 19:22:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG8kKbtAhoZalBv8463c5g8Nr1FMbHDZx5YR2St6llqzFUM9Jn7QirWb8Lc4xEhgk1uNBVk X-Received: by 2002:a05:6a20:3955:b0:148:f16f:113f with SMTP id r21-20020a056a20395500b00148f16f113fmr6447875pzg.12.1696040533516; Fri, 29 Sep 2023 19:22:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696040533; cv=none; d=google.com; s=arc-20160816; b=eWGubhabsvXfIpr2vhDuk4/0BCSf8bLFqX8JwoEY/pj3l1PUpg/hO3HeyIBwJWRFYQ 0KxuQ9K/dbnnSdrDyCaDNwbsKIqWa/8d2YBnSQNzUZYYYbDc5d7/LY+/QWpN4NgEY5PJ NSIiJPikuwle4qgEZcczRlA7SA3v7Z6+hh6kJVZ7KROBVGPLZKSVgLZubjk8zi08BNf9 vVichyGjQm75A7YHAENYtOKiD7qjWi5OemofpbgieTiBXPDax1F4+LbXNposLHdB+Joe 82mElfUGv57CsE/CNMZq0VFHjgCQQn77t5VgOg/Ekym/qYAC485IBCQI+ey/N8goqvXx TtAw== 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=IWeOES3N3vd1Zvv6AwyKn/S5xF8EcGUaGZeIj8wdjdU=; fh=hMODD+ToGG7RVFboLsuzyWjhtYMxSLpMS9lJ+KsAumI=; b=FaO3xpeIGceM8xLFj58tgw9iEeG6sMNdI207PrUmU3LV6yD+fY1A/5huvo6TQY8J8H x4jAGQxnGinM8SO5AmTWL8knTtUQA01XhkuOjBUREoJBCKkeyB7oTEfwNeCKFm0BPTfY 7dQumnc5rUp18pTNJMVkxQQiCZImkXkMaM6fQFJ7bklaEDCbaipgZ7JwQ0o5IYvv4rW4 soUPph4MvGBAV8jght1s6ByArJMVstc5j4IfiiNV0C+RTlrGHXsGuOm+iSchhK8yqz35 GcwP3s3xWUX1Bp9SXMI+9wVL8s3Nw+lYLwrrEOZQlXOhbDf3u+8mYmZLGBzQ+maGPlHs ODPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HmUFAh0z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id t20-20020a170902d29400b001c74876f029si2239893plc.381.2023.09.29.19.22.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 19:22:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HmUFAh0z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id B687780774BA; Fri, 29 Sep 2023 12:00:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233433AbjI2TAR (ORCPT + 99 others); Fri, 29 Sep 2023 15:00:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233058AbjI2TAR (ORCPT ); Fri, 29 Sep 2023 15:00:17 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 916601B0 for ; Fri, 29 Sep 2023 12:00:14 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1c5c91bec75so110567255ad.3 for ; Fri, 29 Sep 2023 12:00:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696014014; x=1696618814; 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=IWeOES3N3vd1Zvv6AwyKn/S5xF8EcGUaGZeIj8wdjdU=; b=HmUFAh0zkPL1XTlG3DZ98Lpg/V1SZuEoX3aE4Kq4pkbqrC/H5wIzMA5Ey8VsHEKpWi yVIgAWX00Y05jmBg31jtYE0BWtl1wsLbgOvemDcQMYAbhvOv2CroSlN2gc/aC1DsIZvx S5UPmWcHXmwWMUaXbAqPSB6V5YPgKaXCe/rr0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696014014; x=1696618814; 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=IWeOES3N3vd1Zvv6AwyKn/S5xF8EcGUaGZeIj8wdjdU=; b=kJ2UC8illnDrYkcsAbcrYgXhmOoc5SnWayYtAuP58lp4xTwu5LQyPXi8bRYvqE4MU0 So4opLxOIPoD5JtLKu1cN8AL1NzgMuVS6nSTWsLRroFOe3pk9EhCBDBymqDP1P5Mwhb5 OR1R0IY1r3Vwj+hsdm1xRxhOdrqQ0Lw++/cVqy3rUweo1twlchSQrwYN4PvcJtWvWoVc SSDBcvriSS/NGpc392Dlmh0W4o6mPinh7OvVR0JUtcwIC0SdMTcQK8e3at1yS27GxPEU sfcTL7FxFobbMHrdwwP9ns9y0nPKj5fsh1QBEAC9yiPfs2uDZxbTvD9yL24Cc6GGU5/G dB9A== X-Gm-Message-State: AOJu0Yw13X+lpR5GWXO/7xwOaeIwNT6d9BmFG091F/r5mtJS5y2ZrXMr 14jCfb6rNkNlAwwmTu4r68qZLg== X-Received: by 2002:a17:902:da86:b0:1c6:bb3:29e6 with SMTP id j6-20020a170902da8600b001c60bb329e6mr5492246plx.16.1696014014059; Fri, 29 Sep 2023 12:00:14 -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 h4-20020a170902eec400b001c73d829fb0sm3014497plb.32.2023.09.29.12.00.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 12:00:13 -0700 (PDT) From: Kees Cook To: Borislav Petkov , Tony Luck , James Morse , Mauro Carvalho Chehab , Robert Richter , Justin Stitt Cc: Kees Cook , linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v4] EDAC/mc_sysfs: refactor deprecated strncpy Date: Fri, 29 Sep 2023 12:00:05 -0700 Message-Id: <169601400133.3011505.5557490241780172507.b4-ty@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230918-strncpy-drivers-edac-edac_mc_sysfs-c-v4-1-38a23d2fcdd8@google.com> References: <20230918-strncpy-drivers-edac-edac_mc_sysfs-c-v4-1-38a23d2fcdd8@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 groat.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 (groat.vger.email [0.0.0.0]); Fri, 29 Sep 2023 12:00:26 -0700 (PDT) On Mon, 18 Sep 2023 07:47:29 +0000, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > We've already calculated bounds, possible truncation with '\0' or '\n' > and manually NUL-terminated. The situation is now just a literal byte > copy from one buffer to another, let's treat it as such and use a less > ambiguous interface in memcpy. > > [...] Applied to for-next/hardening, thanks! (Subject updated...) Take care, -- Kees Cook