Re: [PATCH] mm/fadvise: Fix signed overflow UBSAN complaint

2018-06-29 Thread Andrew Morton
On Fri, 29 Jun 2018 21:44:53 +0300 Andrey Ryabinin wrote: > Signed integer overflow is undefined according to the C standard. > The overflow in ksys_fadvise64_64() is deliberate, but since it is signed > overflow, UBSAN complains: > UBSAN: Undefined behaviour in mm/fadvise.c:76:10 >

[PATCH] mm/fadvise: Fix signed overflow UBSAN complaint

2018-06-29 Thread Andrey Ryabinin
Signed integer overflow is undefined according to the C standard. The overflow in ksys_fadvise64_64() is deliberate, but since it is signed overflow, UBSAN complains: UBSAN: Undefined behaviour in mm/fadvise.c:76:10 signed integer overflow: 4 + 9223372036854775805 cannot be