[PATCH] SQUASHME: pnfsd-files: prevent NULL deref in nfsd4_pnfs_dlm_getdevinfo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If allocation failed and fl_device_list is NULL then fl_device_length
must be set to zero to prevent freeing its contents on exit at out:

Signed-off-by: Benny Halevy <bhalevy@xxxxxxxxxxx>
---
 fs/nfsd/nfs4pnfsdlm.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/nfsd/nfs4pnfsdlm.c b/fs/nfsd/nfs4pnfsdlm.c
index ffe1c32..18d4c0d 100644
--- a/fs/nfsd/nfs4pnfsdlm.c
+++ b/fs/nfsd/nfs4pnfsdlm.c
@@ -291,6 +291,7 @@ static int nfsd4_pnfs_dlm_getdevinfo(struct super_block *sb,
 	if (!fdev.fl_device_list) {
 		printk(KERN_ERR "%s: ERROR: unable to kmalloc a device list "
 			"buffer for %d DSes.\n", __func__, i);
+		fdev.fl_device_length = 0;
 		goto out;
 	}
 
-- 
1.6.6.1

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux