JustinStitt wrote:

@efriedma-quic:
> Attributes mostly do modify the type. The few that don't, like "aligned" and 
> "may_alias", are a constant source of problems because they get accidentally 
> stripped off. (I don't have any personal experience with "noderef".)

So do you believe the current approach is a no-go? I am happy to do whatever it 
takes to get this feature over the line but hear me out:

Any way of implementing this feature is subject to corner cases and can be 
broken -- like a lot of stuff in C. For its specific use case, this attribute 
provides immense power and clarity to existing code bases; the Linux Kernel 
would benefit massively as we could then enable multiple arithmetic sanitizers. 
With my custom wraps-enabled compiler and a syzkaller instance I've already 
located [dozens of potential 
bugs](https://gist.github.com/JustinStitt/51f988421522d9ab7d5dbf1c2025e7a0) 
that could be fixed with this attribute! (and ~hundreds of others with the 
`unsigned-integer-overflow` and `implicit-integer-truncation` sanitizers -- 
which I have yet to fuzz with).

The tests made by @kees (mostly kernel-tailored) and the tests I've checked in 
with this PR all pass without regression to existing integer sanitizer uses.

I'd love to hear more folk's opinions, too. With more feedback, we can make 
this feature and its documentation/testing as solid as possible.

https://github.com/llvm/llvm-project/pull/86618
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to