From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12010 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH v1] mman: fix mmap pass wrong offset to kernel Date: Mon, 16 Oct 2017 12:27:43 -0400 Message-ID: <20171016162743.GP1627@brightrain.aerifal.cx> References: <20171016110318.GQ15263@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1508171290 18050 195.159.176.226 (16 Oct 2017 16:28:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 16 Oct 2017 16:28:10 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Minqiang Chen To: musl@lists.openwall.com Original-X-From: musl-return-12023-gllmg-musl=m.gmane.org@lists.openwall.com Mon Oct 16 18:28:06 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1e48FA-0002vg-WD for gllmg-musl@m.gmane.org; Mon, 16 Oct 2017 18:27:57 +0200 Original-Received: (qmail 19559 invoked by uid 550); 16 Oct 2017 16:28:00 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 19538 invoked from network); 16 Oct 2017 16:27:59 -0000 Content-Disposition: inline In-Reply-To: <20171016110318.GQ15263@port70.net> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:12010 Archived-At: On Mon, Oct 16, 2017 at 01:03:18PM +0200, Szabolcs Nagy wrote: > * Minqiang Chen [2017-10-16 09:09:32 +0800]: > > > > musl: fix mmap pass wrong offset to kernel > > > > > > > > for example off_t x=0x8d9eb000, the x/4096 result is 0xfff8d9eb, > > not 0x8d9eb as expecting > > > > off_t is 64bit, not 32bit, so x/4096 should not signextend. > you need to investigate this problem more. I suspect the calling code stored the offset 0x8d9eb000 in a signed 32-bit variable (converting it to a negative value) and then passed the resulting negative value to mmap. Rich