From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ig0-f172.google.com (mail-ig0-f172.google.com [209.85.213.172]) by kanga.kvack.org (Postfix) with ESMTP id 091D16B0003 for ; Wed, 6 Jan 2016 04:17:58 -0500 (EST) Received: by mail-ig0-f172.google.com with SMTP id mw1so29175678igb.1 for ; Wed, 06 Jan 2016 01:17:58 -0800 (PST) Received: from mail-io0-x22b.google.com (mail-io0-x22b.google.com. [2607:f8b0:4001:c06::22b]) by mx.google.com with ESMTPS id m5si12076957igx.20.2016.01.06.01.17.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Jan 2016 01:17:57 -0800 (PST) Received: by mail-io0-x22b.google.com with SMTP id 1so166041336ion.1 for ; Wed, 06 Jan 2016 01:17:57 -0800 (PST) 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 14:47:57 +0530 Message-ID: Subject: Re: [PATCH 1/2] prctl: take mmap sem for writing to protect against others From: Anshuman Khandual Content-Type: multipart/alternative; boundary=001a1141d9426f34a10528a6d487 Sender: owner-linux-mm@kvack.org List-ID: 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 --001a1141d9426f34a10528a6d487 Content-Type: text/plain; charset=UTF-8 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 > --001a1141d9426f34a10528a6d487 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= On Wed, Jan 6, 2016 at 10:32 AM, Mateusz Guzik <mguzik@redhat.com><= /span> wrote:
The code was taking the sem= aphore for reading, which does not protect
against readers nor concurrent modifications.


(down/up)_read does not protect against concurren= t readers ?
=C2=A0
The problem could cause a sanity checks to fail in procfs's cmdline
reader, resulting in an OOPS.

Can you e= xplain this a bit and may be give some examples ?
=C2=A0

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 fixe= d as well ?
=C2=A0
Signed-off-by: Mateusz Guzik <mguzi= k@redhat.com>

--001a1141d9426f34a10528a6d487-- -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org