Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp320016lqh; Sat, 4 May 2024 02:43:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWpcAgKbJQO4BK9FyrDazOH6Z6MRmjfQOasRVyT4Z+4U+8iTeLOyGqSTHTcM8cfUGGft0NdE+jPoHQrxW8QTwODpaivrmXJAYS3cVNPcQ== X-Google-Smtp-Source: AGHT+IFsHZIFaOoM/uw0lymyIERvXi8kV/cBRJ3pQgeLLjBzct9Q5ssZoJGl5i/ZxI4xWyksCSn0 X-Received: by 2002:a17:906:493:b0:a59:63da:f8b with SMTP id f19-20020a170906049300b00a5963da0f8bmr3076346eja.48.1714815832872; Sat, 04 May 2024 02:43:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714815832; cv=pass; d=google.com; s=arc-20160816; b=AocyGzSwRQlfoYbFGITv0AB3skdBK88s5rnGcBMWCGmUpdAXAvF/cF/P0aRwFy8DE/ RMPZQnsMJWY2pwR0hooatMQBlDT2IaAofICp3MYPHE+8eE6RbHDolJNgUYKCEJA/PIGj EMrYdMWyJYAIpUiHYyk0SSAACFgVx6wbXgFyjm9KpQsGh7Sy+C23oPp5zYb1aroz/Cyu y0vj5IV240L20wa10xxcosL/YIDoh7CTBIKsmsrIv4bab5AvJqZsoHTIEp7crDm6s05E yOX64eN7uM09UbMQzqu4vGWLurM8cJfE/RplAe18pA/KBrQ7TP8kI1vujrzWZ6BvTXeV Y+pA== 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=ZMJnFFInBohFYwrLQuRzxOrhQ1iMIqBcC76k/Mnbe8o=; fh=LqbJUJabcyEiazAnTARIAEyCmmXiSH1uxVeNyiWuWrM=; b=XK+NfOeC/Ri3Ggh6uHVjavzc+XIYb54aMjL3fxKLl9W8RX8RxE1TpxfctLK/MAZZct CNLwwg00IbscE+AYvbXtjUME1imAf3l28vU6XlMAS5ujc2lvnUppXZRXCn43IJGKWZ/E 9F+sRNPVwcOTfnf+KSira1w/mhwaeBf7vwj53W4CaCgAaRTSLBrf3jZkhEkrqWUZsnQ5 zJ46DlinpEDX4WYSySKnmaQTBGrOHOlR6+Jm7hS19TjRgydduLz8Jo2Iy8c1yNWeaYyd 6zPtHIhaxm5gD+5MyzltFSjxqyC3Z+M+Je+E2VZGsz1CpUFuLXItU0ucb7t/IP6Kz/OH pspQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="FZZ/ZUUW"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-168574-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168574-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id o21-20020a170906359500b00a59a6b640ddsi631878ejb.434.2024.05.04.02.43.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 02:43:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168574-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="FZZ/ZUUW"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-168574-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168574-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 7C41E1F21DC1 for ; Sat, 4 May 2024 09:43:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4769B17BB9; Sat, 4 May 2024 09:43:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FZZ/ZUUW" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 680955234; Sat, 4 May 2024 09:43:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714815821; cv=none; b=pZhIARzpnuK3M44yA+JI9zBBsl/uzgccCRf7nOisT+H13payMOl6Mhllh50CsBgU+Ejcm80eEuVlTjF7xCuw1/acwsB64AAorkmFdcFBaeLPRzLqIev1YeUwtuUJcqin94GsqmpF0u1VIXYFvqide0h2M9gXRAIbiZxkMb/A9iw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714815821; c=relaxed/simple; bh=ZCpQBWEVkdN3kA167HpH494pjla/nVIxS8umjqDss8A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MdAg6mmYj3altVFozaMIGFbLOIXWAURDnWRcwrWjrWH1ZVhj+tAq5bur5DG+nh2k+DXWuN+m8lI5m6ymWcoWTvko+xUY2uckkfjjNxiHWROTP+CkH9Gbc8ATXv9taTanGrdcBRlA3fYp6puhqB8yn4X8PJNeGZOxYPAuo8h6jcE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FZZ/ZUUW; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5DDECC072AA; Sat, 4 May 2024 09:43:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714815821; bh=ZCpQBWEVkdN3kA167HpH494pjla/nVIxS8umjqDss8A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FZZ/ZUUWgQb3Wkr0+yC1HJyycrN5yQqKhRuwh1xm6GLfChUXw1PRedSdlfhh531Mw 9+T+YO5nGVagD4zM7nftEw7/qpuwdGGx5Svs/eqF0KnZC9pHa6e/CwLeftRrC/Mytt iyk5ySA0416azIV6ZhYSok4fCZGRmXNoVEE1o2ycfqcogEIfLMm9I1P7VCEOLCZqdb jLzEuSM4tY93UbqRqXCY+korpa3gQCit+bQJ38ZdIb5eVD/rLRX8UFLUwUUFtYFHj1 iaJlkY4kWMYgmSBwuNnf5qwieGqFa8b0ZJ/p73ld7Rqrm4iUkvlrh6HmZ+nGMdxw2o OOTeu1lVqQbgQ== From: Christian Brauner To: Kees Cook Cc: Christian Brauner , Peter Zijlstra , Alexander Viro , Jens Axboe , Jann Horn , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] fs: WARN when f_count resurrection is attempted Date: Sat, 4 May 2024 11:43:32 +0200 Message-ID: <20240504-redlich-amtlich-b381220dfabb@brauner> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240503201620.work.651-kees@kernel.org> References: <20240503201620.work.651-kees@kernel.org> 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" X-Developer-Signature: v=1; a=openpgp-sha256; l=1236; i=brauner@kernel.org; h=from:subject:message-id; bh=ZCpQBWEVkdN3kA167HpH494pjla/nVIxS8umjqDss8A=; b=owGbwMvMwCU28Zj0gdSKO4sYT6slMaSZMbve9H7jOzty2Q5/9wM+HzpsrJfnOmbbzxWNn5iks N5e1mB2RykLgxgXg6yYIotDu0m43HKeis1GmRowc1iZQIYwcHEKwEQM3zD8s57yuPmD/+a1fQ0z 618Xf16z6bFV/ufE/6vXL3+1uXnGo+sMf7gbX6hy7tNst9hV0XCIj+/iv8AnbC93Pv8fot3e/lJ Xhx0A X-Developer-Key: i=brauner@kernel.org; a=openpgp; fpr=4880B8C9BD0E5106FC070F4F7B3C391EFEA93624 Content-Transfer-Encoding: 8bit On Fri, 03 May 2024 13:16:25 -0700, Kees Cook wrote: > It should never happen that get_file() is called on a file with > f_count equal to zero. If this happens, a use-after-free condition > has happened[1], and we need to attempt a best-effort reporting of > the situation to help find the root cause more easily. Additionally, > this serves as a data corruption indicator that system owners using > warn_limit or panic_on_warn would like to have detected. > > [...] Applied to the vfs.misc branch of the vfs/vfs.git tree. Patches in the vfs.misc branch should appear in linux-next soon. Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it. It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated. Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch. tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs.misc [1/1] fs: WARN when f_count resurrection is attempted https://git.kernel.org/vfs/vfs/c/f6bdc7865ef4