diff options
| author | NeilBrown <neil@brown.name> | 2026-05-26 15:27:58 +1000 |
|---|---|---|
| committer | Chuck Lever <cel@kernel.org> | 2026-08-03 09:14:35 -0400 |
| commit | 3e2c79360c6a89975ec5b5a7d4ef937e4db91a27 (patch) | |
| tree | 04be693fab689e7bdfe5d159fc84d3b59608cc02 /tools/perf/scripts/python | |
| parent | 036c1b182f4da65363e79ec0ac276edc6b7296e5 (diff) | |
nfsd: fix possible fh_compose of wrong dentry in nfsd4_create_file()
dentry_create() can hypothetically provide a different dentry than the
one passed in. This could happen, for example, if the exported
filesystem is NFS, and the server returned to OPEN a filehandle which
matched a directory that was already in the dcache. Clearly this would
not be expected!
If this were to happen the dentry (child) that was already stored in
resfhp could be freed and later dereferenced.
We shouldn't call fh_compose() until we are certain that we have the
final dentry, so this patch moved the fh_compose() call to two places:
one for the case where the target already exists, and one after
dentry_create() where it was created.
Fixes: 64a989dbd144 ("VFS/knfsd: Teach dentry_create() to use atomic_open()")
Cc: stable@vger.kernel.org
Signed-off-by: NeilBrown <neil@brown.name>
Link: https://patch.msgid.link/20260526053004.4014491-2-neilb@ownmail.net
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Benjamin Coddington <bcodding@hammerspace.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
