Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1283791
| From | Sasha Levin <sasha.levin@oracle.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: time: signed integer overflow in ktime_add_safe |
| Date | 2015-12-04 13:50 +0100 |
| Message-ID | <qBXYe-2HT-25@gated-at.bofh.it> (permalink) |
| References | <qBWps-1TF-17@gated-at.bofh.it> <qBWSu-23x-9@gated-at.bofh.it> <qBWSu-23x-11@gated-at.bofh.it> <qBX2a-279-13@gated-at.bofh.it> <qBXbQ-2b5-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 12/04/2015 06:49 AM, Dmitry Vyukov wrote:
>> I'm not so sure. It finds real bugs, e.g. 32a8df4e0b33f ("sched: Fix odd values in effective_load() calculations")
>> > was caught by UBSAN
>> > I guess that we could fix most signed overflows simply by casting to unsigned type.
>
> Yeah, overflows can be just unexpected in some places (not an intended
> reliance on defined overflow). If we want to continue finding real
> bugs, we need to start fixing the false positives.
Right, this check finds real bugs, but quite a few false positives because
we tell gcc specifically that this overflow is really okay, and people have
relied on that.
On the other hand, we can't "fix" the code that's triggering it since nothing
is actually broken - in ktime_add_safe() for example we'd overflow, but then
we're checking for overflow, so the code is perfectly fine.
Maybe UBSAN annotations are the way to go here?
Thanks,
Sasha
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
time: signed integer overflow in ktime_add_safe Dmitry Vyukov <dvyukov@google.com> - 2015-12-04 12:10 +0100
Re: time: signed integer overflow in ktime_add_safe Hannes Frederic Sowa <hannes@stressinduktion.org> - 2015-12-04 12:40 +0100
Re: time: signed integer overflow in ktime_add_safe Andrey Ryabinin <ryabinin.a.a@gmail.com> - 2015-12-04 12:40 +0100
Re: time: signed integer overflow in ktime_add_safe Dmitry Vyukov <dvyukov@google.com> - 2015-12-04 12:40 +0100
Re: time: signed integer overflow in ktime_add_safe Andrey Ryabinin <ryabinin.a.a@gmail.com> - 2015-12-04 12:50 +0100
Re: time: signed integer overflow in ktime_add_safe Dmitry Vyukov <dvyukov@google.com> - 2015-12-04 13:00 +0100
Re: time: signed integer overflow in ktime_add_safe Sasha Levin <sasha.levin@oracle.com> - 2015-12-04 13:50 +0100
csiph-web