projects/linux·commit bf9216f9

xfs: fix kernel memory exposure problems

bf9216f9 · Darrick J. Wong <[email protected]> · 2017-04-03 12:22:39 -07:00

Fix a memory exposure problems in inumbers where we allocate an array of
structures with holes, fail to zero the holes, then blindly copy the
kernel memory contents (junk and all) into userspace.

Signed-off-by: Darrick J. Wong <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Commit
bf9216f922612d2db7666aae01e65064da2ffb3a
Parents
3dd09d5a

Changes

1 files changed · +1 −1

FileStatusAddDelContent
fs/xfs/xfs_itable.cmodified+1−1View file

fs/xfs/xfs_itable.c

View file
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c
index 2a6d9b1..26d67ce 100644
--- a/fs/xfs/xfs_itable.c
+++ b/fs/xfs/xfs_itable.c
@@ -583,7 +583,7 @@ xfs_inumbers(
return error;
bcount = MIN(left, (int)(PAGE_SIZE / sizeof(*buffer)));
- buffer = kmem_alloc(bcount * sizeof(*buffer), KM_SLEEP);
+ buffer = kmem_zalloc(bcount * sizeof(*buffer), KM_SLEEP);
do {
struct xfs_inobt_rec_incore r;
int stat;