public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: linux-2.6: xfs_ioctl: fix information leak to userland
@ 2010-10-30 14:26 Vasiliy Kulikov
  2010-11-05 17:19 ` Alex Elder
  0 siblings, 1 reply; 2+ messages in thread
From: Vasiliy Kulikov @ 2010-10-30 14:26 UTC (permalink / raw)
  To: kernel-janitors
  Cc: Alex Elder, xfs-masters, Christoph Hellwig, Dave Chinner,
	Eric Sandeen, Arkadiusz Miśkiewicz, xfs, linux-kernel

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>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] xfs: linux-2.6: xfs_ioctl: fix information leak to userland
  2010-10-30 14:26 [PATCH] xfs: linux-2.6: xfs_ioctl: fix information leak to userland Vasiliy Kulikov
@ 2010-11-05 17:19 ` Alex Elder
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Elder @ 2010-11-05 17:19 UTC (permalink / raw)
  To: Vasiliy Kulikov
  Cc: kernel-janitors, xfs-masters, Christoph Hellwig, Dave Chinner,
	Eric Sandeen, Arkadiusz Miśkiewicz, xfs, linux-kernel

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@gmail.com>
> ---
>  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@sgi.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-11-05 17:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-30 14:26 [PATCH] xfs: linux-2.6: xfs_ioctl: fix information leak to userland Vasiliy Kulikov
2010-11-05 17:19 ` Alex Elder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox