mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: scameron@beardog.cce.hp.com
To: Vasiliy Kulikov <segooon@gmail.com>
Cc: kernel-janitors@vger.kernel.org, Mike Miller <mike.miller@hp.com>,
	Jens Axboe <jaxboe@fusionio.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	iss_storagedev@hp.com, linux-kernel@vger.kernel.org,
	scameron@beardog.cce.hp.com
Subject: Re: [PATCH 1/2] block: cciss: fix information leak to userland
Date: Mon, 25 Oct 2010 09:03:16 -0500	[thread overview]
Message-ID: <20101025140316.GO9901@beardog.cce.hp.com> (raw)
In-Reply-To: <1287822311-14783-1-git-send-email-segooon@gmail.com>

On Sat, Oct 23, 2010 at 12:25:11PM +0400, Vasiliy Kulikov wrote:
> Structure IOCTL_Command_struct is copied to userland with some
> padding fields at the end of the struct unitialized.
> It leads to leaking of stack memory.

leaking of contents of kernel stack memory to userland,
not a memory leak, just to be clear.

> 
> Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
> ---
>  drivers/block/cciss.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
> index 762a81a..cd08324 100644
> --- a/drivers/block/cciss.c
> +++ b/drivers/block/cciss.c
> @@ -1142,6 +1142,7 @@ static int cciss_ioctl32_passthru(struct block_device *bdev, fmode_t mode,
>  	int err;
>  	u32 cp;
>  
> +	memset(&arg64, 0, sizeof(arg64));
>  	err = 0;
>  	err |=
>  	    copy_from_user(&arg64.LUN_info, &arg32->LUN_info,
> -- 
> 1.7.0.4

Ack.  

Thanks.

I would think hpsa needs a similar fix, and also cciss_ioctl32_big_passthru().
I suppose it's possible the big passthru alignment just "works out", (I haven't
checked), but even if that is the case, probably best not to rely on such an
accident,

-- steve



  reply	other threads:[~2010-10-25 14:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-23  8:25 Vasiliy Kulikov
2010-10-25 14:03 ` scameron [this message]
2010-10-25 14:40 ` Miller, Mike (OS Dev)
2010-10-25 16:36   ` Miller, Mike (OS Dev)
2010-10-27 15:43     ` Vasiliy Kulikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101025140316.GO9901@beardog.cce.hp.com \
    --to=scameron@beardog.cce.hp.com \
    --cc=akpm@linux-foundation.org \
    --cc=iss_storagedev@hp.com \
    --cc=jaxboe@fusionio.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.miller@hp.com \
    --cc=segooon@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome