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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B56D0C64EC4 for ; Thu, 9 Mar 2023 21:17:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231310AbjCIVQ7 (ORCPT ); Thu, 9 Mar 2023 16:16:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231181AbjCIVQw (ORCPT ); Thu, 9 Mar 2023 16:16:52 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03C10FEF0D; Thu, 9 Mar 2023 13:16:43 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 62B2DB820C3; Thu, 9 Mar 2023 21:16:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75853C433D2; Thu, 9 Mar 2023 21:16:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678396601; bh=voUmVW2ZU+0OsqV39UOnPjd4AYSNunMqfKt4AnsA7g0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gFqgvOT6kjtjuSL/XJ652HnSaUoT0wz0hHvn1ZR6kZTLn4i36xgSYWNF3pLFgUUFe v2S4EiP4f8wbeZ/QDHSNaT4wI84aU+dCPHoOKTZ3u+/1SPAxPy/8fNclNGQSVtALZN rUydQF7tcYXduSNclrYg8/LATTlnQdR3VAUKYXujy3t7WWMOi9KXb8zO4/RO42UInJ rxifN/3yCLbelZ1UHisiaR7VRselyplAB1q/nilEkHkvodSeNU6wRDC6rAPzJSzilF 2zJO+YbSKTrPsROXMTwIAawuaOeGIz/VWP5ErAz7YShozzZngz5Blw1OZM8+raXAl3 sgyx8WimNdBeg== Date: Thu, 9 Mar 2023 22:16:35 +0100 From: Christian Brauner To: "Seth Forshee (DigitalOcean)" Cc: Jeff Layton , Chuck Lever , Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] filelocks: use mount idmapping for setlease permission check Message-ID: <20230309211635.wgdacgzx5s7yyqhd@wittgenstein> References: <20230309-generic_setlease-use-idmapping-v1-1-6c970395ac4d@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230309-generic_setlease-use-idmapping-v1-1-6c970395ac4d@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 09, 2023 at 02:39:09PM -0600, Seth Forshee (DigitalOcean) wrote: > A user should be allowed to take out a lease via an idmapped mount if > the fsuid matches the mapped uid of the inode. generic_setlease() is > checking the unmapped inode uid, causing these operations to be denied. > > Fix this by comparing against the mapped inode uid instead of the > unmapped uid. > > Fixes: 9caccd41541a ("fs: introduce MOUNT_ATTR_IDMAP") > Signed-off-by: Seth Forshee (DigitalOcean) > --- Thanks for catching this! This is pretty straightforward so I'll pick this up in a bit, Reviewed-by: Christian Brauner