Re: [PATCH v2 2/3] test_overflow: Add shift overflow tests

2018-07-31 Thread Kees Cook
On Tue, Jul 31, 2018 at 7:13 PM, Jason Gunthorpe wrote: > On Tue, Jul 31, 2018 at 05:00:38PM -0700, Kees Cook wrote: >> + /* Overflow: high bit falls off. */ >> + /* 10010110 */ >> + err |= TEST_ONE_SHIFT(150, 1, u8, 0, true); >> + /* 1000100010010110 */ >> + err |= TEST_ONE_SH

Re: [PATCH v2 2/3] test_overflow: Add shift overflow tests

2018-07-31 Thread Jason Gunthorpe
On Tue, Jul 31, 2018 at 05:00:38PM -0700, Kees Cook wrote: > + /* Overflow: high bit falls off. */ > + /* 10010110 */ > + err |= TEST_ONE_SHIFT(150, 1, u8, 0, true); > + /* 1000100010010110 */ > + err |= TEST_ONE_SHIFT(34966, 1, u16, 0, true); > + /* 1100100010001000