xfs
[Top] [All Lists]

[PATCH] xfs: linux-2.6: xfs_ioctl: fix information leak to userland

To: kernel-janitors@xxxxxxxxxxxxxxx
Subject: [PATCH] xfs: linux-2.6: xfs_ioctl: fix information leak to userland
From: Vasiliy Kulikov <segooon@xxxxxxxxx>
Date: Sat, 30 Oct 2010 18:26:17 +0400
Cc: Alex Elder <aelder@xxxxxxx>, xfs-masters@xxxxxxxxxxx, Christoph Hellwig <hch@xxxxxx>, Dave Chinner <dchinner@xxxxxxxxxx>, Eric Sandeen <sandeen@xxxxxxxxxx>, Arkadiusz Miśkiewicz <arekm@xxxxxxxx>, xfs@xxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=xqIKtvaDLSuowyKapzYB3U8nf8Eac4tqNy+lpoRireg=; b=FE8zcywHH6UH0+nWCV4jatO5SPfQQnaOaFkDUmUgr7NgxkzGglHdeo8XcNawLGRrAN 7kQg0gPbu6OYUxiK5Ps4qI0gvVBFhjD0GccwT0TfPxDgkwFXRiWShb0hU3DlWmjeWisy YLhtpXeyLny344aF5KTinxnJynJmf86eGtwsk=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=HIth1nnaE5FjtN85NWf1P1KjsEXwdSTKRwn9ZncM66/nvshITRGnDFrInaldM8fqkV n2Z7+AuYHejq2vjnIBMhIwrA2qwPbLlWmnpFKQDG5AIneYvQANsj2JeI7pg+CpAMIIpF 0SotewmZp15f13mMAgvYA7djfcLJBxQ2SJtSw=
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@xxxxxxxxx>
---
 Compile tested.

 fs/xfs/linux-2.6/xfs_ioctl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c
index 2ea238f..ad442d9 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -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;
 
-- 
1.7.0.4

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] xfs: linux-2.6: xfs_ioctl: fix information leak to userland, Vasiliy Kulikov <=