Skip to content

Commit

Permalink
xfs: xfs_ioctl: fix information leak to userland
Browse files Browse the repository at this point in the history
al_hreq is copied from userland.  If al_hreq.buflen is not properly aligned
then xfs_attr_list will ignore the last bytes of kbuf.  These bytes are
unitialized.  It leads to leaking of contents of kernel stack memory.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
  • Loading branch information
Kulikov Vasiliy authored and Alex Elder committed Nov 10, 2010
1 parent 5d0af85 commit 6762b93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/xfs/linux-2.6/xfs_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ xfs_attrlist_by_handle(
if (IS_ERR(dentry))
return PTR_ERR(dentry);

kbuf = kmalloc(al_hreq.buflen, GFP_KERNEL);
kbuf = kzalloc(al_hreq.buflen, GFP_KERNEL);
if (!kbuf)
goto out_dput;

Expand Down

0 comments on commit 6762b93

Please sign in to comment.