Re: [PATCH 1/2] perf: look up address filter files without ctx->mutex held

From: Christian Brauner

Date: Wed Dec 02 2026 - 08:26:02 EST


On Fri, Nov 27, 2026 at 12:57:45PM +0100, Peter Zijlstra wrote:
> > I think we should do an O_PATH open of the target file and then you
> > call:
> >
> > file = filp_open(filename, O_PATH | O_REGULAR, 0)
> >
> > if (file_check_backing(file, FMODE_PATH, 0))
> > return -EINVAL;
>
> We must close file, or does it have __free(file) on or something?

Yes, there's a cleanup class for this.

> > We had a whole bug class where various subsystems that used backing
> > files just allowed arbitrary files to be used.
>
> This seems fine to me and can go in independent of this locking stuff.

Ok, I haven't heard anything from Adrian. I'll wait a little and then go
ahead.