Re: [PATCH] mm/usercopy: Use memory range to be accessed for wraparound check

2019-07-31 Thread Kees Cook
On Tue, Jul 30, 2019 at 10:54:13AM -0700, Isaac J. Manjarres wrote: > Currently, when checking to see if accessing n bytes starting at > address "ptr" will cause a wraparound in the memory addresses, > the check in check_bogus_address() adds an extra byte, which is > incorrect, as the range of

Re: [PATCH] mm/usercopy: Use memory range to be accessed for wraparound check

2018-11-14 Thread Kees Cook
On Tue, Nov 13, 2018 at 6:51 PM, Isaac J. Manjarres wrote: > Currently, when checking to see if accessing n bytes starting at > address "ptr" will cause a wraparound in the memory addresses, > the check in check_bogus_address() adds an extra byte, which is > incorrect, as the range of addresses

Re: [PATCH] mm/usercopy: Use memory range to be accessed for wraparound check

2018-11-14 Thread Kees Cook
On Tue, Nov 13, 2018 at 6:51 PM, Isaac J. Manjarres wrote: > Currently, when checking to see if accessing n bytes starting at > address "ptr" will cause a wraparound in the memory addresses, > the check in check_bogus_address() adds an extra byte, which is > incorrect, as the range of addresses

Re: [PATCH] mm/usercopy: Use memory range to be accessed for wraparound check

2018-11-14 Thread Kees Cook
On Wed, Nov 14, 2018 at 4:35 AM, William Kucharski wrote: > > >> On Nov 13, 2018, at 5:51 PM, Isaac J. Manjarres >> wrote: >> >> diff --git a/mm/usercopy.c b/mm/usercopy.c >> index 852eb4e..0293645 100644 >> --- a/mm/usercopy.c >> +++ b/mm/usercopy.c >> @@ -151,7 +151,7 @@ static inline void

Re: [PATCH] mm/usercopy: Use memory range to be accessed for wraparound check

2018-11-14 Thread Kees Cook
On Wed, Nov 14, 2018 at 4:35 AM, William Kucharski wrote: > > >> On Nov 13, 2018, at 5:51 PM, Isaac J. Manjarres >> wrote: >> >> diff --git a/mm/usercopy.c b/mm/usercopy.c >> index 852eb4e..0293645 100644 >> --- a/mm/usercopy.c >> +++ b/mm/usercopy.c >> @@ -151,7 +151,7 @@ static inline void

Re: [PATCH] mm/usercopy: Use memory range to be accessed for wraparound check

2018-11-14 Thread William Kucharski
> On Nov 14, 2018, at 10:32 AM, isa...@codeaurora.org wrote: > > Thank you and David for your feedback. The check_bogus_address() routine is > only invoked from one place in the kernel, which is __check_object_size(). > Before invoking check_bogus_address, __check_object_size ensures that n

Re: [PATCH] mm/usercopy: Use memory range to be accessed for wraparound check

2018-11-14 Thread William Kucharski
> On Nov 14, 2018, at 10:32 AM, isa...@codeaurora.org wrote: > > Thank you and David for your feedback. The check_bogus_address() routine is > only invoked from one place in the kernel, which is __check_object_size(). > Before invoking check_bogus_address, __check_object_size ensures that n

Re: [PATCH] mm/usercopy: Use memory range to be accessed for wraparound check

2018-11-14 Thread isaacm
On 2018-11-14 03:46, William Kucharski wrote: On Nov 14, 2018, at 4:09 AM, David Laight wrote: From: William Kucharski Sent: 14 November 2018 10:35 On Nov 13, 2018, at 5:51 PM, Isaac J. Manjarres wrote: diff --git a/mm/usercopy.c b/mm/usercopy.c index 852eb4e..0293645 100644 ---

Re: [PATCH] mm/usercopy: Use memory range to be accessed for wraparound check

2018-11-14 Thread isaacm
On 2018-11-14 03:46, William Kucharski wrote: On Nov 14, 2018, at 4:09 AM, David Laight wrote: From: William Kucharski Sent: 14 November 2018 10:35 On Nov 13, 2018, at 5:51 PM, Isaac J. Manjarres wrote: diff --git a/mm/usercopy.c b/mm/usercopy.c index 852eb4e..0293645 100644 ---

Re: [PATCH] mm/usercopy: Use memory range to be accessed for wraparound check

2018-11-14 Thread William Kucharski
> On Nov 14, 2018, at 4:09 AM, David Laight wrote: > > From: William Kucharski >> Sent: 14 November 2018 10:35 >> >>> On Nov 13, 2018, at 5:51 PM, Isaac J. Manjarres >>> wrote: >>> >>> diff --git a/mm/usercopy.c b/mm/usercopy.c >>> index 852eb4e..0293645 100644 >>> --- a/mm/usercopy.c >>>

Re: [PATCH] mm/usercopy: Use memory range to be accessed for wraparound check

2018-11-14 Thread William Kucharski
> On Nov 14, 2018, at 4:09 AM, David Laight wrote: > > From: William Kucharski >> Sent: 14 November 2018 10:35 >> >>> On Nov 13, 2018, at 5:51 PM, Isaac J. Manjarres >>> wrote: >>> >>> diff --git a/mm/usercopy.c b/mm/usercopy.c >>> index 852eb4e..0293645 100644 >>> --- a/mm/usercopy.c >>>

RE: [PATCH] mm/usercopy: Use memory range to be accessed for wraparound check

2018-11-14 Thread David Laight
From: William Kucharski > Sent: 14 November 2018 10:35 > > > On Nov 13, 2018, at 5:51 PM, Isaac J. Manjarres > > wrote: > > > > diff --git a/mm/usercopy.c b/mm/usercopy.c > > index 852eb4e..0293645 100644 > > --- a/mm/usercopy.c > > +++ b/mm/usercopy.c > > @@ -151,7 +151,7 @@ static inline void

RE: [PATCH] mm/usercopy: Use memory range to be accessed for wraparound check

2018-11-14 Thread David Laight
From: William Kucharski > Sent: 14 November 2018 10:35 > > > On Nov 13, 2018, at 5:51 PM, Isaac J. Manjarres > > wrote: > > > > diff --git a/mm/usercopy.c b/mm/usercopy.c > > index 852eb4e..0293645 100644 > > --- a/mm/usercopy.c > > +++ b/mm/usercopy.c > > @@ -151,7 +151,7 @@ static inline void

Re: [PATCH] mm/usercopy: Use memory range to be accessed for wraparound check

2018-11-14 Thread William Kucharski
> On Nov 13, 2018, at 5:51 PM, Isaac J. Manjarres wrote: > > diff --git a/mm/usercopy.c b/mm/usercopy.c > index 852eb4e..0293645 100644 > --- a/mm/usercopy.c > +++ b/mm/usercopy.c > @@ -151,7 +151,7 @@ static inline void check_bogus_address(const unsigned > long ptr, unsigned long n, >

Re: [PATCH] mm/usercopy: Use memory range to be accessed for wraparound check

2018-11-14 Thread William Kucharski
> On Nov 13, 2018, at 5:51 PM, Isaac J. Manjarres wrote: > > diff --git a/mm/usercopy.c b/mm/usercopy.c > index 852eb4e..0293645 100644 > --- a/mm/usercopy.c > +++ b/mm/usercopy.c > @@ -151,7 +151,7 @@ static inline void check_bogus_address(const unsigned > long ptr, unsigned long n, >