From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 043DEC4345F for ; Thu, 2 May 2024 23:05:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3A68B10F86D; Thu, 2 May 2024 23:05:01 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linux.org.uk header.i=@linux.org.uk header.b="NNuR3eFN"; dkim-atps=neutral X-Greylist: delayed 1303 seconds by postgrey-1.36 at gabe; Thu, 02 May 2024 23:04:59 UTC Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) by gabe.freedesktop.org (Postfix) with ESMTPS id DAAF910F86D; Thu, 2 May 2024 23:04:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ULmPR6hNHGKvfw+x5JwcQb4TEP/e6WVplfSdLUYOMgQ=; b=NNuR3eFNcyOS5w/isy/zTLRRaO onkClByWbmCmRL22TUag18at6tRT063x5web+FO3DofpsddeR40Fxrmy28bSrpWv7i4p+1yLeikpn EYbpPlGUaFPmC3sMIoJpMg8TQeMrNL45IYY9piBB9jmaMTUtNM1s//whrWuNmUGA+zygfNQJ37d/i Vkf//jPzrLoKGrzTQ0duPSTjOCODLfcBJjIBJqJqXbjsFGJq2qCgCqfUWSbAYzrvnLWUFE6cKzOyz 1PUzkElvAPYcXaYecp7LqBbN9Dzk1D0oicseeFPfjzh2181gcIvkDpOuetjBnt4NaFS63aMLfea70 xEGx9oWA==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1s2f8c-009pC0-1L; Thu, 02 May 2024 22:42:50 +0000 Date: Thu, 2 May 2024 23:42:50 +0100 From: Al Viro To: Kees Cook Cc: Christian Brauner , Jan Kara , linux-fsdevel@vger.kernel.org, Zack Rusin , Broadcom internal kernel review list , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Andi Shyti , Lucas De Marchi , Matt Atwood , Matthew Auld , Nirmoy Das , Jonathan Cavitt , Will Deacon , Peter Zijlstra , Boqun Feng , Mark Rutland , Kent Overstreet , Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Andrew Morton , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-kbuild@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH 5/5] fs: Convert struct file::f_count to refcount_long_t Message-ID: <20240502224250.GM2118490@ZenIV> References: <20240502222252.work.690-kees@kernel.org> <20240502223341.1835070-5-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240502223341.1835070-5-keescook@chromium.org> X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Thu, May 02, 2024 at 03:33:40PM -0700, Kees Cook wrote: > Underflow of f_count needs to be more carefully detected than it > currently is. The results of get_file() should be checked, but the > first step is detection. Redefine f_count from atomic_long_t to > refcount_long_t. It is used on fairly hot paths. What's more, it's not at all obvious what the hell would right semantics be. NAKed-by: Al Viro