Skip to contentSkip to conversation

nfsd: Fix a memory leak when meeting unsupported state_protect_how4

PATCH In review Kinglong Mee 2 participants 2 messages Feb 26, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfsd: Fix a memory leak when meeting unsupported state_protect_how4

Remember free allocated client when meeting unsupported state protect how.

Fixes 50c7b948adbd ("nfsd: minor consolidation of mach_cred handling code")
---
 fs/nfsd/nfs4state.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/nfsd/nfs4state.c +2 -1
index c484a2b..9d20c6a 100644
@@ -2408,7 +2408,8 @@ nfsd4_exchange_id(struct svc_rqst *rqstp,
 	default:				/* checked by xdr code */
 		WARN_ON_ONCE(1);
 	case SP4_SSV:
-		return nfserr_encr_alg_unsupp;
+		status = nfserr_encr_alg_unsupp;
+		goto out_nolock;
 	}
 
 	/* Cases below refer to rfc 5661 section 18.35.4: */
Signature · 1 line
2.5.0
#1 lore raw
Quoted 1 line · Kinglong Mee

Remember free allocated client when meeting unsupported state protect how.

Thanks for catching that!

Impact looks minimal for now as it's a leak in a case no current client exercises, as far as I know.

Queueing up for 4.5.

--b.

Quoted 23 lines
Fixes 50c7b948adbd ("nfsd: minor consolidation of mach_cred handling code")
---
 fs/nfsd/nfs4state.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/nfsd/nfs4state.c +2 -1
index c484a2b..9d20c6a 100644
@@ -2408,7 +2408,8 @@ nfsd4_exchange_id(struct svc_rqst *rqstp,
 	default:				/* checked by xdr code */
 		WARN_ON_ONCE(1);
 	case SP4_SSV:
-		return nfserr_encr_alg_unsupp;
+		status = nfserr_encr_alg_unsupp;
+		goto out_nolock;
 	}
 
 	/* Cases below refer to rfc 5661 section 18.35.4: */
Signature · 1 line
2.5.0