DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 4BIETU58470516 Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 4BIETU58470516 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=jcax7HcZ X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B10663858C98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1734532167; bh=q4ais8HYImT6cIWy6CWgnreSHwzszf+MqEe30h6qWIw=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=jcax7HcZjZCia8JVBpJHooVBErskvOn9jQiIz7LreujAPrCouPQmOLucfgZQPdiO+ o8hL3WsaJpZ6S1dDZJ1UIVBkFrP2k1Vh8DcILwjkkXKpdk8jld7uSIsjarEL/jgmCl 8ijO5bQESC7v6hFvixi0Vkv03JB+C5CWyK/wP1oI= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AD5EF3858D20 Date: Wed, 18 Dec 2024 15:28:24 +0100 To: cygwin AT cygwin DOT com Subject: Re: Atomic mmap replacement Message-ID: Mail-Followup-To: cygwin AT cygwin DOT com References: <66bf4f86-4618-b9a3-3e33-2c240b9204d0 AT cornell DOT edu> <20180219090042 DOT GC3417 AT calimero DOT vinschen DOT de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Corinna Vinschen via Cygwin Reply-To: cygwin AT cygwin DOT com Cc: Corinna Vinschen Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Hi Ken, On Dec 17 15:23, Ken Brown via Cygwin wrote: > Hi Corinna, > > On 12/17/2024 11:38 AM, Corinna Vinschen via Cygwin wrote: > > Ideally a separate patch. If you see a chance to send it to cygwin-patches > > this week, we can even merge it into 3.5.5, which I'm planning to release > > end of this week (after that --> vacation :))) > That should be no problem. By the way, I think I found a second bug. > Shouldn't mmap:649 be > > (*) if (u_addr > (caddr_t) addr || u_len < len > > instead of > > (**) if (u_addr > (caddr_t) addr || u_addr + len < (caddr_t) addr + len > > ? > > If the first condition in (**) fails, then u_addr == addr, so the second > condition is automatically false. But what we want to be testing at this > point is whether the matched region is big enough, as in (*). Or am I > confused? u_addr could be < addr. We have two areas, the free area in u_addr and u_len, and the requested area in addr and len. So we have to check that addr is >= u_addr and addr + len is <= u_len: |----------------------------------------------------| u_addr u_addr + u_len |--------------------| addr addr + len Make sense? Corinna -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple