Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751543AbWIYEdk (ORCPT ); Mon, 25 Sep 2006 00:33:40 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751544AbWIYEdk (ORCPT ); Mon, 25 Sep 2006 00:33:40 -0400 Received: from mail.aknet.ru ([82.179.72.26]:27140 "EHLO mail.aknet.ru") by vger.kernel.org with ESMTP id S1751007AbWIYEdj (ORCPT ); Mon, 25 Sep 2006 00:33:39 -0400 Message-ID: <45175C7B.7040005@aknet.ru> Date: Mon, 25 Sep 2006 08:35:07 +0400 From: Stas Sergeev User-Agent: Thunderbird 1.5.0.7 (X11/20060913) MIME-Version: 1.0 To: Valdis.Kletnieks@vt.edu Cc: Ulrich Drepper , Hugh Dickins , Andrew Morton , Linux kernel Subject: Re: [patch] remove MNT_NOEXEC check for PROT_EXEC mmaps References: <45150CD7.4010708@aknet.ru> <45155499.4000209@redhat.com> <45155707.4010906@aknet.ru> <200609250112.k8P1CTfZ019880@turing-police.cc.vt.edu> In-Reply-To: <200609250112.k8P1CTfZ019880@turing-police.cc.vt.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 997 Lines: 25 Hi. Valdis.Kletnieks@vt.edu wrote: >> But why exactly? They do: >> shm_open(); >> mmap(PROT_READ|PROT_WRITE|PROT_EXEC); >> and mmap fails. >> Where is the fault of an app here? > Are you suggesting that it's not an app's fault/problem if it tries to > open a writable file on a R/O filesystem? Because it's essentially the > same problem.... It is not really the same - the app is not trying to create an "executable" file on a noexec filesystem. PROT_EXEC never required the exec permission on a file btw. The MAP_PRIVATE mmap roughly means a read of the file into the memory, where the program can do anything with its data, including an execution. Does the R/O filesystem disallow PROT_WRITE for MAP_PRIVATE? Haven't tried, but I hope it doesn't. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/