Re: [RFC patch 1/6] random: Simplify API for random address requests

2016-07-28 Thread Jason Cooper
On Tue, Jul 26, 2016 at 10:07:22AM -0700, Kees Cook wrote: > On Tue, Jul 26, 2016 at 10:00 AM, Jason Cooper wrote: ... > > if (range == 0 || ULONG_MAX - range < start) > > return start; > > Should it "abort" like this? I was thinking just cap the range, something > like: > > if (range >

RE: [RFC patch 1/6] random: Simplify API for random address requests

2016-07-26 Thread Roberts, William C
utronix.de; > mi...@redhat.com; h...@zytor.com; x...@kernel.org; v...@zeniv.linux.org.uk; > n...@google.com; je...@google.com; aly...@android.com; > dcash...@android.com > Subject: Re: [RFC patch 1/6] random: Simplify API for random address requests > > All, > > On Tue, Jul 26, 2016

Re: [RFC patch 1/6] random: Simplify API for random address requests

2016-07-26 Thread Kees Cook
On Tue, Jul 26, 2016 at 10:00 AM, Jason Cooper wrote: > Hi Kees, > > On Mon, Jul 25, 2016 at 09:39:58PM -0700, Kees Cook wrote: >> On Mon, Jul 25, 2016 at 8:30 PM, Jason Cooper wrote: >> > On Tue, Jul 26, 2016 at 03:01:55AM +, Jason Cooper wrote: >> >> To date, all callers of randomize_range(

Re: [RFC patch 1/6] random: Simplify API for random address requests

2016-07-26 Thread Jason Cooper
Hi Kees, On Mon, Jul 25, 2016 at 09:39:58PM -0700, Kees Cook wrote: > On Mon, Jul 25, 2016 at 8:30 PM, Jason Cooper wrote: > > On Tue, Jul 26, 2016 at 03:01:55AM +, Jason Cooper wrote: > >> To date, all callers of randomize_range() have set the length to 0, and > >> check for a zero return va

Re: [RFC patch 1/6] random: Simplify API for random address requests

2016-07-26 Thread Kees Cook
On Tue, Jul 26, 2016 at 8:55 AM, Jason Cooper wrote: > On Mon, Jul 25, 2016 at 09:44:27PM -0700, Kees Cook wrote: >> On Mon, Jul 25, 2016 at 8:01 PM, Jason Cooper wrote: >> > To date, all callers of randomize_range() have set the length to 0, and >> > check for a zero return value. For the curre

Re: [RFC patch 1/6] random: Simplify API for random address requests

2016-07-26 Thread Jason Cooper
On Mon, Jul 25, 2016 at 09:44:27PM -0700, Kees Cook wrote: > On Mon, Jul 25, 2016 at 8:01 PM, Jason Cooper wrote: > > To date, all callers of randomize_range() have set the length to 0, and > > check for a zero return value. For the current callers, the only way > > to get zero returned is if end

Re: [RFC patch 1/6] random: Simplify API for random address requests

2016-07-25 Thread Kees Cook
On Mon, Jul 25, 2016 at 8:01 PM, Jason Cooper wrote: > To date, all callers of randomize_range() have set the length to 0, and > check for a zero return value. For the current callers, the only way > to get zero returned is if end <= start. Since they are all adding a > constant to the start add

Re: [RFC patch 1/6] random: Simplify API for random address requests

2016-07-25 Thread Kees Cook
On Mon, Jul 25, 2016 at 8:30 PM, Jason Cooper wrote: > All, > > On Tue, Jul 26, 2016 at 03:01:55AM +, Jason Cooper wrote: >> To date, all callers of randomize_range() have set the length to 0, and >> check for a zero return value. For the current callers, the only way >> to get zero returned

Re: [RFC patch 1/6] random: Simplify API for random address requests

2016-07-25 Thread Jason Cooper
All, On Tue, Jul 26, 2016 at 03:01:55AM +, Jason Cooper wrote: > To date, all callers of randomize_range() have set the length to 0, and > check for a zero return value. For the current callers, the only way > to get zero returned is if end <= start. Since they are all adding a > constant to