Re: GPF in shm_lock ipc

2016-02-02 Thread Dmitry Vyukov
ock() to propagate > locking error back to caller of shm_mmap(). > > [1] http://github.com/google/syzkaller > > Signed-off-by: Kirill A. Shutemov > Reported-by: Dmitry Vyukov > Cc: Davidlohr Bueso > Cc: Manfred Spraul > Cc: > Signed-off-by: Andrew Morton > --- &

Re: GPF in shm_lock ipc

2016-02-02 Thread Dmitry Vyukov
ov <kirill.shute...@linux.intel.com> > Reported-by: Dmitry Vyukov <dvyu...@google.com> > Cc: Davidlohr Bueso <d...@stgolabs.net> > Cc: Manfred Spraul <manf...@colorfullife.com> > Cc: <sta...@vger.kernel.org> > Signed-off-by: Andrew Morton <a...@linux-foun

Re: GPF in shm_lock ipc

2016-02-01 Thread Andrew Morton
//github.com/google/syzkaller Signed-off-by: Kirill A. Shutemov Reported-by: Dmitry Vyukov Cc: Davidlohr Bueso Cc: Manfred Spraul Cc: Signed-off-by: Andrew Morton --- ipc/shm.c | 53 ++-- 1 file changed, 43 insertions(+), 10 deletions(-) di

Re: GPF in shm_lock ipc

2016-02-01 Thread Andrew Morton
.@stgolabs.net> Cc: Manfred Spraul <manf...@colorfullife.com> Cc: <sta...@vger.kernel.org> Signed-off-by: Andrew Morton <a...@linux-foundation.org> --- ipc/shm.c | 53 ++++++++++------ 1 file changed, 43 insertions(+), 10 deletions(-) diff -puN

Re: GPF in shm_lock ipc

2016-01-02 Thread Manfred Spraul
Hi Dmitry, On 01/02/2016 01:19 PM, Dmitry Vyukov wrote: On Sat, Jan 2, 2016 at 12:33 PM, Manfred Spraul wrote: Hi Dmitry, shm locking differs too much from msg/sem locking, I never looked at it in depth, so I'm not able to perform a proper review. Except for the obvious: Races that can be

Re: GPF in shm_lock ipc

2016-01-02 Thread Dmitry Vyukov
On Sat, Jan 2, 2016 at 12:33 PM, Manfred Spraul wrote: > Hi Dmitry, > > shm locking differs too much from msg/sem locking, I never looked at it in > depth, so I'm not able to perform a proper review. > > Except for the obvious: Races that can be triggered from user space are > inacceptable. >

Re: GPF in shm_lock ipc

2016-01-02 Thread Manfred Spraul
Hi Dmitry, shm locking differs too much from msg/sem locking, I never looked at it in depth, so I'm not able to perform a proper review. Except for the obvious: Races that can be triggered from user space are inacceptable. Regardless if there is a BUG_ON, a WARN_ON or nothing at all. On

Re: GPF in shm_lock ipc

2016-01-02 Thread Manfred Spraul
Hi Dmitry, shm locking differs too much from msg/sem locking, I never looked at it in depth, so I'm not able to perform a proper review. Except for the obvious: Races that can be triggered from user space are inacceptable. Regardless if there is a BUG_ON, a WARN_ON or nothing at all. On

Re: GPF in shm_lock ipc

2016-01-02 Thread Dmitry Vyukov
On Sat, Jan 2, 2016 at 12:33 PM, Manfred Spraul wrote: > Hi Dmitry, > > shm locking differs too much from msg/sem locking, I never looked at it in > depth, so I'm not able to perform a proper review. > > Except for the obvious: Races that can be triggered from user space

Re: GPF in shm_lock ipc

2016-01-02 Thread Manfred Spraul
Hi Dmitry, On 01/02/2016 01:19 PM, Dmitry Vyukov wrote: On Sat, Jan 2, 2016 at 12:33 PM, Manfred Spraul wrote: Hi Dmitry, shm locking differs too much from msg/sem locking, I never looked at it in depth, so I'm not able to perform a proper review. Except for the

Re: GPF in shm_lock ipc

2015-12-21 Thread Dmitry Vyukov
On Thu, Nov 5, 2015 at 3:23 PM, Kirill A. Shutemov wrote: > What about this: Ping. This is still happening for me on tip. Can we pull in this fix if it looks good to everybody? > From 06b0fc9d62592f6f3ad9f45cccf1f6a5b3113bdc Mon Sep 17 00:00:00 2001 > From: "Kirill A. Shutemov" > Date: Thu,

Re: GPF in shm_lock ipc

2015-12-21 Thread Dmitry Vyukov
On Thu, Nov 5, 2015 at 3:23 PM, Kirill A. Shutemov wrote: > What about this: Ping. This is still happening for me on tip. Can we pull in this fix if it looks good to everybody? > From 06b0fc9d62592f6f3ad9f45cccf1f6a5b3113bdc Mon Sep 17 00:00:00 2001 > From:

Re: GPF in shm_lock ipc

2015-11-05 Thread Kirill A. Shutemov
Dmitry Vyukov wrote: > On Tue, Oct 13, 2015 at 8:30 PM, Kirill A. Shutemov > wrote: > > On Mon, Oct 12, 2015 at 08:18:21PM -0700, Davidlohr Bueso wrote: > >> On Mon, 12 Oct 2015, Bueso wrote: > >> > >> >On Mon, 12 Oct 2015, Kirill A. Shutemov wrote: > >> > > >> >>On Mon, Oct 12, 2015 at

Re: GPF in shm_lock ipc

2015-11-05 Thread Kirill A. Shutemov
Dmitry Vyukov wrote: > On Tue, Oct 13, 2015 at 8:30 PM, Kirill A. Shutemov > wrote: > > On Mon, Oct 12, 2015 at 08:18:21PM -0700, Davidlohr Bueso wrote: > >> On Mon, 12 Oct 2015, Bueso wrote: > >> > >> >On Mon, 12 Oct 2015, Kirill A. Shutemov wrote: > >> > > >> >>On Mon, Oct

Re: GPF in shm_lock ipc

2015-10-29 Thread Dmitry Vyukov
On Tue, Oct 13, 2015 at 8:30 PM, Kirill A. Shutemov wrote: > On Mon, Oct 12, 2015 at 08:18:21PM -0700, Davidlohr Bueso wrote: >> On Mon, 12 Oct 2015, Bueso wrote: >> >> >On Mon, 12 Oct 2015, Kirill A. Shutemov wrote: >> > >> >>On Mon, Oct 12, 2015 at 10:49:45AM -0700, Davidlohr Bueso wrote: >>

Re: GPF in shm_lock ipc

2015-10-29 Thread Dmitry Vyukov
On Tue, Oct 13, 2015 at 8:30 PM, Kirill A. Shutemov wrote: > On Mon, Oct 12, 2015 at 08:18:21PM -0700, Davidlohr Bueso wrote: >> On Mon, 12 Oct 2015, Bueso wrote: >> >> >On Mon, 12 Oct 2015, Kirill A. Shutemov wrote: >> > >> >>On Mon, Oct 12, 2015 at 10:49:45AM -0700,

Re: GPF in shm_lock ipc

2015-10-13 Thread Kirill A. Shutemov
On Mon, Oct 12, 2015 at 08:18:21PM -0700, Davidlohr Bueso wrote: > On Mon, 12 Oct 2015, Bueso wrote: > > >On Mon, 12 Oct 2015, Kirill A. Shutemov wrote: > > > >>On Mon, Oct 12, 2015 at 10:49:45AM -0700, Davidlohr Bueso wrote: > >>>diff --git a/ipc/shm.c b/ipc/shm.c > >>>index 4178727..9615f19

Re: GPF in shm_lock ipc

2015-10-13 Thread Kirill A. Shutemov
On Mon, Oct 12, 2015 at 08:18:21PM -0700, Davidlohr Bueso wrote: > On Mon, 12 Oct 2015, Bueso wrote: > > >On Mon, 12 Oct 2015, Kirill A. Shutemov wrote: > > > >>On Mon, Oct 12, 2015 at 10:49:45AM -0700, Davidlohr Bueso wrote: > >>>diff --git a/ipc/shm.c b/ipc/shm.c > >>>index 4178727..9615f19

Re: GPF in shm_lock ipc

2015-10-12 Thread Davidlohr Bueso
On Mon, 12 Oct 2015, Bueso wrote: On Mon, 12 Oct 2015, Kirill A. Shutemov wrote: On Mon, Oct 12, 2015 at 10:49:45AM -0700, Davidlohr Bueso wrote: diff --git a/ipc/shm.c b/ipc/shm.c index 4178727..9615f19 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -385,9 +385,25 @@ static struct mempolicy

Re: GPF in shm_lock ipc

2015-10-12 Thread Davidlohr Bueso
On Mon, 12 Oct 2015, Kirill A. Shutemov wrote: On Mon, Oct 12, 2015 at 10:49:45AM -0700, Davidlohr Bueso wrote: diff --git a/ipc/shm.c b/ipc/shm.c index 4178727..9615f19 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -385,9 +385,25 @@ static struct mempolicy *shm_get_policy(struct vm_area_struct

Re: GPF in shm_lock ipc

2015-10-12 Thread Kirill A. Shutemov
On Mon, Oct 12, 2015 at 10:49:45AM -0700, Davidlohr Bueso wrote: > On Mon, 12 Oct 2015, Kirill A. Shutemov wrote: > > >On Mon, Oct 12, 2015 at 11:55:44AM +0200, Dmitry Vyukov wrote: > >Here's slightly simplified and more human readable reproducer: > > > >#define _GNU_SOURCE > >#include >

Re: GPF in shm_lock ipc

2015-10-12 Thread Davidlohr Bueso
On Mon, 12 Oct 2015, Kirill A. Shutemov wrote: On Mon, Oct 12, 2015 at 11:55:44AM +0200, Dmitry Vyukov wrote: Here's slightly simplified and more human readable reproducer: #define _GNU_SOURCE #include #include #include #include #define PAGE_SIZE 4096 int main() { int id;

Re: GPF in shm_lock ipc

2015-10-12 Thread Kirill A. Shutemov
On Mon, Oct 12, 2015 at 11:55:44AM +0200, Dmitry Vyukov wrote: > Hello, > > The following program crashes kernel: > > // autogenerated by syzkaller (http://github.com/google/syzkaller) > #include > #include > #include > > int main() > { > long r0 = syscall(SYS_shmget, 0x0ul, 0x2ul,

Re: GPF in shm_lock ipc

2015-10-12 Thread Dmitry Vyukov
On Mon, Oct 12, 2015 at 1:41 PM, Vlastimil Babka wrote: > On 10/12/2015 11:55 AM, Dmitry Vyukov wrote: >> >> Hello, >> >> The following program crashes kernel: >> >> // autogenerated by syzkaller (http://github.com/google/syzkaller) >> #include >> #include >> #include >> >> int main() >> { >>

Re: GPF in shm_lock ipc

2015-10-12 Thread Vlastimil Babka
On 10/12/2015 11:55 AM, Dmitry Vyukov wrote: Hello, The following program crashes kernel: // autogenerated by syzkaller (http://github.com/google/syzkaller) #include #include #include int main() { long r0 = syscall(SYS_shmget, 0x0ul, 0x2ul, 0x8ul); long r1 =

GPF in shm_lock ipc

2015-10-12 Thread Dmitry Vyukov
Hello, The following program crashes kernel: // autogenerated by syzkaller (http://github.com/google/syzkaller) #include #include #include int main() { long r0 = syscall(SYS_shmget, 0x0ul, 0x2ul, 0x8ul); long r1 = syscall(SYS_shmat, r0, 0x2000ul, 0x0ul); long r2 =

GPF in shm_lock ipc

2015-10-12 Thread Dmitry Vyukov
Hello, The following program crashes kernel: // autogenerated by syzkaller (http://github.com/google/syzkaller) #include #include #include int main() { long r0 = syscall(SYS_shmget, 0x0ul, 0x2ul, 0x8ul); long r1 = syscall(SYS_shmat, r0, 0x2000ul, 0x0ul); long r2 =

Re: GPF in shm_lock ipc

2015-10-12 Thread Dmitry Vyukov
On Mon, Oct 12, 2015 at 1:41 PM, Vlastimil Babka wrote: > On 10/12/2015 11:55 AM, Dmitry Vyukov wrote: >> >> Hello, >> >> The following program crashes kernel: >> >> // autogenerated by syzkaller (http://github.com/google/syzkaller) >> #include >> #include >> #include >> >> int

Re: GPF in shm_lock ipc

2015-10-12 Thread Kirill A. Shutemov
On Mon, Oct 12, 2015 at 11:55:44AM +0200, Dmitry Vyukov wrote: > Hello, > > The following program crashes kernel: > > // autogenerated by syzkaller (http://github.com/google/syzkaller) > #include > #include > #include > > int main() > { > long r0 = syscall(SYS_shmget, 0x0ul, 0x2ul,

Re: GPF in shm_lock ipc

2015-10-12 Thread Vlastimil Babka
On 10/12/2015 11:55 AM, Dmitry Vyukov wrote: Hello, The following program crashes kernel: // autogenerated by syzkaller (http://github.com/google/syzkaller) #include #include #include int main() { long r0 = syscall(SYS_shmget, 0x0ul, 0x2ul, 0x8ul); long r1 =

Re: GPF in shm_lock ipc

2015-10-12 Thread Davidlohr Bueso
On Mon, 12 Oct 2015, Kirill A. Shutemov wrote: On Mon, Oct 12, 2015 at 11:55:44AM +0200, Dmitry Vyukov wrote: Here's slightly simplified and more human readable reproducer: #define _GNU_SOURCE #include #include #include #include #define PAGE_SIZE 4096 int main() { int id;

Re: GPF in shm_lock ipc

2015-10-12 Thread Kirill A. Shutemov
On Mon, Oct 12, 2015 at 10:49:45AM -0700, Davidlohr Bueso wrote: > On Mon, 12 Oct 2015, Kirill A. Shutemov wrote: > > >On Mon, Oct 12, 2015 at 11:55:44AM +0200, Dmitry Vyukov wrote: > >Here's slightly simplified and more human readable reproducer: > > > >#define _GNU_SOURCE > >#include >

Re: GPF in shm_lock ipc

2015-10-12 Thread Davidlohr Bueso
On Mon, 12 Oct 2015, Kirill A. Shutemov wrote: On Mon, Oct 12, 2015 at 10:49:45AM -0700, Davidlohr Bueso wrote: diff --git a/ipc/shm.c b/ipc/shm.c index 4178727..9615f19 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -385,9 +385,25 @@ static struct mempolicy *shm_get_policy(struct vm_area_struct

Re: GPF in shm_lock ipc

2015-10-12 Thread Davidlohr Bueso
On Mon, 12 Oct 2015, Bueso wrote: On Mon, 12 Oct 2015, Kirill A. Shutemov wrote: On Mon, Oct 12, 2015 at 10:49:45AM -0700, Davidlohr Bueso wrote: diff --git a/ipc/shm.c b/ipc/shm.c index 4178727..9615f19 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -385,9 +385,25 @@ static struct mempolicy