diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2013-06-04 09:13:25 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-04 13:26:14 -0400 |
commit | 60bba385c5e86ee6a654e3345093eb48e258eb1d (patch) | |
tree | 46a792a0171a3d2b6fc7e1993c22343ad1c89574 | |
parent | e919b86c3b018c0e0c5e522354e743dcc0824ee1 (diff) |
staging: alarm-dev: information leak in alarm_compat_ioctl()
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.
Reported-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/android/alarm-dev.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/android/alarm-dev.c b/drivers/staging/android/alarm-dev.c index c8600d96b9df..6dc27dac679d 100644 --- a/drivers/staging/android/alarm-dev.c +++ b/drivers/staging/android/alarm-dev.c | |||
@@ -297,6 +297,8 @@ static long alarm_compat_ioctl(struct file *file, unsigned int cmd, | |||
297 | } | 297 | } |
298 | 298 | ||
299 | rv = alarm_do_ioctl(file, cmd, &ts); | 299 | rv = alarm_do_ioctl(file, cmd, &ts); |
300 | if (rv) | ||
301 | return rv; | ||
300 | 302 | ||
301 | switch (ANDROID_ALARM_BASE_CMD(cmd)) { | 303 | switch (ANDROID_ALARM_BASE_CMD(cmd)) { |
302 | case ANDROID_ALARM_GET_TIME(0): /* NOTE: we modified cmd above */ | 304 | case ANDROID_ALARM_GET_TIME(0): /* NOTE: we modified cmd above */ |
@@ -305,7 +307,7 @@ static long alarm_compat_ioctl(struct file *file, unsigned int cmd, | |||
305 | break; | 307 | break; |
306 | } | 308 | } |
307 | 309 | ||
308 | return rv; | 310 | return 0; |
309 | } | 311 | } |
310 | #endif | 312 | #endif |
311 | 313 | ||