From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161052AbWF0J5S (ORCPT ); Tue, 27 Jun 2006 05:57:18 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S964872AbWF0J5S (ORCPT ); Tue, 27 Jun 2006 05:57:18 -0400 Received: from gprs189-60.eurotel.cz ([160.218.189.60]:44262 "EHLO amd.ucw.cz") by vger.kernel.org with ESMTP id S964868AbWF0J5R (ORCPT ); Tue, 27 Jun 2006 05:57:17 -0400 Date: Tue, 27 Jun 2006 11:56:32 +0200 From: Pavel Machek To: Ulrich Drepper Cc: Arjan van de Ven , Jason Baron , akpm@osdl.org, linux-kernel@vger.kernel.org Subject: Re: make PROT_WRITE imply PROT_READ Message-ID: <20060627095632.GA22666@elf.ucw.cz> References: <449B42B3.6010908@shaw.ca> <1151071581.3204.14.camel@laptopd505.fenrus.org> <1151072280.3204.17.camel@laptopd505.fenrus.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Warning: Reading this can be dangerous to your mental health. User-Agent: Mutt/1.5.11+cvs20060126 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Hi! > >you ask for it, and the kernel is supposed to deliver the best behavior > >it can. > > The kernel should provide > > - a stable, reliable interface > > - a consistent interface at least accross architectures, maybe even > platforms > > > Providing write-only support for memory falls into none of these > categories. When Jason and I discussed this my position actually was > to disallow PROT_WRITE without PROT_READ completely, making it an > error of mmap and mprotect. That's perfectly legal according to POSIX > and it will teach those who write broken code like this. Well, some hardware can probably support write-only, and such support can be useful for "weird" applications, such as just-in-time compilers, etc. Usability for "normal" C applications is probably not too high... so why not work around it in glibc, if at all? Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html