afs: Clear pioctl data interchange buffer before use

Avoid leaking data in pioctl interchange buffers; clear the memory
when one is allocated.

FIXES 131892 (CVE-2015-3284)

(cherry picked from commit 592a99d6e693bc640e2bdfc2e7e5243fcedc8f93)

Change-Id: I90fef404978bd7aae3eb88836bcd4f95587fd45c
This commit is contained in:
Daria Brashear 2015-07-08 14:16:41 -04:00
parent eea466507a
commit d4cd578076

View File

@ -62,6 +62,11 @@ afs_pd_alloc(struct afs_pdata *apd, size_t size)
if (apd->ptr == NULL) if (apd->ptr == NULL)
return ENOMEM; return ENOMEM;
if (size > AFS_LRALLOCSIZ)
memset(apd->ptr, 0, size + 1);
else
memset(apd->ptr, 0, AFS_LRALLOCSIZ);
apd->remaining = size; apd->remaining = size;
return 0; return 0;