Commit 022e5d09 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-3.11' of git://linux-nfs.org/~bfields/linux

Pull nfsd fixes from Bruce Fields:
 "Some fixes for a 4.1 feature that in retrospect probably should have
  waited for 3.12....  But it appears to be working now"

* 'for-3.11' of git://linux-nfs.org/~bfields/linux:
  nfsd: Fix SP4_MACH_CRED negotiation in EXCHANGE_ID
  nfsd4: Fix MACH_CRED NULL dereference
parents 1e24f76e 58cd57bf
...@@ -1524,7 +1524,7 @@ static inline u32 nfsd4_write_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op) ...@@ -1524,7 +1524,7 @@ static inline u32 nfsd4_write_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op)
static inline u32 nfsd4_exchange_id_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op) static inline u32 nfsd4_exchange_id_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op)
{ {
return (op_encode_hdr_size + 2 + 1 + /* eir_clientid, eir_sequenceid */\ return (op_encode_hdr_size + 2 + 1 + /* eir_clientid, eir_sequenceid */\
1 + 1 + 0 + /* eir_flags, spr_how, SP4_NONE (for now) */\ 1 + 1 + 2 + /* eir_flags, spr_how, spo_must_enforce & _allow */\
2 + /*eir_server_owner.so_minor_id */\ 2 + /*eir_server_owner.so_minor_id */\
/* eir_server_owner.so_major_id<> */\ /* eir_server_owner.so_major_id<> */\
XDR_QUADLEN(NFS4_OPAQUE_LIMIT) + 1 +\ XDR_QUADLEN(NFS4_OPAQUE_LIMIT) + 1 +\
......
...@@ -1264,6 +1264,8 @@ static bool svc_rqst_integrity_protected(struct svc_rqst *rqstp) ...@@ -1264,6 +1264,8 @@ static bool svc_rqst_integrity_protected(struct svc_rqst *rqstp)
struct svc_cred *cr = &rqstp->rq_cred; struct svc_cred *cr = &rqstp->rq_cred;
u32 service; u32 service;
if (!cr->cr_gss_mech)
return false;
service = gss_pseudoflavor_to_service(cr->cr_gss_mech, cr->cr_flavor); service = gss_pseudoflavor_to_service(cr->cr_gss_mech, cr->cr_flavor);
return service == RPC_GSS_SVC_INTEGRITY || return service == RPC_GSS_SVC_INTEGRITY ||
service == RPC_GSS_SVC_PRIVACY; service == RPC_GSS_SVC_PRIVACY;
......
...@@ -3360,7 +3360,8 @@ nfsd4_encode_exchange_id(struct nfsd4_compoundres *resp, __be32 nfserr, ...@@ -3360,7 +3360,8 @@ nfsd4_encode_exchange_id(struct nfsd4_compoundres *resp, __be32 nfserr,
8 /* eir_clientid */ + 8 /* eir_clientid */ +
4 /* eir_sequenceid */ + 4 /* eir_sequenceid */ +
4 /* eir_flags */ + 4 /* eir_flags */ +
4 /* spr_how (SP4_NONE) */ + 4 /* spr_how */ +
8 /* spo_must_enforce, spo_must_allow */ +
8 /* so_minor_id */ + 8 /* so_minor_id */ +
4 /* so_major_id.len */ + 4 /* so_major_id.len */ +
(XDR_QUADLEN(major_id_sz) * 4) + (XDR_QUADLEN(major_id_sz) * 4) +
...@@ -3372,8 +3373,6 @@ nfsd4_encode_exchange_id(struct nfsd4_compoundres *resp, __be32 nfserr, ...@@ -3372,8 +3373,6 @@ nfsd4_encode_exchange_id(struct nfsd4_compoundres *resp, __be32 nfserr,
WRITE32(exid->seqid); WRITE32(exid->seqid);
WRITE32(exid->flags); WRITE32(exid->flags);
/* state_protect4_r. Currently only support SP4_NONE */
BUG_ON(exid->spa_how != SP4_NONE);
WRITE32(exid->spa_how); WRITE32(exid->spa_how);
switch (exid->spa_how) { switch (exid->spa_how) {
case SP4_NONE: case SP4_NONE:
......
Markdown is supported
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