NFSv4.1: Make sure nfsd can decode SP4_SSV correctly at exchange_id
Subsystems (2)
PATCH 1/1 NFSv4.1: Make sure nfsd can decode SP4_SSV correctly at exchange_id
According to RFC, the argument of ssv_sp_parms4 is:
struct ssv_sp_parms4 {
state_protect_ops4 ssp_ops;
sec_oid4 ssp_hash_algs<>;
sec_oid4 ssp_encr_algs<>;
uint32_t ssp_window;
uint32_t ssp_num_gss_handles;
};If client send a exchange_id with SP4_SSV, server cann't decode the SP4_SSV's ssp_hash_algs and ssp_encr_algs arguments correctly.
Because the kernel treat the two arguments as a signal sec_oid4 struct, but should be a set of sec_oid4 struct.
--- fs/nfsd/nfs4xdr.c | 22 +++++++++++++++------- 1 files changed, 15 insertions(+), 7 deletions(-)
fs/nfsd/nfs4xdr.c +15 -7
@@ -1005,7 +1005,7 @@ static __be32 nfsd4_decode_exchange_id(struct nfsd4_compoundargs *argp, struct nfsd4_exchange_id *exid) { - int dummy; + int dummy, tmp;DECODE_HEAD ;READ_BUF (NFS4_VERIFIER_SIZE );
@@ -1053,15 +1053,23 @@ nfsd4_decode_exchange_id(struct nfsd4_compoundargs *argp,/* ssp_hash_algs<> */ READ_BUF (4 ); -READ32 (dummy); -READ_BUF (dummy); - p +=XDR_QUADLEN (dummy); +READ32 (tmp); +while (tmp--) { +READ_BUF (4 ); +READ32 (dummy); +READ_BUF (dummy); + p +=XDR_QUADLEN (dummy); + }/* ssp_encr_algs<> */ READ_BUF (4 ); -READ32 (dummy); -READ_BUF (dummy); - p +=XDR_QUADLEN (dummy); +READ32 (tmp); +while (tmp--) { +READ_BUF (4 ); +READ32 (dummy); +READ_BUF (dummy); + p +=XDR_QUADLEN (dummy); + }/* ssp_window and ssp_num_gss_handles */ READ_BUF (8 );
Signature · 1 line
1.7.0.1
According to RFC, the argument of ssv_sp_parms4 is:
struct ssv_sp_parms4 {
state_protect_ops4 ssp_ops;
sec_oid4 ssp_hash_algs<>;
sec_oid4 ssp_encr_algs<>;
uint32_t ssp_window;
uint32_t ssp_num_gss_handles;
};If client send a exchange_id with SP4_SSV, server cann't decode the SP4_SSV's ssp_hash_algs and ssp_encr_algs arguments correctly.
Because the kernel treat the two arguments as a signal sec_oid4 struct, but should be a set of sec_oid4 struct.
--- fs/nfsd/nfs4xdr.c | 22 +++++++++++++++------- 1 files changed, 15 insertions(+), 7 deletions(-)
fs/nfsd/nfs4xdr.c +15 -7
@@ -1005,7 +1005,7 @@ static __be32 nfsd4_decode_exchange_id(struct nfsd4_compoundargs *argp, struct nfsd4_exchange_id *exid) { - int dummy; + int dummy, tmp;DECODE_HEAD ;READ_BUF (NFS4_VERIFIER_SIZE );
@@ -1053,15 +1053,23 @@ nfsd4_decode_exchange_id(struct nfsd4_compoundargs *argp,/* ssp_hash_algs<> */ READ_BUF (4 ); -READ32 (dummy); -READ_BUF (dummy); - p +=XDR_QUADLEN (dummy); +READ32 (tmp); +while (tmp--) { +READ_BUF (4 ); +READ32 (dummy); +READ_BUF (dummy); + p +=XDR_QUADLEN (dummy); + }/* ssp_encr_algs<> */ READ_BUF (4 ); -READ32 (dummy); -READ_BUF (dummy); - p +=XDR_QUADLEN (dummy); +READ32 (tmp); +while (tmp--) { +READ_BUF (4 ); +READ32 (dummy); +READ_BUF (dummy); + p +=XDR_QUADLEN (dummy); + }/* ssp_window and ssp_num_gss_handles */ READ_BUF (8 );
-- 1.7.0.1
Quoted 10 lines · Mi Jinlong
According to RFC, the argument of
ssv_sp_parms4is:struct ssv_sp_parms4 { state_protect_ops4 ssp_ops; sec_oid4 ssp_hash_algs<>; sec_oid4 ssp_encr_algs<>; uint32_t ssp_window; uint32_t ssp_num_gss_handles; };
Quoted 5 lines
If client send a
exchange_idwithSP4_SSV, server cann't decode the SP4_SSV'sssp_hash_algsandssp_encr_algsarguments correctly.Because the kernel treat the two arguments as a signal
sec_oid4struct, but should be a set ofsec_oid4struct.
That looks correct, thanks.
(How are you testing this?)
--b.
Quoted 55 lines
Signed-off-by Mi Jinlong <[email protected]>--- fs/nfsd/nfs4xdr.c | 22 +++++++++++++++------- 1 files changed, 15 insertions(+), 7 deletions(-)fs/nfsd/nfs4xdr.c +15
-9@@ -1005,7 +1005,7 @@ static __be32 nfsd4_decode_exchange_id(struct nfsd4_compoundargs *argp, struct nfsd4_exchange_id *exid) { - int dummy; + int dummy, tmp;DECODE_HEAD ;READ_BUF (NFS4_VERIFIER_SIZE );@@ -1053,15 +1053,23 @@ nfsd4_decode_exchange_id(struct nfsd4_compoundargs *argp,/* ssp_hash_algs<> */ READ_BUF (4 ); -READ32 (dummy); -READ_BUF (dummy); - p +=XDR_QUADLEN (dummy); +READ32 (tmp); +while (tmp--) { +READ_BUF (4 ); +READ32 (dummy); +READ_BUF (dummy); + p +=XDR_QUADLEN (dummy); + }/* ssp_encr_algs<> */ READ_BUF (4 ); -READ32 (dummy); -READ_BUF (dummy); - p +=XDR_QUADLEN (dummy); +READ32 (tmp); +while (tmp--) { +READ_BUF (4 ); +READ32 (dummy); +READ_BUF (dummy); + p +=XDR_QUADLEN (dummy); + }/* ssp_window and ssp_num_gss_handles */ READ_BUF (8 ); -- 1.7.0.1 --To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
J. Bruce Fields :
Quoted 14 lines · Mi Jinlong
Quoted 13 lines
According to RFC, the argument of
ssv_sp_parms4is:struct ssv_sp_parms4 { state_protect_ops4 ssp_ops; sec_oid4 ssp_hash_algs<>; sec_oid4 ssp_encr_algs<>; uint32_t ssp_window; uint32_t ssp_num_gss_handles; };If client send a
exchange_idwithSP4_SSV, server cann't decode the SP4_SSV'sssp_hash_algsandssp_encr_algsarguments correctly.
Quoted 6 lines
Quoted 2 lines
Because the kernel treat the two arguments as a signal
sec_oid4struct, but should be a set ofsec_oid4struct.That looks correct, thanks.
(How are you testing this?)
I use the pynfs41 test site at your git tree. (EID50)
thanks,
Mi Jinlong
Quoted 63 lines
--b.
Quoted 51 lines
Signed-off-by Mi Jinlong <[email protected]>--- fs/nfsd/nfs4xdr.c | 22 +++++++++++++++------- 1 files changed, 15 insertions(+), 7 deletions(-)fs/nfsd/nfs4xdr.c +15
-9@@ -1005,7 +1005,7 @@ static __be32 nfsd4_decode_exchange_id(struct nfsd4_compoundargs *argp, struct nfsd4_exchange_id *exid) { - int dummy; + int dummy, tmp;DECODE_HEAD ;READ_BUF (NFS4_VERIFIER_SIZE );@@ -1053,15 +1053,23 @@ nfsd4_decode_exchange_id(struct nfsd4_compoundargs *argp,/* ssp_hash_algs<> */ READ_BUF (4 ); -READ32 (dummy); -READ_BUF (dummy); - p +=XDR_QUADLEN (dummy); +READ32 (tmp); +while (tmp--) { +READ_BUF (4 ); +READ32 (dummy); +READ_BUF (dummy); + p +=XDR_QUADLEN (dummy); + }/* ssp_encr_algs<> */ READ_BUF (4 ); -READ32 (dummy); -READ_BUF (dummy); - p +=XDR_QUADLEN (dummy); +READ32 (tmp); +while (tmp--) { +READ_BUF (4 ); +READ32 (dummy); +READ_BUF (dummy); + p +=XDR_QUADLEN (dummy); + }/* ssp_window and ssp_num_gss_handles */ READ_BUF (8 ); -- 1.7.0.1 --Quoted 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 3 lines
---- Regards Mi Jinlong
Quoted 17 lines · Mi Jinlong
J. Bruce Fields :
Quoted 14 lines · Mi Jinlong
Quoted 13 lines
According to RFC, the argument of
ssv_sp_parms4is:struct ssv_sp_parms4 { state_protect_ops4 ssp_ops; sec_oid4 ssp_hash_algs<>; sec_oid4 ssp_encr_algs<>; uint32_t ssp_window; uint32_t ssp_num_gss_handles; };If client send a
exchange_idwithSP4_SSV, server cann't decode the SP4_SSV'sssp_hash_algsandssp_encr_algsarguments correctly.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Because the kernel treat the two arguments as a signal
sec_oid4struct, but should be a set ofsec_oid4struct.That looks correct, thanks.
(How are you testing this?)
I use the pynfs41 test site at your git tree. (EID50)
Got it, thanks; queueing for 2.6.38.
--b.
Quoted 73 lines
thanks,
Mi JinlongQuoted 63 lines
--b.
Quoted 51 lines
Signed-off-by Mi Jinlong <[email protected]>--- fs/nfsd/nfs4xdr.c | 22 +++++++++++++++------- 1 files changed, 15 insertions(+), 7 deletions(-)fs/nfsd/nfs4xdr.c +15
-9@@ -1005,7 +1005,7 @@ static __be32 nfsd4_decode_exchange_id(struct nfsd4_compoundargs *argp, struct nfsd4_exchange_id *exid) { - int dummy; + int dummy, tmp;DECODE_HEAD ;READ_BUF (NFS4_VERIFIER_SIZE );@@ -1053,15 +1053,23 @@ nfsd4_decode_exchange_id(struct nfsd4_compoundargs *argp,/* ssp_hash_algs<> */ READ_BUF (4 ); -READ32 (dummy); -READ_BUF (dummy); - p +=XDR_QUADLEN (dummy); +READ32 (tmp); +while (tmp--) { +READ_BUF (4 ); +READ32 (dummy); +READ_BUF (dummy); + p +=XDR_QUADLEN (dummy); + }/* ssp_encr_algs<> */ READ_BUF (4 ); -READ32 (dummy); -READ_BUF (dummy); - p +=XDR_QUADLEN (dummy); +READ32 (tmp); +while (tmp--) { +READ_BUF (4 ); +READ32 (dummy); +READ_BUF (dummy); + p +=XDR_QUADLEN (dummy); + }/* ssp_window and ssp_num_gss_handles */ READ_BUF (8 ); -- 1.7.0.1 --Quoted 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.htmlSignature · 3 lines
---- Regards Mi Jinlong