From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F56BC433E9 for ; Thu, 3 Sep 2020 13:58:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BA22720C09 for ; Thu, 3 Sep 2020 13:58:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BA22720C09 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3FAE16B005A; Thu, 3 Sep 2020 09:58:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3AA1A6B005C; Thu, 3 Sep 2020 09:58:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2998C6B005D; Thu, 3 Sep 2020 09:58:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0142.hostedemail.com [216.40.44.142]) by kanga.kvack.org (Postfix) with ESMTP id 145F16B005A for ; Thu, 3 Sep 2020 09:58:21 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id C88EC1F0A for ; Thu, 3 Sep 2020 13:58:20 +0000 (UTC) X-FDA: 77221904760.14.ink87_120cf9f270aa Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id 95A6B18229835 for ; Thu, 3 Sep 2020 13:58:20 +0000 (UTC) X-HE-Tag: ink87_120cf9f270aa X-Filterd-Recvd-Size: 4662 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Thu, 3 Sep 2020 13:58:19 +0000 (UTC) IronPort-SDR: LZpZjp1P0SRqlGdUpLXHfD2JVEpiRQKRN43rzdyVl9GPNN4A4L3AbnO+QjJRony73ZR9G7BZD4 i0g/HSEwgeOg== X-IronPort-AV: E=McAfee;i="6000,8403,9732"; a="137093221" X-IronPort-AV: E=Sophos;i="5.76,386,1592895600"; d="scan'208";a="137093221" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2020 06:58:18 -0700 IronPort-SDR: a1SObjMRYv6b1081VBh7Mrsn9ZUutrwePyMevwARiXdRC1Own8t2F6+jyuVEhuttxijOcTZ1bD HHyL3Q8/ECOw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,386,1592895600"; d="scan'208";a="405481936" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 03 Sep 2020 06:58:07 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 070E411C; Thu, 3 Sep 2020 16:58:06 +0300 (EEST) Date: Thu, 3 Sep 2020 16:58:06 +0300 From: "Kirill A. Shutemov" To: Matthew Wilcox Cc: "Kirill A. Shutemov" , Sumit Semwal , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Alexey Dobriyan , Jonathan Corbet , Mauro Carvalho Chehab , Kees Cook , Michal Hocko , Colin Cross , Alexey Gladkov , Jason Gunthorpe , Michel Lespinasse , Michal =?utf-8?Q?Koutn=C3=BD?= , Song Liu , Huang Ying , Vlastimil Babka , Yang Shi , chenqiwu , Mathieu Desnoyers , John Hubbard , Mike Christie , Bart Van Assche , Amit Pundir , Thomas Gleixner , Christian Brauner , Daniel Jordan , Adrian Reber , Nicolas Viennot , Al Viro , linux-fsdevel@vger.kernel.org, John Stultz , Pekka Enberg , Dave Hansen , Peter Zijlstra , Ingo Molnar , Oleg Nesterov , "Eric W. Biederman" , Jan Glauber , Rob Landley , Cyrill Gorcunov , "Serge E. Hallyn" , David Rientjes , Hugh Dickins , Rik van Riel , Mel Gorman , Tang Chen , Robin Holt , Shaohua Li , Sasha Levin , Johannes Weiner , Minchan Kim Subject: Re: [PATCH v7 3/3] mm: add a field to store names for private anonymous memory Message-ID: <20200903135806.ceoivs5pzlchg6uj@black.fi.intel.com> References: <20200901161459.11772-1-sumit.semwal@linaro.org> <20200901161459.11772-4-sumit.semwal@linaro.org> <20200903132537.mp5e6o6ptgbkghxe@box> <20200903134340.GA14765@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200903134340.GA14765@casper.infradead.org> X-Rspamd-Queue-Id: 95A6B18229835 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Sep 03, 2020 at 02:43:40PM +0100, Matthew Wilcox wrote: > On Thu, Sep 03, 2020 at 04:25:37PM +0300, Kirill A. Shutemov wrote: > > IIUC, it gives userspace direct control of content of /proc/$PID/maps and > > /proc/$PID/smaps. There's no verification of the given string whatsoever. > > I'm sure security experts would find clever usage of the feature :P > > What, you think that naming a VMA > "\n55bc3e0f9000-55bc3e0fb000 r--p 00000000 fd:01 16777285 /bin/cat" might cause problems? Something that would cause buffer overrun or out-of-bound access in a privilaged parser can be even more interesting. :) > Would it be enough to restrict the characters to isalnum()? I guess. But current design stores userspace pointer and there's time-of-check vs. time-of-use problem. -- Kirill A. Shutemov