From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f197.google.com (mail-io0-f197.google.com [209.85.223.197]) by kanga.kvack.org (Postfix) with ESMTP id 473A16B0006 for ; Sat, 26 May 2018 21:33:36 -0400 (EDT) Received: by mail-io0-f197.google.com with SMTP id h70-v6so7705274iof.10 for ; Sat, 26 May 2018 18:33:36 -0700 (PDT) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id 19-v6sor63015iod.303.2018.05.26.18.33.35 for (Google Transport Security); Sat, 26 May 2018 18:33:35 -0700 (PDT) MIME-Version: 1.0 References: <1527346246-1334-1-git-send-email-s.mesoraca16@gmail.com> In-Reply-To: From: Linus Torvalds Date: Sat, 26 May 2018 18:33:23 -0700 Message-ID: Subject: Re: [PATCH] proc: prevent a task from writing on its own /proc/*/mem Content-Type: text/plain; charset="UTF-8" Sender: owner-linux-mm@kvack.org List-ID: To: Kees Cook Cc: Salvatore Mesoraca , Jann Horn , Kernel Hardening , LSM List , Linux Kernel Mailing List , linux-mm , Andrew Morton , Alexey Dobriyan , Akinobu Mita , Dmitry Vyukov , Arnd Bergmann , Davidlohr Bueso On Sat, May 26, 2018 at 5:32 PM Kees Cook wrote: > I went through some old threads from 2012 when e268337dfe26 was > introduced, and later when things got looked at during DirtyCOW. There > was discussion about removing FOLL_FORCE (in order to block writes on > a read-only memory region). Side note, we did that for /dev/mem, and things broke. Thus commit f511c0b17b08 "Yes, people use FOLL_FORCE ;)" Side note, that very sam ecommit f511c0b17b08 is also the explanation for why the patch under discussion now seems broken. People really do use "write to /proc/self/mem" as a way to keep the mappings read-only, but have a way to change them when required. Linus