From owner-svn-src-all@freebsd.org Wed Oct 21 21:40:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44F8142E16C; Wed, 21 Oct 2020 21:40:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CGkSL17hKz3ZPj; Wed, 21 Oct 2020 21:40:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A4DBC4B1; Wed, 21 Oct 2020 21:40:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09LLeXXD087132; Wed, 21 Oct 2020 21:40:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09LLeXIJ087131; Wed, 21 Oct 2020 21:40:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010212140.09LLeXIJ087131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 21 Oct 2020 21:40:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366918 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 366918 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2020 21:40:34 -0000 Author: kib Date: Wed Oct 21 21:40:33 2020 New Revision: 366918 URL: https://svnweb.freebsd.org/changeset/base/366918 Log: mmap(2): Document guard size for MAP_STACK and related EINVAL. Based on submission by: emaste Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D26894 Modified: head/lib/libc/sys/mmap.2 Modified: head/lib/libc/sys/mmap.2 ============================================================================== --- head/lib/libc/sys/mmap.2 Wed Oct 21 21:28:20 2020 (r366917) +++ head/lib/libc/sys/mmap.2 Wed Oct 21 21:40:33 2020 (r366918) @@ -28,7 +28,7 @@ .\" @(#)mmap.2 8.4 (Berkeley) 5/11/95 .\" $FreeBSD$ .\" -.Dd February 26, 2020 +.Dd October 21, 2020 .Dt MMAP 2 .Os .Sh NAME @@ -351,6 +351,8 @@ Stacks created with automatically grow. Guards prevent inadvertent use of the regions into which those stacks can grow without requiring mapping the whole stack in advance. +The size of the guard, in pages, is specified by sysctl +.Dv security.bsd.stack_guard_page . .El .Pp The @@ -451,6 +453,11 @@ or .Dv MAP_STACK was specified. At least one of these flags must be included. +.It Bq Er EINVAL +.Dv MAP_STACK +was specified and +.Va len +is less than or equal to the guard size. .It Bq Er EINVAL .Dv MAP_FIXED was specified and the