From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752528AbdFPPZv (ORCPT ); Fri, 16 Jun 2017 11:25:51 -0400 Received: from mx2.suse.de ([195.135.220.15]:58761 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750899AbdFPPZu (ORCPT ); Fri, 16 Jun 2017 11:25:50 -0400 Date: Fri, 16 Jun 2017 17:25:47 +0200 From: Michal Hocko To: Theodore Dubois Cc: mtk.manpages@gmail.com, linux-man@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mmap.2: mmap with address NULL and MAP_FIXED results in EPERM Message-ID: <20170616152546.GA31298@dhcp22.suse.cz> References: <20170615190901.30119-1-tblodt@icloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170615190901.30119-1-tblodt@icloud.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 15-06-17 12:09:01, Theodore Dubois wrote: > This can be verified with a simple test program. I'm not sure if this is > a kernel bug or a documentation bug, though... THis is not a bug. You are not allowed to mmap anything below /proc/sys/vm/mmap_min_addr. So your patch to update documentation would have to mention this sysctl to be correct. > --- > man2/mmap.2 | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/man2/mmap.2 b/man2/mmap.2 > index d1942b52a..58361c837 100644 > --- a/man2/mmap.2 > +++ b/man2/mmap.2 > @@ -515,6 +515,13 @@ was mounted no-exec. > .\" (Since 2.4.25 / 2.6.0.) > .TP > .B EPERM > +The > +.I addr > +argument is 0 and > +.B MAP_FIXED > +is specified. > +.TP > +.B EPERM > The operation was prevented by a file seal; see > .BR fcntl (2). > .TP > -- > 2.13.1 -- Michal Hocko SUSE Labs