From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752183Ab1HPTkz (ORCPT ); Tue, 16 Aug 2011 15:40:55 -0400 Received: from gir.skynet.ie ([193.1.99.77]:38720 "EHLO gir.skynet.ie" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751581Ab1HPTky (ORCPT ); Tue, 16 Aug 2011 15:40:54 -0400 Date: Tue, 16 Aug 2011 20:40:51 +0100 From: Mel Gorman To: Roland McGrath Cc: Will Drewry , linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton , Peter Zijlstra , Al Viro , Eric Paris , Andrea Arcangeli , Rik van Riel , Nitin Gupta , Hugh Dickins , Shaohua Li , linux-mm@kvack.org Subject: Re: [PATCH] mmap: add sysctl for controlling ~VM_MAYEXEC taint Message-ID: <20110816194050.GB4484@csn.ul.ie> References: <1313441856-1419-1-git-send-email-wad@chromium.org> <20110816093303.GA4484@csn.ul.ie> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 16, 2011 at 10:07:46AM -0700, Roland McGrath wrote: > On Tue, Aug 16, 2011 at 2:33 AM, Mel Gorman wrote: > > Is using shm_open()+mmap instead of open()+mmap() to open a file on > > /dev/shm really that difficult? > > > > int shm_open(const char *name, int oflag, mode_t mode); > > int open(const char *pathname, int flags, mode_t mode); > > I cannot figure out the rationale behind this question at all. > Both of these library functions result in the same system call. > They might result in the same system call but one of them creates the file under /dev/shm which should not have the same permissions problem. The library really appears to want to create a shared executable object, using shm_open does not appear that unreasonable to me. > > An ordinary user is not going to know that a segfault from an > > application can be fixed with this sysctl. This looks like something > > that should be fixed in the library so that it can work on kernels > > that do not have the sysctl. > > I think the expectation is that the administrator or system builder > who decides to set the (non-default) noexec mount option will also > set the sysctl at the same time. > Which then needs to be copied in each distro wanting to do the same thing and is not backwards compatible where as using shm_open is. -- Mel Gorman SUSE Labs