From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 13 13:17:14 2015 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB42BEA0 for ; Mon, 13 Apr 2015 13:17:14 +0000 (UTC) Received: from puchar.net (puchar.net [188.252.31.250]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "puchar.net", Issuer "puchar.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F912883 for ; Mon, 13 Apr 2015 13:17:14 +0000 (UTC) Received: Received: from 127.0.0.1 (localhost [127.0.0.1]) by puchar.net (8.14.9/8.14.9) with ESMTP id t3DDH9N8027777 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 13 Apr 2015 15:17:10 +0200 (CEST) (envelope-from wojtek@puchar.net) Received: from laptop.wojtek.intra (localhost [127.0.0.1]) by laptop.wojtek.intra (8.14.9/8.14.9) with ESMTP id t3DDH9XR005554; Mon, 13 Apr 2015 15:17:09 +0200 (CEST) (envelope-from wojtek@puchar.net) Received: from localhost (wojtek@localhost) by laptop.wojtek.intra (8.14.9/8.14.9/Submit) with ESMTP id t3DDH4EG005551; Mon, 13 Apr 2015 15:17:04 +0200 (CEST) (envelope-from wojtek@puchar.net) X-Authentication-Warning: laptop.wojtek.intra: wojtek owned process doing -bs Date: Mon, 13 Apr 2015 15:17:04 +0200 (CEST) From: Wojciech Puchar X-X-Sender: wojtek@laptop.wojtek.intra To: Oliver Pinter Subject: Re: another question - VM mappings In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (puchar.net [10.0.1.1]); Mon, 13 Apr 2015 15:17:10 +0200 (CEST) Cc: "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 13:17:14 -0000 thanks! On Mon, 13 Apr 2015, Oliver Pinter wrote: > Under amd64 exists an so called shared-page - similar to linux's vdso > mechanism - https://github.com/freebsd/freebsd/blob/master/sys/kern/kern_exec.c#L1045 > . > > This page is double mapped with user-space and with kernel. From > security reason it's only RO, otherwise, when mapped with RW or RWX, > then you could write kernel memory from user-space. > > On Mon, Apr 13, 2015 at 9:31 AM, Wojciech Puchar wrote: >> below is mapping for very simple process (no libc etc) >> >> [wojtek@laptop ~]$ procstat -v 917 >> PID START END PRT RES PRES REF SHD FL TP >> PATH >> 917 0x400000 0x401000 r-x 1 0 1 0 CN-- vn >> /home/wojtek/test/1 >> 917 0x600000 0x601000 rw- 1 0 1 0 ---- df >> 917 0x7ffffffdf000 0x7ffffffff000 rw- 1 0 1 0 ---D df >> 917 0x7ffffffff000 0x800000000000 r-x 0 0 39 0 ---- ph >> >> >> what is "ph" mapping and why read&executable? > >