From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751470AbcABLdS (ORCPT ); Sat, 2 Jan 2016 06:33:18 -0500 Received: from mail-wm0-f52.google.com ([74.125.82.52]:33366 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751197AbcABLdO (ORCPT ); Sat, 2 Jan 2016 06:33:14 -0500 Subject: Re: GPF in shm_lock ipc To: Dmitry Vyukov , syzkaller References: <20151012122702.GC2544@node> <20151012174945.GC3170@linux-uzut.site> <20151012181040.GC6447@node> <20151012185533.GD3170@linux-uzut.site> <20151013031821.GA3052@linux-uzut.site> <20151013123028.GA12934@node> <20151105142336.46D907FD@black.fi.intel.com> Cc: "Kirill A. Shutemov" , Andrew Morton , Dave Hansen , Hugh Dickins , Joe Perches , sds@tycho.nsa.gov, Oleg Nesterov , "Kirill A. Shutemov" , Rik van Riel , mhocko@suse.cz, gang.chen.5i5j@gmail.com, Peter Feiner , Andrea Arcangeli , "linux-mm@kvack.org" , LKML , Kostya Serebryany , Alexander Potapenko , Andrey Konovalov , Sasha Levin From: Manfred Spraul Message-ID: <5687B576.7020303@colorfullife.com> Date: Sat, 2 Jan 2016 12:33:10 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 12/21/2015 04:44 PM, Dmitry Vyukov wrote: >> + >> +/* This is called by fork, once for every shm attach. */ >> +static void shm_open(struct vm_area_struct *vma) >> +{ >> + int err = __shm_open(vma); >> + /* >> + * We raced in the idr lookup or with shm_destroy(). >> + * Either way, the ID is busted. >> + */ >> + WARN_ON_ONCE(err); >> } Is it possible to trigger this race? Parallel IPC_RMID & fork()? -- Manfred