mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Xishi Qiu <qiuxishi@huawei.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	fenghua.yu@intel.com, Peter Zijlstra <peterz@infradead.org>,
	John Stultz <john.stultz@linaro.org>
Subject: Re: [RFC] ubsan: signed integer overflow in setitimer()
Date: Tue, 6 Jun 2017 09:43:41 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1706060939480.1885@nanos> (raw)
In-Reply-To: <593646B5.6070406@huawei.com>

On Tue, 6 Jun 2017, Xishi Qiu wrote:
> On 2017/6/4 23:06, Thomas Gleixner wrote:
> > On Thu, 1 Jun 2017, Xishi Qiu wrote:
> > 
> > Cc'ed John Stultz
> > 
> >> Hi, this is the test case, and then I got ubsan error
> >> (signed integer overflow) report, so the root cause is from
> >> user or kernel? Shall we change something in timeval_valid()?
> >>
> >>
> >> struct itimerval new_value;
> >> int ret;
> >>
> >> new_value.it_interval.tv_sec = 140673496649799L;
> >> new_value.it_interval.tv_usec = 6;
> >> new_value.it_value.tv_sec = 140673496649807L;
> >> new_value.it_value.tv_usec = 5;
> >>
> >> ret = setitimer(ITIMER_VIRTUAL, &new_value, NULL);
> >>
> >>
> >> [  533.326588] ================================================================================
> >> [  533.335346] UBSAN: Undefined behaviour in ./include/linux/time.h:239:27
> >> [  533.342155] signed integer overflow:
> >> [  533.345837] 140673496649807 * 1000000000 cannot be represented in type 'long int'
> >> [  533.422181]  set_cpu_itimer+0x49c/0x540
> >> [  533.442127]  do_setitimer+0xe1/0x540
> > 
> > We need a similar clamping of the conversion as we have for
> > timespec/val_to_ktime(). I'll have a look in the next days unless John
> > beats me to it.
> > 
> 
> Hi Thomas, anything new?

Let me spell it out to you again. I wrote on Sunday late night:

    "I'll have a look in the next days ...."

Do you really think I need a reminder after 24 hours?

Thanks,

	tglx

      reply	other threads:[~2017-06-06  7:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-01 12:03 Xishi Qiu
2017-06-04 15:06 ` Thomas Gleixner
2017-06-06  6:07   ` Xishi Qiu
2017-06-06  7:43     ` Thomas Gleixner [this message]

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=alpine.DEB.2.20.1706060939480.1885@nanos \
    --to=tglx@linutronix.de \
    --cc=fenghua.yu@intel.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=qiuxishi@huawei.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®