Re: [PATCH] ipc/mqueue: Only perform resource calculation if user valid

2018-08-24 Thread Al Viro
On Fri, Aug 24, 2018 at 02:54:39PM -0700, Kees Cook wrote: > The overflow was real, but the results went unused, so while the flaw > is harmless, it's noisy for kernel fuzzers, and the fix makes things > technically more efficient. yes, yes, yes, yes and no. Compiler is quite capable of noticing

[PATCH] ipc/mqueue: Only perform resource calculation if user valid

2018-08-24 Thread Kees Cook
Andreas Christoforou reported: UBSAN: Undefined behaviour in ipc/mqueue.c:414:49 signed integer overflow: 9 * 2305843009213693951 cannot be represented in type 'long int' ... Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x11b/0x1fe lib/dump_stack.c:113 ubsan_epilogue+0xe/0x8