Skip to content
Commit 296f4ce8 authored by NeilBrown's avatar NeilBrown Committed by Trond Myklebust
Browse files

NFS: abort nfs_atomic_open_v23 if name is too long.



An attempt to open a file with a name longer than NFS3_MAXNAMLEN will
trigger a WARN_ON_ONCE in encode_filename3() because
nfs_atomic_open_v23() doesn't have the test on ->d_name.len that
nfs_atomic_open() has.

So add that test.

Reported-by: default avatarJames Clark <james.clark@arm.com>
Closes: https://lore.kernel.org/all/20240528105249.69200-1-james.clark@arm.com/


Fixes: 7c6c5249 ("NFS: add atomic_open for NFSv3 to handle O_TRUNC correctly.")
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent 0c8c7c55
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment