All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Stultz <john.stultz@linaro.org>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch] staging: alarm-dev: information leak in alarm_ioctl()
Date: Mon, 03 Jun 2013 19:08:20 +0000	[thread overview]
Message-ID: <51ACE9A4.4060600@linaro.org> (raw)
In-Reply-To: <20130603090231.GB16171@debian>

On 06/03/2013 02:02 AM, Dan Carpenter wrote:
> Smatch complains that if we pass an invalid clock type then "ts" is
> never set.  We need to check for errors earlier, otherwise we end up
> passing uninitialized stack data to userspace.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Looks ok to me. Although you probably need the exact same change in the 
compat_ioctl implementation?

Otherwise, Acked-by: John Stultz <john.stultz@linaro.org>

Cc'ing Android folks for their review as well.

thanks
-john



>
> diff --git a/drivers/staging/android/alarm-dev.c b/drivers/staging/android/alarm-dev.c
> index ceb1c643..c8600d9 100644
> --- a/drivers/staging/android/alarm-dev.c
> +++ b/drivers/staging/android/alarm-dev.c
> @@ -264,6 +264,8 @@ static long alarm_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
>   	}
>   
>   	rv = alarm_do_ioctl(file, cmd, &ts);
> +	if (rv)
> +		return rv;
>   
>   	switch (ANDROID_ALARM_BASE_CMD(cmd)) {
>   	case ANDROID_ALARM_GET_TIME(0):
> @@ -272,7 +274,7 @@ static long alarm_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
>   		break;
>   	}
>   
> -	return rv;
> +	return 0;
>   }
>   #ifdef CONFIG_COMPAT
>   static long alarm_compat_ioctl(struct file *file, unsigned int cmd,


  reply	other threads:[~2013-06-03 19:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-03  9:02 [patch] staging: alarm-dev: information leak in alarm_ioctl() Dan Carpenter
2013-06-03 19:08 ` John Stultz [this message]
2013-06-04 13:13 ` [patch] staging: alarm-dev: information leak in alarm_compat_ioctl() Dan Carpenter
2013-06-05  0:07 ` Arve Hjønnevåg
2013-06-05  0:25 ` John Stultz
2013-06-05  0:49 ` Arve Hjønnevåg

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=51ACE9A4.4060600@linaro.org \
    --to=john.stultz@linaro.org \
    --cc=kernel-janitors@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.