Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1658376
| From | Xishi Qiu <qiuxishi@huawei.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC] ubsan: signed integer overflow in setitimer() |
| Date | 2017-06-06 08:10 +0200 |
| Message-ID | <tPfQL-4Zi-27@gated-at.bofh.it> (permalink) |
| References | <tNx5n-2ni-7@gated-at.bofh.it> <tOFkd-6N9-19@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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? Thanks, Xishi Qiu > Thanks, > > tglx > > . >
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFC] ubsan: signed integer overflow in setitimer() Xishi Qiu <qiuxishi@huawei.com> - 2017-06-01 14:10 +0200
Re: [RFC] ubsan: signed integer overflow in setitimer() Thomas Gleixner <tglx@linutronix.de> - 2017-06-04 17:10 +0200
Re: [RFC] ubsan: signed integer overflow in setitimer() Xishi Qiu <qiuxishi@huawei.com> - 2017-06-06 08:10 +0200
Re: [RFC] ubsan: signed integer overflow in setitimer() Thomas Gleixner <tglx@linutronix.de> - 2017-06-06 09:50 +0200
csiph-web