From owner-dev-commits-src-main@freebsd.org Tue Jan 12 02:57:44 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E3E24EED86; Tue, 12 Jan 2021 02:57:44 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFFcS0q1tz3pSp; Tue, 12 Jan 2021 02:57:43 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f46.google.com with SMTP id d9so1018861iob.6; Mon, 11 Jan 2021 18:57:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ECDWYgyI3A1CMK//Wf2nSRHu+vT6I73CUf1C/s3KG8A=; b=bq1LqFbmR3SlKzGyLQaOMiz7gXBPxv+vMJZgbapioXHwvlsrPw+50rl00SCzKJChcq TqaS9IacMqkI/XHgRp+2UR4HQ5ISVeV3eZ1eA8l2mDyA6ryY5XmzftqW+AsET6KEBMyr JQJLIbkXdhnRbP2RPRVaiA4J0HYyOGoPM2zMzx+nP+FNvRJJE2FPT8+DAIVruaqW9Qqh FEzEW/LojIxPu9oRUJe6gGhTIZrU8T4jMOyqLqcM9aX5u+TA8f6lWrRQptS/2GhFnTDk wzDgkB074p17K56o2IGdjNghx6zEaigmnEqDLkz7Y5Vwax9aMz2Dk0Zc5wbElocF28DN 8iGg== X-Gm-Message-State: AOAM531kVkjg2DqoEUKSt1DHF9yD41sVb/xwNbD93WrKTfJxdI1ReU+L DNRJgspyM9muyg5j9MoIiVTH2kQQCsCTHVIMFzvVikZ6dDqj2A== X-Google-Smtp-Source: ABdhPJzvOl7RUsRQVsjdVPoxZ8vHniz8JemxiybIld/i8YLbOVBBqzkkDNtDoqSItSJnpSF+iaIooM7xzqCa9X781cA= X-Received: by 2002:a92:d2ce:: with SMTP id w14mr2106656ilg.182.1610420261891; Mon, 11 Jan 2021 18:57:41 -0800 (PST) MIME-Version: 1.0 References: <202101112322.10BNMFFE035513@gitrepo.freebsd.org> <8f0f88f5-2a4b-a11d-7b9c-892443184b15@FreeBSD.org> In-Reply-To: <8f0f88f5-2a4b-a11d-7b9c-892443184b15@FreeBSD.org> From: Ed Maste Date: Mon, 11 Jan 2021 21:57:30 -0500 Message-ID: Subject: Re: git: 2e1c94aa1fd5 - main - Implement enforcing write XOR execute mapping policy. To: John Baldwin Cc: Konstantin Belousov , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4DFFcS0q1tz3pSp X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2021 02:57:44 -0000 On Mon, 11 Jan 2021 at 19:34, John Baldwin wrote: > > To be clear though, this doesn't set the default to enforcing W^X, it just > adds a knob that can be set to enforce that on most binaries. My guess is > that the plan is to get some testing/exposure of this on head (e.g. doing > an exp-run with this set would probably be a good test?) and then flip the > default to enable this restriction in the future? Yes, an exp-run would be useful, although I don't think it will find too much unless we execute regression tests on the built ports. We can ask folks to turn it on and report problems; note that any ELF binary requesting an executable stack will (appear to) abort at startup, and will have to be fixed to request a non-executable stack. Other than that I have seen no fallout after enabling this on my laptop. To enable set the two sysctls: kern.elf32.allow_wx=0 kern.elf64.allow_wx=0