nfsd41: add flag checking for create_session
Teach the NFS server to reject invalid create_session flags. Also do some minor formatting adjustments. Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
committed by
J. Bruce Fields
parent
ac6721a13e
commit
a62573dc35
@@ -1515,6 +1515,9 @@ nfsd4_create_session(struct svc_rqst *rqstp,
|
|||||||
bool confirm_me = false;
|
bool confirm_me = false;
|
||||||
int status = 0;
|
int status = 0;
|
||||||
|
|
||||||
|
if (cr_ses->flags & ~SESSION4_FLAG_MASK_A)
|
||||||
|
return nfserr_inval;
|
||||||
|
|
||||||
nfs4_lock_state();
|
nfs4_lock_state();
|
||||||
unconf = find_unconfirmed_client(&cr_ses->clientid);
|
unconf = find_unconfirmed_client(&cr_ses->clientid);
|
||||||
conf = find_confirmed_client(&cr_ses->clientid);
|
conf = find_confirmed_client(&cr_ses->clientid);
|
||||||
|
@@ -574,6 +574,8 @@ struct nfs4_sessionid {
|
|||||||
#define SESSION4_BACK_CHAN 0x002
|
#define SESSION4_BACK_CHAN 0x002
|
||||||
#define SESSION4_RDMA 0x004
|
#define SESSION4_RDMA 0x004
|
||||||
|
|
||||||
|
#define SESSION4_FLAG_MASK_A 0x007
|
||||||
|
|
||||||
enum state_protect_how4 {
|
enum state_protect_how4 {
|
||||||
SP4_NONE = 0,
|
SP4_NONE = 0,
|
||||||
SP4_MACH_CRED = 1,
|
SP4_MACH_CRED = 1,
|
||||||
|
Reference in New Issue
Block a user