From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752265AbcAFJfN (ORCPT ); Wed, 6 Jan 2016 04:35:13 -0500 Received: from mail-io0-f177.google.com ([209.85.223.177]:35077 "EHLO mail-io0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751963AbcAFJfK (ORCPT ); Wed, 6 Jan 2016 04:35:10 -0500 MIME-Version: 1.0 In-Reply-To: <1452056549-10048-2-git-send-email-mguzik@redhat.com> References: <1452056549-10048-1-git-send-email-mguzik@redhat.com> <1452056549-10048-2-git-send-email-mguzik@redhat.com> Date: Wed, 6 Jan 2016 15:05:09 +0530 Message-ID: Subject: Re: [PATCH 1/2] prctl: take mmap sem for writing to protect against others From: Anshuman Khandual To: Mateusz Guzik Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Alexey Dobriyan , Cyrill Gorcunov , Jarod Wilson , Jan Stancek , Andrew Morton , Al Viro Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 6, 2016 at 10:32 AM, Mateusz Guzik wrote: > The code was taking the semaphore for reading, which does not protect > against readers nor concurrent modifications. (down/up)_read does not protect against concurrent readers ? > > The problem could cause a sanity checks to fail in procfs's cmdline > reader, resulting in an OOPS. > Can you explain this a bit and may be give some examples ? > Note that some functions perform an unlocked read of various mm fields, > but they seem to be fine despite possible modificaton. Those need to be fixed as well ? > Signed-off-by: Mateusz Guzik