NFSD enforce filehandle check for source file in COPY
[ Upstream commit 754035ff79a14886e68c0c9f6fa80adb21f12b53 ] If the passed in filehandle for the source file in the COPY operation is not a regular file, the server MUST return NFS4ERR_WRONG_TYPE. Signed-off-by: Olga Kornievskaia <kolga@netapp.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> [ cel: adjusted to apply to v5.10.y ] Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
9dc20a662f
commit
30b0e49a95
@ -1758,7 +1758,13 @@ static int nfsd4_do_async_copy(void *data)
|
||||
filp = nfs42_ssc_open(copy->ss_mnt, ©->c_fh,
|
||||
©->stateid);
|
||||
if (IS_ERR(filp)) {
|
||||
nfserr = nfserr_offload_denied;
|
||||
switch (PTR_ERR(filp)) {
|
||||
case -EBADF:
|
||||
nfserr = nfserr_wrong_type;
|
||||
break;
|
||||
default:
|
||||
nfserr = nfserr_offload_denied;
|
||||
}
|
||||
/* ss_mnt will be unmounted by the laundromat */
|
||||
goto do_callback;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user