aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2015-02-11 17:27:55 -0500
committerBen Hutchings <ben@decadent.org.uk>2015-05-09 23:16:15 +0100
commit59195960edc4de55cfa89bdf7e46199ac3638589 (patch)
treefac5f3d7740f57197fd5d4a0d1b0803d9d0ff6fa /fs/nfs
parentf08ebcc0e53b33ea8c6fdfabfbd592ad84a457e5 (diff)
downloadkernel_samsung_smdk4412-59195960edc4de55cfa89bdf7e46199ac3638589.zip
kernel_samsung_smdk4412-59195960edc4de55cfa89bdf7e46199ac3638589.tar.gz
kernel_samsung_smdk4412-59195960edc4de55cfa89bdf7e46199ac3638589.tar.bz2
NFSv4.1: Fix a kfree() of uninitialised pointers in decode_cb_sequence_args
commit d8ba1f971497c19cf80da1ea5391a46a5f9fbd41 upstream. If the call to decode_rc_list() fails due to a memory allocation error, then we need to truncate the array size to ensure that we only call kfree() on those pointer that were allocated. Reported-by: David Ramos <daramos@stanford.edu> Fixes: 4aece6a19cf7f ("nfs41: cb_sequence xdr implementation") Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/callback_xdr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c
index 3fde055..6d22d35 100644
--- a/fs/nfs/callback_xdr.c
+++ b/fs/nfs/callback_xdr.c
@@ -459,8 +459,10 @@ static __be32 decode_cb_sequence_args(struct svc_rqst *rqstp,
for (i = 0; i < args->csa_nrclists; i++) {
status = decode_rc_list(xdr, &args->csa_rclists[i]);
- if (status)
+ if (status) {
+ args->csa_nrclists = i;
goto out_free;
+ }
}
}
status = 0;