[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAE8XmWr5hUAY7vf2R4ciysmroVCv8hdykJQbPzvA6HY6vGZRLw@mail.gmail.com>
Date: Sat, 21 Feb 2015 00:15:40 +0800
From: Dongsheng Song <dongsheng.song@...il.com>
To: Ingo Molnar <mingo@...nel.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Andrew Morton <akpm@...ux-foundation.org>,
John Stultz <john.stultz@...aro.org>
Subject: Re: [GIT PULL] time/ntp fix
On Fri, Feb 20, 2015 at 9:44 PM, Ingo Molnar <mingo@...nel.org> wrote:
> Linus,
>
> Please pull the latest timers-urgent-for-linus git tree from:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers-urgent-for-linus
>
> # HEAD: 29183a70b0b828500816bd794b3fe192fce89f73 ntp: Fixup adjtimex freq validation on 32-bit systems
>
> An adjtimex interface regression fix for 32-bit systems.
>
> Thanks,
>
> Ingo
>
> ------------------>
> John Stultz (1):
> ntp: Fixup adjtimex freq validation on 32-bit systems
>
>
> kernel/time/ntp.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
> index 4b585e0fdd22..0f60b08a4f07 100644
> --- a/kernel/time/ntp.c
> +++ b/kernel/time/ntp.c
> @@ -633,10 +633,14 @@ int ntp_validate_timex(struct timex *txc)
> if ((txc->modes & ADJ_SETOFFSET) && (!capable(CAP_SYS_TIME)))
> return -EPERM;
>
> - if (txc->modes & ADJ_FREQUENCY) {
> - if (LONG_MIN / PPM_SCALE > txc->freq)
> + /*
> + * Check for potential multiplication overflows that can
> + * only happen on 64-bit systems:
Typo ?
> + */
> + if ((txc->modes & ADJ_FREQUENCY) && (BITS_PER_LONG == 64)) {
> + if (LLONG_MIN / PPM_SCALE > txc->freq)
> return -EINVAL;
> - if (LONG_MAX / PPM_SCALE < txc->freq)
> + if (LLONG_MAX / PPM_SCALE < txc->freq)
> return -EINVAL;
> }
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists