From: Andrew Morton <akpm@linux-foundation.org>
To: tejas bharambe <tejas.bharambe@outlook.com>
Cc: Tejas Bharambe <thbharam@gmail.com>,
"ocfs2-devel@lists.linux.dev" <ocfs2-devel@lists.linux.dev>,
"mark@fasheh.com" <mark@fasheh.com>,
"jlbec@evilplan.org" <jlbec@evilplan.org>,
"joseph.qi@linux.alibaba.com" <joseph.qi@linux.alibaba.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"syzbot+a49010a0e8fcdeea075f@syzkaller.appspotmail.com"
<syzbot+a49010a0e8fcdeea075f@syzkaller.appspotmail.com>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH v4] ocfs2: fix use-after-free in ocfs2_fault() when VM_FAULT_RETRY
Date: Sat, 4 Apr 2026 17:50:40 -0700 [thread overview]
Message-ID: <20260404175040.40a746040ddb0cb5ce347fe3@linux-foundation.org> (raw)
In-Reply-To: <JH0PR06MB66320ABCFAD8F239FE5112B2895CA@JH0PR06MB6632.apcprd06.prod.outlook.com>
On Sun, 5 Apr 2026 00:30:14 +0000 tejas bharambe <tejas.bharambe@outlook.com> wrote:
> Following is my response for question posted on https://sashiko.dev/#/patchset/20260403035333.136824-1-tejas.bharambe%40outlook.com
>
>
> No. For ocfs2_fault() to be executing, the file must be open and
> the process holds an active file descriptor. The inode's lifetime
> is tied to the file's reference count, which remains held by the
> file descriptor for the duration of the fault handler. munmap()
> can free the VMA (decrementing vm_file's refcount) but cannot
> free the inode as long as the file descriptor is open. The faulting
> thread cannot call close() while it is inside the fault handler,
> so the inode is guaranteed to outlive the trace call.
I don't think that's the scenario which Sashiko is suggesting.
Suppose userspace does
fd = open(...);
p = mmap(fd, ...);
close(fd);
Now, that mmap is the only ref against fd.
Now, suppose that userspace does munmap() while another thread is in
the fault handler.
next prev parent reply other threads:[~2026-04-05 0:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-03 3:53 [PATCH v4] ocfs2: fix use-after-free in ocfs2_fault() when VM_FAULT_RETRY Tejas Bharambe
2026-04-03 19:29 ` Andrew Morton
2026-04-05 0:30 ` tejas bharambe
2026-04-05 0:50 ` Andrew Morton [this message]
2026-04-08 3:50 ` tejas bharambe
2026-04-08 5:46 ` Joseph Qi
2026-04-08 20:12 ` Andrew Morton
2026-04-10 8:01 ` Tejas Bharambe
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=20260404175040.40a746040ddb0cb5ce347fe3@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=jlbec@evilplan.org \
--cc=joseph.qi@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark@fasheh.com \
--cc=ocfs2-devel@lists.linux.dev \
--cc=stable@vger.kernel.org \
--cc=syzbot+a49010a0e8fcdeea075f@syzkaller.appspotmail.com \
--cc=tejas.bharambe@outlook.com \
--cc=thbharam@gmail.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