linux-unionfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Cc: Christian Brauner <brauner@kernel.org>,
	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, llvm@lists.linux.dev
Subject: Re: [PATCH v1 0/3] overlayfs: Optimize override/revert creds
Date: Thu, 25 Apr 2024 10:47:32 -0700	[thread overview]
Message-ID: <20240425174732.GA270911@dev-arch.thelio-3990X> (raw)
In-Reply-To: <87y191wem5.fsf@intel.com>

On Thu, Apr 25, 2024 at 10:12:34AM -0700, Vinicius Costa Gomes wrote:
> Christian Brauner <brauner@kernel.org> writes:
> 
> > On Wed, Apr 24, 2024 at 12:15:25PM -0700, Vinicius Costa Gomes wrote:
> >> I believe the crash and clang 17 compilation error point to the same
> >> problem, that in ovl_rename() some 'goto' skips the declaration of the
> >> (implicit) variable that the guard() macro generates. And it ends up
> >> doing a revert_creds_light() on garbage memory when ovl_rename()
> >> returns.
> >
> > If this is a compiler bug this warrants at least a comment in the commit
> > message because right now people will be wondering why that place
> > doesn't use a guard. Ideally we can just use guards everywhere though
> > and report this as a bug against clang, I think.
> >
> 
> I am seeing this like a bug/mising feature in gcc (at least in the
> version I was using), as clang (correctly) refuses to compile the buggy
> code (I agree with the error).

Indeed, your description of the issue and the fact clang refuses to
compile the problematic code makes me think that
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91951 is the relevant GCC
issue.

As an aside, just in case it comes up in the future, there is a
potential issue in clang's scope checking where it would attempt to
validate all labels in a function as potential destinations of 'asm
goto()' instances in that same function, rather than just the labels
that the 'asm goto()' could jump to, which can lead to false positive
errors about jumping past the initialization of a variable declared with
cleanup.

https://github.com/ClangBuiltLinux/linux/issues/1886
https://github.com/ClangBuiltLinux/linux/issues/2003

Cheers,
Nathan

      reply	other threads:[~2024-04-25 17:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-03  2:18 [PATCH v1 0/3] overlayfs: Optimize override/revert creds Vinicius Costa Gomes
2024-04-03  2:18 ` [PATCH v1 1/3] cred: Add a light version of override/revert_creds() Vinicius Costa Gomes
2024-04-03  2:18 ` [PATCH v1 2/3] fs: Optimize credentials reference count for backing file ops Vinicius Costa Gomes
2024-04-03 15:40   ` kernel test robot
2024-04-03  2:18 ` [PATCH v1 3/3] overlayfs: Optimize credentials usage Vinicius Costa Gomes
2024-04-12 12:36 ` [PATCH v1 0/3] overlayfs: Optimize override/revert creds Miklos Szeredi
2024-04-24 19:01   ` Vinicius Costa Gomes
2024-04-25  6:06     ` Amir Goldstein
2024-04-24 17:01 ` Christian Brauner
2024-04-24 19:15   ` Vinicius Costa Gomes
2024-04-25  9:20     ` Christian Brauner
2024-04-25 17:12       ` Vinicius Costa Gomes
2024-04-25 17:47         ` Nathan Chancellor [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240425174732.GA270911@dev-arch.thelio-3990X \
    --to=nathan@kernel.org \
    --cc=amir73il@gmail.com \
    --cc=brauner@kernel.org \
    --cc=hu1.chen@intel.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=lizhen.you@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=malini.bhandaru@intel.com \
    --cc=mikko.ylinen@intel.com \
    --cc=miklos@szeredi.hu \
    --cc=tim.c.chen@intel.com \
    --cc=vinicius.gomes@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).