From nobody Fri Dec 10 20:48:51 2021 X-Original-To: freebsd-current@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 BCD1518CCB31 for ; Fri, 10 Dec 2021 20:48:54 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J9jgB4gYJz4kKm for ; Fri, 10 Dec 2021 20:48:54 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x72c.google.com with SMTP id de30so8981024qkb.0 for ; Fri, 10 Dec 2021 12:48:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=cPVtKBTtIajLghdZ/JYWjcW1mOE6UAN7KrIC/2OO0fc=; b=Yc8P1U7p8209PMXaluBWlU+VMoQkzfPgJdcLx6GKy2oh+GKEDS3HOxCZYFNbE8bhKk fIn49vaDZJBIIyBTewC8dGQwBc1ASo/oFjhAFyygW86rpPz/nmCgQCUbqhc5wNwNJGub q6BdeOq/sC8N5ZhRPXj3xbWGvhTVFHNYMD/3+s+6pjOwN68YYa3q8yn44mMRkpEAHLCa g4FBBzH3KGjv/GfSdtksfwSpSsq+YVbsFWlgtZv6Bs//3BihSSVIO2QX6EVnvf1s38yH GuJNwSOr7UhoJYvMmzrreeJrhj5XSjUOpkgF4CF7cscq2IWbOGlScBz9GMdNnDD6qw2x lraw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to; bh=cPVtKBTtIajLghdZ/JYWjcW1mOE6UAN7KrIC/2OO0fc=; b=PY8idsK5R3EneA6J2yaE2YHPNmECFQLBUzL3y8Nf4f6Bd7khP0r5+zIqe67Xrj/Kye SP/8pvSEhBEw7rJquYojGtBzrig5EyG8HvSc6HY4Jy4ziEQ7lwTxChu16dqbGIawf4mc 70e6NN5NdteBnbtD9t+ztUEBPCq434sRdEdyLfAX1uA6N2iusl66amapAu9ObxnX0TGG 5/qWzJh/4nVVRYoueE3RqW+Pn6zc4OOsgQXUCnaKqF5PSqMHu+ae9I5CR6Luu0W42Xbu 0f9ERB7Chi/WRVLEeCHvXaykyaQ+IsBbuhpYWNJ35MxSAjfza6RIiwkLSgJLTDBug8bt I0yw== X-Gm-Message-State: AOAM530IPHHETZhG9nnvqFWAokzCb5kVmK79yi/Dw681gf5qPLhGFzVk 7kFGrDd67AWaqbJpX2ekYCp6jzZrowApXg== X-Google-Smtp-Source: ABdhPJwb5GLivCAHHc7wOxDfEyGeofnf596Hd7jKlUqaASU2QJmAJ9yiifvNnnqu/EJviHwRMWnSDQ== X-Received: by 2002:a05:620a:400f:: with SMTP id h15mr23139672qko.226.1639169334048; Fri, 10 Dec 2021 12:48:54 -0800 (PST) Received: from nuc ([142.126.186.191]) by smtp.gmail.com with ESMTPSA id l15sm2800301qtx.77.2021.12.10.12.48.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 12:48:53 -0800 (PST) Date: Fri, 10 Dec 2021 15:48:51 -0500 From: Mark Johnston To: Marcin Wojtas Cc: Daniel O'Connor , freebsd-current , Fabien Thomas , MARECHAL Boris , Rafal Jaworowski , Damien DEVILLE Subject: Re: HEADS-UP: ASLR for 64-bit executables enabled by default on main Message-ID: References: <7101CA73-DCAD-4DEF-9861-C62789D22596@dons.net.au> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspamd-Queue-Id: 4J9jgB4gYJz4kKm X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Fri, Dec 10, 2021 at 06:35:47PM +0100, Marcin Wojtas wrote: > Hi Daniel > > > pt., 10 gru 2021 o 10:16 Daniel O'Connor napisaƂ(a): > > > > > > > > > On 17 Nov 2021, at 09:00, Marcin Wojtas wrote: > > > As of b014e0f15bc7 the ASLR (Address Space Layout > > > Randomization) feature becomes enabled for the all 64-bit > > > binaries by default. > > > > Firstly, thank your for your efforts here, it is appreciated :) > > > > I am finding that the lang/sdcc port is crashing with a seg fault and the core dump is no help to me at all: > > [freebsd14 7:06] /usr/ports/lang/sdcc/work/sdcc-4.0.0/device/lib >sudo gdb ../../bin/sdcc sdcc.core > > GNU gdb (GDB) 11.1 [GDB v11.1 for FreeBSD] > > > > Reading symbols from ../../bin/sdcc... > > [New LWP 100122] > > Core was generated by `../../bin/sdcc -I../../device/include -I../../device/include/mcs51 -mds390 --nos'. > > Program terminated with signal SIGSEGV, Segmentation fault. > > Invalid permissions for mapped object. > > #0 0x0000000804e3fbc0 in setrlimit () from /lib/libc.so.7 > > (gdb) info thread > > Id Target Id Frame > > * 1 LWP 100122 0x0000000804e3fbc0 in setrlimit () from /lib/libc.so.7 > > (gdb) bt > > #0 0x0000000804e3fbc0 in setrlimit () from /lib/libc.so.7 > > Backtrace stopped: Cannot access memory at address 0x7fffff87fd08 > > > > If I disable ASLR (via proccontrol) then it does not crash, but I am not sure how I can debug it further. > > > > I've raised a bug https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260303 if you (or anyone else) has suggestions for what to try. > > > > Thanks for filing the ticket. Let's continue the conversation there. I left a comment there. The gist of it is that there are several lingering problems with the stack gap implementation, and I think we should re-disable it on main until there's some consensus on how to proceed.