Re: [PATCH] alarmtimers: verify the alarmtimer_type value from clock2alarm()

From: Thomas Gleixner
Date: Tue Jul 08 2014 - 05:50:26 EST


On Tue, 8 Jul 2014, Hyogi Gim wrote:

> clock2alarm() can return a minus value. so, we cannot use this
> returned value for a index of an array. but, some functions use
> this value directly as a index of an array:
> - alarm_clock_getres()
> - alarm_clock_get()
> - alarm_timer_create()
> - alarm_timer_nsleep()
>
> add the verification code for the returned alarmtimer_type from
> clock2alarm().

That's really pointless.

These functions are called from the core posix timer code if user
space requests CLOCK_REALTIME_ALARM or CLOCK_BOOTTIME_ALARM. So the
argument is already validated.

Thanks,

tglx


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/