xfs
[Top] [All Lists]

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

To: Vasiliy Kulikov <segooon@xxxxxxxxx>
Subject: Re: [PATCH] xfs: linux-2.6: xfs_ioctl: fix information leak to userland
From: Alex Elder <aelder@xxxxxxx>
Date: Fri, 05 Nov 2010 12:19:49 -0500
Cc: kernel-janitors@xxxxxxxxxxxxxxx, 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
In-reply-to: <1288448778-5373-1-git-send-email-segooon@xxxxxxxxx>
References: <1288448778-5373-1-git-send-email-segooon@xxxxxxxxx>
Reply-to: aelder@xxxxxxx
On Sat, 2010-10-30 at 18:26 +0400, Vasiliy Kulikov wrote:
> 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;
>  

Looks good.  I will take this in and will send
it to Linus for 2.6.37.  Thanks.

Reviewed-by: Alex Elder <aelder@xxxxxxx>

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