Messages in this thread | | | Date | Wed, 26 Nov 2014 10:58:43 -0800 | Subject | Re: [RFC 1/2] compiler: use compiler to detect integer overflows | From | Linus Torvalds <> |
| |
On Wed, Nov 26, 2014 at 10:50 AM, Sasha Levin <sasha.levin@oracle.com> wrote: > > The kernel still has it's share of *signed* integer overflows. Example? fadvise64_64():
Yes, those would definitely be worth fixing.
[ Although quite frankly, since I know gcc already knows about the whole "check for overflow" pattern, from a QoI standpoint it is sad that it then might optimize it away. Kind of like how it would trust the type-based strict alias analysis more than the obvious *static* alias analysis. Oh well ]
I don't think coccinelle can do signedness checks, though, especially of the kind that are hidden deep behind some typedef like "loff_t". Maybe I'm wrong. Maybe smatch can? Adding Dan Carpenter to the cc..
Linus
| |