Re: [PATCH 09/14] x86/fpu: Change 'size_total' parameter to unsigned and standardize the size checks in copy_xstate_to_*()

2017-01-30 Thread Yu-cheng Yu
On Thu, Jan 26, 2017 at 11:22:54AM +0100, Ingo Molnar wrote: > 'size_total' is derived from an unsigned input parameter - and then converted > to 'int' and checked for negative ranges: > > if (size_total < 0 || offset < size_total) { > > This conversion and the checks are unnecessary

Re: [PATCH 09/14] x86/fpu: Change 'size_total' parameter to unsigned and standardize the size checks in copy_xstate_to_*()

2017-01-30 Thread Yu-cheng Yu
On Thu, Jan 26, 2017 at 11:22:54AM +0100, Ingo Molnar wrote: > 'size_total' is derived from an unsigned input parameter - and then converted > to 'int' and checked for negative ranges: > > if (size_total < 0 || offset < size_total) { > > This conversion and the checks are unnecessary

[PATCH 09/14] x86/fpu: Change 'size_total' parameter to unsigned and standardize the size checks in copy_xstate_to_*()

2017-01-26 Thread Ingo Molnar
'size_total' is derived from an unsigned input parameter - and then converted to 'int' and checked for negative ranges: if (size_total < 0 || offset < size_total) { This conversion and the checks are unnecessary obfuscation, reject overly large requested copy sizes outright and simplify

[PATCH 09/14] x86/fpu: Change 'size_total' parameter to unsigned and standardize the size checks in copy_xstate_to_*()

2017-01-26 Thread Ingo Molnar
'size_total' is derived from an unsigned input parameter - and then converted to 'int' and checked for negative ranges: if (size_total < 0 || offset < size_total) { This conversion and the checks are unnecessary obfuscation, reject overly large requested copy sizes outright and simplify