From nobody Wed Mar 23 17:26:52 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 98BD51A2262C for ; Wed, 23 Mar 2022 17:26:53 +0000 (UTC) (envelope-from bugzilla-noreply@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KNwJY2tQDz3LsR for ; Wed, 23 Mar 2022 17:26:53 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA15827A3D for ; Wed, 23 Mar 2022 17:26:52 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 22NHQqWj066219 for ; Wed, 23 Mar 2022 17:26:52 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 22NHQqkQ066218 for bugs@FreeBSD.org; Wed, 23 Mar 2022 17:26:52 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 262378] emulators/wine-devel won't start on CURRENT due to ASLR changes Date: Wed, 23 Mar 2022 17:26:52 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: regression X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: damjan.jov@gmail.com X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648056413; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UG/rx9gP/1+H+XK0bqQgsbwwrF+KvdE3YsO4K4KQKrE=; b=H/znaMRJIVHzXzgY0T68Z7+45euqbWGcrBuaoY2rMsmu7W53TAtsbVW7QUhN+97Z120uPp KTxgcotwDkSzn7TOlea5o+NaoGu/g0gdU1JUeeyshK6VykAJsHF0MALK9BtCdVScox7GGO 8FZo60fL3rZeoHq6mY7DgkQDbYb4I1oXFj8e+r9YVAPnFudiE2GnSJTR/gaWmZAHSR4Sgj M+tUijPlGZQdlVSLJj7yZCP4TGcMSNEY5vlwkdxYrUCMikDoYdQZKNX/DVbxCsfvByemna QoD+SXtKW0rWJrg4i7Saj6jOKg+X2IWe912HQwEouiOwPHcNlKuHytiGEpkIqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648056413; a=rsa-sha256; cv=none; b=AzRdbcXqyLBXK7BVvqzVCQpM030tzl14HK0u0SbgbRd+XWfXIU97dmiuOdyiHSQ16OdtPm xQI3+bX9SzJpZrKIEjgdfmUkwdHD4vmgLI0dTI36HxmnX5WVvq0TjpzRysT6djSOeZBBf6 aJsxa/jYzUkByJY5kBH/G4XNZFwCvUSLJjDwO2DRTW1XMIIjjWAyHUCNQ/WsQ5IZL3OrjX nxXSKduVrc3oyYURrl2nEAWENs0GNJQ9jIrXB8BGCZescrsyOowJFzXdCm/MvL7dvpFCk+ 2FOZ+NAP0cqUOfBCq+zQNQTeCXdRiPYfteHxEjABPo1kzK/TE3kBF1qCGKliEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D262378 --- Comment #10 from Damjan Jovanovic --- err:virtual:virtual_alloc_first_teb wine: failed to map the shared user dat= a: c0000017 c0000017 =3D=3D STATUS_NO_MEMORY virtual_alloc_first_teb() in dlls/ntdll/unix/virtual.c gives that error when this fails: ---snip--- /* reserve space for shared user data */ status =3D NtAllocateVirtualMemory( NtCurrentProcess(), (void **)&user_shared_data, 0, &data_size, MEM_RESERVE | MEM_COMMIT, PAGE_READONLY ); ---snip--- where, importantly: struct _KUSER_SHARED_DATA *user_shared_data =3D (void *)0x7ffe0000; That NtAllocateVirtualMemory() calls map_view() which calls map_fixed_area(= ), where mmap_is_in_reserved_area() returns 0 ("not in a reserved area, do a normal allocation"), leading to a call to anon_mmap_tryfixed(), which attem= pts to: mmap((void *)0x7ffe0000, 4096, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_ANON|MAP_EXCL, -1, 0); This fails, setting off the error message and exit. Why does it fail? Dumping /proc/curproc/map just before or after the mmap failure, shows this enormous mapping already occupying the required memory range (0x7ffe0000 - 0x7ffe1000): 0x62bd6000 0x82bb6000 0 0 0 --- 0 0 0x0 NCOW NNC none - NCH -1 It's 536,739,840 bytes (or 0x1ffe0000) long! When I make a standalone binary that calls mmap() with those arguments, it succeeds, so that large mapping is not a standard feature of FreeBSD 14-CUR= RENT with ASLR. Where did it come from? --=20 You are receiving this mail because: You are the assignee for the bug.=