Re: [PATCH 2/2 v2] staging: android: ashmem: Fix mmap size validation

2018-06-22 Thread Martijn Coenen
On Thu, Jun 21, 2018 at 1:29 AM, Joel Fernandes wrote: > Also if you look at the kernel sources, there are dozens of drivers that > check for correct VMA size in mmap handler and fail if it isn't sized > correctly. If that's the case, we should definitely do it this way for ashmem as well. Since

Re: [PATCH 2/2 v2] staging: android: ashmem: Fix mmap size validation

2018-06-22 Thread Martijn Coenen
On Thu, Jun 21, 2018 at 1:29 AM, Joel Fernandes wrote: > Also if you look at the kernel sources, there are dozens of drivers that > check for correct VMA size in mmap handler and fail if it isn't sized > correctly. If that's the case, we should definitely do it this way for ashmem as well. Since

Re: [PATCH 2/2 v2] staging: android: ashmem: Fix mmap size validation

2018-06-20 Thread Joel Fernandes
On Wed, Jun 20, 2018 at 02:21:57PM -0700, Daniel Colascione wrote: > On Tue, Jun 19, 2018 at 9:32 PM, Joel Fernandes > wrote: > > On Tue, Jun 19, 2018 at 05:57:35PM -0700, Alistair Strachan wrote: > > > The ashmem driver did not check that the size/offset of the vma passed > > > to its .mmap()

Re: [PATCH 2/2 v2] staging: android: ashmem: Fix mmap size validation

2018-06-20 Thread Joel Fernandes
On Wed, Jun 20, 2018 at 02:21:57PM -0700, Daniel Colascione wrote: > On Tue, Jun 19, 2018 at 9:32 PM, Joel Fernandes > wrote: > > On Tue, Jun 19, 2018 at 05:57:35PM -0700, Alistair Strachan wrote: > > > The ashmem driver did not check that the size/offset of the vma passed > > > to its .mmap()

Re: [PATCH 2/2 v2] staging: android: ashmem: Fix mmap size validation

2018-06-20 Thread Daniel Colascione
On Tue, Jun 19, 2018 at 9:32 PM, Joel Fernandes wrote: > On Tue, Jun 19, 2018 at 05:57:35PM -0700, Alistair Strachan wrote: > > The ashmem driver did not check that the size/offset of the vma passed > > to its .mmap() function was not larger than the ashmem object being > > mapped. This could

Re: [PATCH 2/2 v2] staging: android: ashmem: Fix mmap size validation

2018-06-20 Thread Daniel Colascione
On Tue, Jun 19, 2018 at 9:32 PM, Joel Fernandes wrote: > On Tue, Jun 19, 2018 at 05:57:35PM -0700, Alistair Strachan wrote: > > The ashmem driver did not check that the size/offset of the vma passed > > to its .mmap() function was not larger than the ashmem object being > > mapped. This could

Re: [PATCH 2/2 v2] staging: android: ashmem: Fix mmap size validation

2018-06-19 Thread Joel Fernandes
On Tue, Jun 19, 2018 at 05:57:35PM -0700, Alistair Strachan wrote: > The ashmem driver did not check that the size/offset of the vma passed > to its .mmap() function was not larger than the ashmem object being > mapped. This could cause mmap() to succeed, even though accessing parts > of the

Re: [PATCH 2/2 v2] staging: android: ashmem: Fix mmap size validation

2018-06-19 Thread Joel Fernandes
On Tue, Jun 19, 2018 at 05:57:35PM -0700, Alistair Strachan wrote: > The ashmem driver did not check that the size/offset of the vma passed > to its .mmap() function was not larger than the ashmem object being > mapped. This could cause mmap() to succeed, even though accessing parts > of the

[PATCH 2/2 v2] staging: android: ashmem: Fix mmap size validation

2018-06-19 Thread Alistair Strachan
The ashmem driver did not check that the size/offset of the vma passed to its .mmap() function was not larger than the ashmem object being mapped. This could cause mmap() to succeed, even though accessing parts of the mapping would later fail with a segmentation fault. Ensure an error is returned

[PATCH 2/2 v2] staging: android: ashmem: Fix mmap size validation

2018-06-19 Thread Alistair Strachan
The ashmem driver did not check that the size/offset of the vma passed to its .mmap() function was not larger than the ashmem object being mapped. This could cause mmap() to succeed, even though accessing parts of the mapping would later fail with a segmentation fault. Ensure an error is returned