Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1056399pxb; Tue, 3 Nov 2020 21:43:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJxvAEPf/zVM7hYQ2msq0KPan7oOxrbFOyJ/wQQic2abuMhmNJE2SEDYfi7WVRJJi5ttSwdu X-Received: by 2002:a17:906:cb88:: with SMTP id mf8mr20168120ejb.31.1604468639680; Tue, 03 Nov 2020 21:43:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604468639; cv=none; d=google.com; s=arc-20160816; b=Cswfwm5y9aamBDhZm+AxMSXdAqBPFeHX/5QAJoAGggmsaFwuBwD5jteBmb9zuxjTq/ IeAz04Twh2U+6Ex/neS+FWpZBxwf6bvB+BEXaJ9miRU/EdcrR4fhJPyiklzyr9uXXL4o iH3yXd7E+c2UkGEvYZnJV5ZK4rQkYEkDa0Y8+dVVGkV0d579s8Rswia2CuxkNwtHp/yI nIjtRA6Jz0VL1mLhAZvSBIUf1tq2nKgnLhL40X8Lks95XPSiTvfgEeCj+i63f3h23lyz 4MO0RQeqAcszMnG7acQw4kP0y7y9JAGAyWSJT4Mzn+ii7Lm5Gv09rWJv9lFfMnMHG+/h 5tCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=FBqfWucFlnRncZFYMes7mr+b+woEPq21CrsWAoo1JwQ=; b=JXC6/Dn8W6OdOKC5hq0u7mvnnPd4DecUpdzMgSPdNDai/3Wb/ceTyUi7ZW4DC2lKb3 BA3xousZUGxAeT0v9n9Bg89jzQ1iyeYNVRFxtyvYvPa/8ZqTU0gnvykRzem80M2lXUWS LuiLP+C4xrmhDpjkLJefkWPCuimrqhVOXoBNuXB3zIbSITHhIrVnV2MhrwMkIXRYOOqd JUmXNWHFW2t4tYLbK+nOJICkQYnTem7LBB49qkMN0AdTvqYAaiCxodNsJ9FqWpeUyZFs IPrRN8jTh78FlXBdUZPoXlgU+oe2z94Y7IHkjKUDDFh8jRG11VnBr1RsTqVLX8DcjuRi zCeQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d1si755723ejj.113.2020.11.03.21.43.28; Tue, 03 Nov 2020 21:43:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728162AbgKDFlp (ORCPT + 99 others); Wed, 4 Nov 2020 00:41:45 -0500 Received: from foss.arm.com ([217.140.110.172]:60192 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725535AbgKDFlp (ORCPT ); Wed, 4 Nov 2020 00:41:45 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E15A71474; Tue, 3 Nov 2020 21:41:43 -0800 (PST) Received: from [192.168.122.166] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 61DE03F719; Tue, 3 Nov 2020 21:41:43 -0800 (PST) Subject: Re: [PATCH 0/4] aarch64: avoid mprotect(PROT_BTI|PROT_EXEC) [BZ #26831] To: Mark Brown , Szabolcs Nagy Cc: libc-alpha@sourceware.org, Catalin Marinas , Mark Rutland , Will Deacon , Florian Weimer , Kees Cook , Salvatore Mesoraca , Lennart Poettering , Topi Miettinen , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-hardening@lists.openwall.com, linux-hardening@vger.kernel.org References: <20201103173438.GD5545@sirena.org.uk> From: Jeremy Linton Message-ID: <8c99cc8e-41af-d066-b786-53ac13c2af8a@arm.com> Date: Tue, 3 Nov 2020 23:41:42 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: <20201103173438.GD5545@sirena.org.uk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 11/3/20 11:34 AM, Mark Brown wrote: > On Tue, Nov 03, 2020 at 10:25:37AM +0000, Szabolcs Nagy wrote: > >> Re-mmap executable segments instead of mprotecting them in >> case mprotect is seccomp filtered. > >> For the kernel mapped main executable we don't have the fd >> for re-mmap so linux needs to be updated to add BTI. (In the >> presence of seccomp filters for mprotect(PROT_EXEC) the libc >> cannot change BTI protection at runtime based on user space >> policy so it is better if the kernel maps BTI compatible >> binaries with PROT_BTI by default.) > > Given that there were still some ongoing discussions on a more robust > kernel interface here and there seem to be a few concerns with this > series should we perhaps just take a step back and disable this seccomp > filter in systemd on arm64, at least for the time being? That seems > safer than rolling out things that set ABI quickly, a big part of the So, that's a bigger hammer than I think is needed and punishes !BTI machines. I'm going to suggest that if we need to carry a temp patch its more like the glibc patch I mentioned in the Fedora defect. That patch simply logs a message, on the mprotect failures rather than aborting. Its fairly non-intrusive. That leaves seccomp functional, and BTI generally functional except when seccomp is restricting it. I've also been asked that if a patch like that is needed, its (temporary?) merged to the glibc trunk, rather than just being carried by the distro's. Thanks, > reason we went with having the dynamic linker enable PROT_BTI in the > first place was to give us more flexibility to handle any unforseen > consequences of enabling BTI that we run into. We are going to have > similar issues with other features like MTE so we need to make sure that > whatever we're doing works with them too. > > Also updated to Will's current e-mail address - Will, do you have > thoughts on what we should do here? >