Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1509913lqa; Mon, 29 Apr 2024 10:22:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXsqAfyOHxgtgYLMcZKo+nGaGs7+vlnFkeWQTnaG1sswa1D+C9KQvEbavWwyL08KuvnwegKZ1o1kfn+dhmBCFxIG21gdG3LpbuAsaCFxA== X-Google-Smtp-Source: AGHT+IENIB9Shkfos0Iw2/CDg0S2dAlaveHH4bPvtvagMZJraR6pvwflnqCs9J8YFJK/ZNy9RW7G X-Received: by 2002:a17:906:c7d6:b0:a58:a13b:37b with SMTP id dc22-20020a170906c7d600b00a58a13b037bmr7125590ejb.56.1714411361100; Mon, 29 Apr 2024 10:22:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714411361; cv=pass; d=google.com; s=arc-20160816; b=tnKfgMhWDqy5qncAobhz6ZZa/pj04+MojGVEpg4MBPF0zpsd03C0PpEAE69toDHoa4 0PHNPDj4pXNYJ11m8xkI04iLF8i2cryI0vF1bjYfKw76VpMzZaH3cyl+rtcAIVv7WFLg EqL7bX7RN+g28nYqLSrg4vktH+L+b90jerZ61vV8lFo6cTUt38JUMWlzq0Lw6b+H7hYv xZHk8Owv2tEhMlN7R+50Vywi5Ix7vxuQE+wBEtAQT3wFHaX9q2NR2EK/k80fXLH/tZNs 4wLilVB/F+9F37Fldt2DBnBi+BrXtiMlFriNHsoJzZqT5TtEytAf+LautBpWo8J7XE7E KXPg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=nrsQtT6vqpidE7jqQvIsXqGG97ueXdTLbeNWZ9MIj88=; fh=LEVADusEMaeg9P4DbhjH60x2aFOS17Gq8nS4F4Q1ly0=; b=fNM9QcAguohxzY+DuohH0rLR+eYjHSgwyo6+AE12FD0ULle0cUA7Gx0dSe3hMI/asi xFdIsVFSg2hJZj9zdvdqGvX/oPmmxZdTwxj41ikLbHfvic0w9V6Aqy3X+wy2WN9zAiyM V2ci3LNj9iFMAgLTKP1DvrAU1F/Do9AhuBjQ04kGet0u4gbTzVAopynnCCKOgGHVy1gy WPyiW6V513bjq24Fhxn8QigHxZXOrZCLSW6C/tZmlqAyfTXKm3fGdOGul8YmHukw88as Spm8Ge9FyqgDtnsIXKnZYuNIRF0a37e/RvYhKdQ+J/vTtaQ3agR++w3HbrudiBfC5SdT VkQA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=eVR+i43j; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-162744-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162744-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ds16-20020a170907725000b00a5576158d82si15352017ejc.234.2024.04.29.10.22.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 10:22:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162744-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=eVR+i43j; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-162744-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162744-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A596A1F21857 for ; Mon, 29 Apr 2024 17:22:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 10F8286ADE; Mon, 29 Apr 2024 17:22:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="eVR+i43j" Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0454B8614C for ; Mon, 29 Apr 2024 17:22:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714411353; cv=none; b=sYPJltZmksevFbK4FtMqxMKmCtPYBXrqfENq03se+DpkgngXYgwHA9fcotDizpQk1eSEIPlgBj2gnHJ+qbd0yIglH8xQrXh07tqV0GwJ51HiZCDvvlFwXZkdn2OyBSqpA9LkECGu+yfOYslg/EdS7R6xJh8j5AD6+q94pzdv47U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714411353; c=relaxed/simple; bh=VLGmItW5ga3i2vucUGKN+/K2d9+so6B6J6fiy3vkgXk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=TaBfIf0aZIdf0fGyZw6w32ldweauQPR8ZENNvyIoZt3YlBJ/GKrJc4b76QtroMRnYEsMcDmAWPXvqAsGuZTBN5huXV9ZBgrezu8dUWSCjYsNGdDASRhudlC6oWsmLIgAQbyCS3QoQg3UmGg8WOUqIYt9M+BAvt87sdNH1QtrVa8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=eVR+i43j; arc=none smtp.client-ip=209.85.210.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-6eff9dc1821so4503820b3a.3 for ; Mon, 29 Apr 2024 10:22:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714411351; x=1715016151; 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=nrsQtT6vqpidE7jqQvIsXqGG97ueXdTLbeNWZ9MIj88=; b=eVR+i43jKsIETmBHxBGyttpficd1BdwjIx36z2jtTC+/CvH1x4ZV7TrQFmiYUx7Xl/ yCrGCr8Ia29y6zHkrwdLh4wtpNNn+J7PJWNjC0nDtX/tZaaJ6XCt8HIkvPeG/UlpEK89 scV6sc8TzaH/O0/VGqYjdj9ALfTNDX0KvkxnM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714411351; x=1715016151; 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=nrsQtT6vqpidE7jqQvIsXqGG97ueXdTLbeNWZ9MIj88=; b=Hjz0rKfY9Zqhq1c0evOtwKN2nt/GRWZ1vjdTlCmEKSmWBJjWkMoaTGwPHiXdahHs4B tZboOZutPCiEuU7gxcrnt0483gL8rpPn4BouyrtLWzoa2T+GZjZtkqxfmdoaT0E15CyV V2GBgb5bs1RognZqbDN1UOW9bddQmicrtmtsr/e23UhWDqrDGBrbb450XFI6IijtLfNl yt+V6YzDMOoLcVKSGo3/1wombMVtweUJCXMNczReGzsjgHO4KEk/gEtLnGrCYqIKEOki QHKRApXDjo7xykzpePANXaM+S79WpxCH7OvgKGSQAmS04xP5b4A4StJO+0pFn0iatnlF 4Bkg== X-Gm-Message-State: AOJu0YylTZX/7LY1mjwwYEtrpE7zKiU3hfbO1v519I3L8q7uZGn2AI38 VyzmNl7GgIgaWBejsudKcH17viXdPrtG5kkNt04s1BCbhJKbuYiZUOVprONNJ1H+mr3Ri232vzY = X-Received: by 2002:a05:6a20:d80f:b0:1af:3d3f:83f1 with SMTP id iv15-20020a056a20d80f00b001af3d3f83f1mr7142861pzb.44.1714411351403; Mon, 29 Apr 2024 10:22:31 -0700 (PDT) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id s4-20020a17090aa10400b002a54632931bsm21052900pjp.23.2024.04.29.10.22.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 10:22:31 -0700 (PDT) From: Kees Cook To: linux-kernel@vger.kernel.org, Justin Stitt Cc: Kees Cook , linux-hardening@vger.kernel.org Subject: Re: [PATCH] init: replace deprecated strncpy with strscpy_pad Date: Mon, 29 Apr 2024 10:22:28 -0700 Message-Id: <171441134708.2359415.3239349305778672892.b4-ty@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240402-strncpy-init-do_mounts-c-v1-1-e16d7bc20974@google.com> References: <20240402-strncpy-init-do_mounts-c-v1-1-e16d7bc20974@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit On Tue, 02 Apr 2024 20:39:49 +0000, 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 string > interfaces. > > data_page wants to be NUL-terminated and NUL-padded, use strscpy_pad to > provide both of these. data_page no longer awkwardly relies on > init_mount to perform its NUL-termination, although that sanity check is > left unchanged. > > [...] Applied to for-next/hardening, thanks! [1/1] init: replace deprecated strncpy with strscpy_pad https://git.kernel.org/kees/c/fa6475acde9a Take care, -- Kees Cook