Received: by 2002:a05:7208:1509:b0:82:bbfa:f723 with SMTP id o9csp528171rbf; Wed, 24 Apr 2024 10:01:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXTM1fNtOeu2ZJkbilA89e6cYkXR8l6yXiI6Ya0UnLOD36UG7wKhjoM1nnPK/YAECV+P88pKkKBUaUjVUN98kO+2q6dXEYhFa7HXILL/g== X-Google-Smtp-Source: AGHT+IHZiQCxQZGTc2yc0GcyiAJ+fF6sl7f46zWtpOfqARuIxrcvXVYzSJjMDUvcZspf43r85QXR X-Received: by 2002:a17:90a:8a12:b0:2a4:9183:c8fd with SMTP id w18-20020a17090a8a1200b002a49183c8fdmr2995846pjn.18.1713978110904; Wed, 24 Apr 2024 10:01:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713978110; cv=pass; d=google.com; s=arc-20160816; b=is8glrXcU6dT7mvdh0xIKKhcCLtBkHTnVSShuMrgQ2n1sdi8lUcuc6lfKM+ezcl5m2 NXvgLEHo+YGCUGbVMB1rneRTcbPiJ/qYl4vFV+0psXKBn5xaS6V9dEo9ypjPB5JcDvqz lmN3XINWZYMEYZEMYh29rFM/Qd9fKuHVEhEOGUxj0u9n8IMqgN786MML1KjBCczz91v0 uPLqLjTSgxljdeP+FgW1JENxYxKnK3di9DXkyi8AQrr7P+p8j6lh3EZtK/blUE5koAt2 c7beabvAUp9KNSOidZKQMF7DsUX1gsrev4nVlA24MMmD6sDqhTK1nqpqLgPxVIGs2JnW rRHQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=fN9kRZHzQ36es67HG+/JcOnjNi7DbyH3IfN5ehBmQkE=; fh=8lfAFcDs5cHg7vGUvCfiDofvXjvxG9WUDoVW9p9UCcc=; b=vQD+up2NXzJXTD/hKmLUf+shOtLZ2c+FspCBzV210Qk4SCxyjXZRrLcBaCyXd+llLJ pqj7QkkQ1BE+FYL7JN/z1PYPfIull1VxAIUWGDCOyhEbaRcEIusCW5a1jQYBWLGsbAe9 pWBXWXeESO0kPRynlIfk8YJmE2bSkVcbzLeuL62/Sn2SM/G3VSy0k67VodmHHjhOXexx 4noKHCtj7Nt8FTNRlgFY3B8x/o17YOAa+WA5MbiTymQvUdZYYzvvzq5G6+QUjcOfxMq2 dVcOHlBi0Kwy1aVmIYwvpqO/uojp8alWyhKrvbAU9AqwnTRRtbORlyDbJ75DIPUP9q5X 02Dw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iYZbtrXF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-157365-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157365-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id q9-20020a17090a304900b002ac214dea57si10571067pjl.19.2024.04.24.10.01.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 10:01:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157365-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iYZbtrXF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-157365-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157365-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 3E31A282917 for ; Wed, 24 Apr 2024 17:01:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A34F716D31D; Wed, 24 Apr 2024 17:01:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iYZbtrXF" 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 C560C158867; Wed, 24 Apr 2024 17:01:38 +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=1713978098; cv=none; b=A5cUUPGCMGxSEIqtdAH35OgbS+LL6HE5sV6oGMh5EIUKc+qbC4kATsAq4GQM+WeI4Mb2VQfnIjxhSJnkDbYTCfs4jZx3ll/70Ho35tevR6/RjVDfmIbiaJeWVoiZzUuDEl8MLAsFuXREB/kb5yth+MACJPWthYa+iuZcXkDEvDA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713978098; c=relaxed/simple; bh=w988jo+lIUr9L/JqmZ0jDECyv0nP7HP9YfsgJRNVM+8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RIZ1ApcQ9YqUp7YEKkr9KpWD+++Lddr3Wk5p8zQHoCFw1aK3sEGqxWKkLEfK5d6GOrLHQPjv6T1piyTomf3ZkbZSADBTdqjnFKEUn+08l0Bh9qZhKZyZ/LjSBSAStdT0OiLNvPiEin6uolojCRLrAYw1heb98+4brBWK5cPdZ50= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iYZbtrXF; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBEA6C113CD; Wed, 24 Apr 2024 17:01:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713978098; bh=w988jo+lIUr9L/JqmZ0jDECyv0nP7HP9YfsgJRNVM+8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=iYZbtrXFw6s2q521SVjMf/a/7XcxfIULZpFDzfe3iAg6hdL7puQMEyCQxbUScImLR I552oFPpodbHQ9brM1Dvq/w5WKI6m2pmXFO51XpHq/E7l4r8pro/VDnClsbSH1JePU dAxYjVgvpwdlDlMHpqk2niS4YOvRvukk7KRgdzD9O2Ypu0WDhGXNAD0zA2mmhmpo+Z yHMNt967CpBPmsoAaSGO2wG8TfZ/0u+I4AgCRC63k+8ay/VbT2JOYoUB3JxzFxNaop siVcEN+TaWsmOR4nyqgcr6bRMFOweTxI5BcdXSycrepUrQ9egYvnANKNBSWQNzmCPs 9aLABcyhAHEGw== Date: Wed, 24 Apr 2024 19:01:32 +0200 From: Christian Brauner To: Vinicius Costa Gomes Cc: amir73il@gmail.com, hu1.chen@intel.com, miklos@szeredi.hu, malini.bhandaru@intel.com, tim.c.chen@intel.com, mikko.ylinen@intel.com, lizhen.you@intel.com, linux-unionfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 0/3] overlayfs: Optimize override/revert creds Message-ID: <20240424-befund-unantastbar-9b0154bec6e7@brauner> References: <20240403021808.309900-1-vinicius.gomes@intel.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-Disposition: inline In-Reply-To: <20240403021808.309900-1-vinicius.gomes@intel.com> On Tue, Apr 02, 2024 at 07:18:05PM -0700, Vinicius Costa Gomes wrote: > Hi, > > Changes from RFC v3: > - Removed the warning "fixes" patches, as they could hide potencial > bugs (Christian Brauner); > - Added "cred-specific" macros (Christian Brauner), from my side, > added a few '_' to the guards to signify that the newly introduced > helper macros are preferred. > - Changed a few guard() to scoped_guard() to fix the clang (17.0.6) > compilation error about 'goto' bypassing variable initialization; > > Link to RFC v3: > > https://lore.kernel.org/r/20240216051640.197378-1-vinicius.gomes@intel.com/ > > Changes from RFC v2: > - Added separate patches for the warnings for the discarded const > when using the cleanup macros: one for DEFINE_GUARD() and one for > DEFINE_LOCK_GUARD_1() (I am uncertain if it's better to squash them > together); > - Reordered the series so the backing file patch is the first user of > the introduced helpers (Amir Goldstein); > - Change the definition of the cleanup "class" from a GUARD to a > LOCK_GUARD_1, which defines an implicit container, that allows us > to remove some variable declarations to store the overriden > credentials (Amir Goldstein); > - Replaced most of the uses of scoped_guard() with guard(), to reduce > the code churn, the remaining ones I wasn't sure if I was changing > the behavior: either they were nested (overrides "inside" > overrides) or something calls current_cred() (Amir Goldstein). > > New questions: > - The backing file callbacks are now called with the "light" > overriden credentials, so they are kind of restricted in what they > can do with their credentials, is this acceptable in general? Until we grow additional users, I think yes. Just needs to be documented. > - in ovl_rename() I had to manually call the "light" the overrides, > both using the guard() macro or using the non-light version causes > the workload to crash the kernel. I still have to investigate why > this is happening. Hints are appreciated. Do you have a reproducer? Do you have a splat from dmesg?