Re: [Y2038] [PATCH v3 08/23] posix-timers:Convert to the 64bit methods for the timer_settime syscall function

From: Arnd Bergmann
Date: Tue May 12 2015 - 11:36:55 EST


On Tuesday 12 May 2015 22:10:14 Baolin Wang wrote:
> +static int default_timer_set64(struct k_itimer *timr, int flags,
> + struct itimerspec64 *new_setting64,
> + struct itimerspec64 *old_setting64)
> +{
> + struct k_clock *kc = clockid_to_kclock(timr->it_clock);
> + struct itimerspec new_setting, old_setting;
> + int ret;
> +
> + new_setting = itimerspec64_to_itimerspec(new_setting64);
> + old_setting = itimerspec64_to_itimerspec(old_setting64);
> + ret = kc->timer_set(timr, flags, &new_setting, &old_setting);
> + if (!ret && old_setting64)
> + *old_setting64 = itimerspec_to_itimerspec64(&old_setting);
> +
> + return ret;
> +}
>

You check old_setting64 for a NULL pointer in the second access, but not
in the first one, which is a bug. Please also check whether the variable
is used as input, output or both.

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