From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2B20C2D0A3 for ; Sat, 24 Oct 2020 14:15:01 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9C21220FC3 for ; Sat, 24 Oct 2020 14:15:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Lmf4opUQ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IzmyyaMK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C21220FC3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bz4IbM8cw32k62ZXaFgHZCu1IYw+GeAA/UuHVZ8oVNw=; b=Lmf4opUQwfzXusb9KbemfQBKN DgygVsIS2u9hGzFK6gRWoIMMRO0AoMO8e58we37sqXEL0xIsFM9vss73k0zYmMDhoeOVA3sQ6VB/M PL408WJ7S7/Bf98XBhI1+b6RiwDiX5V4MuJreOUoM/ErV35Y0napZYiAy7Zu94lPG+cooWEzwnksh KyBhyJREtxD1t3frd4MXkiyi56SYaPwwN90KiprRgh/6QRtg4Sh50YiNrp8jGHeAE6veTWhCyeUi6 X6+MwpxRO580TRKUZyGXirRyRcx2RJnTa4ARX6k7n6WMTYFJK/v8xitqgf99V/OQw/HHfZNhMpBOr WmgIjov+Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kWKHr-0004u1-O6; Sat, 24 Oct 2020 14:12:51 +0000 Received: from mail-il1-x142.google.com ([2607:f8b0:4864:20::142]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kWKHp-0004tV-7t for linux-arm-kernel@lists.infradead.org; Sat, 24 Oct 2020 14:12:50 +0000 Received: by mail-il1-x142.google.com with SMTP id j17so4155916ilr.2 for ; Sat, 24 Oct 2020 07:12:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MgJfeca/4s0satLk61+xOaVoEfLF7ds/Hi2JJEDziWU=; b=IzmyyaMKU2FOSHtQEv29DmMZ//m10onETt/WtXiLJiW/9Niiew7CKHOfdD0QD+iq0r g8ZU06WwFvjWtyJQhXFsnF/6x0Gm/ir3FAprI+07pbGtdb+FeM7MmjKdUOrn/ta+hCNz bELE3uPLlHqPSdnAfUdnmX6qg+RIoMep0UXSZZxA8ysv+nAeLrtlgclER3WEPFILvFpK nAvM6vXz4BVY0iErk77oeVia6Uo8SaaH0O7ljraTkjq0j/LMPpiKgvtBDxCYJ2xBOvsr lta/5kNNzxFL4BTXBv86WYLJt6KSo/Rki35Gkyce0gLg8q7gCcWN/7Xk8s9pROJmjw0C j2jw== 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=MgJfeca/4s0satLk61+xOaVoEfLF7ds/Hi2JJEDziWU=; b=atG5vKqXRHzatpcyeDFZgcV+SRhRXJHFAv/ZUpXfJCFRMWNt/LS41nWRMnzcprfri7 1L4d1CbJBD5zZPYYVuaPawa9M1cAIEomZCaimpaw+G/Ycfcm5QR+6GE2XzxK64J6zWMm 13L+GoVq2FA4VqsKrJxDJ/mHDwsTdavEbtjBTKNYxnTkTPbrmh81RUj1qcm8NaBJycIT k8lRJeQh4iWYNPKY+gAOlb0RbV6OJUyYvOfMzl7ZdgLyCi8W1M/1DygQJXN3aEsWyzx4 jjhW26hWPJF2/MkRVyN8aYsWeb0v7UmjluJ3ZGNcXnMWffoO89qXhaAwJsZoxbM7IP5a sXVA== X-Gm-Message-State: AOAM530uWMeXlcJr3EduwuOiD/nj054vxTB+0JVTZv7L9UcIWInSdui+ ezgr9XHeFIplk3QUu0Amu2jNlGGsX4671y0eQq3yER/XtHg= X-Google-Smtp-Source: ABdhPJxALtvx3WMpnAnGGl1WqPBhdzP0ukYGoUEMsX7+QBgav0+412nekJGtwDyIlYZt5kvFXudvUAnQw7PTyzqFPh4= X-Received: by 2002:a05:6e02:d01:: with SMTP id g1mr4895628ilj.246.1603548767191; Sat, 24 Oct 2020 07:12:47 -0700 (PDT) MIME-Version: 1.0 References: <8584c14f-5c28-9d70-c054-7c78127d84ea@arm.com> <20201022075447.GO3819@arm.com> <78464155-f459-773f-d0ee-c5bdbeb39e5d@gmail.com> <202010221256.A4F95FD11@keescook> <180cd894-d42d-2bdb-093c-b5360b0ecb1e@gmail.com> <3cb894d4-049f-aa25-4450-d1df36a1b92e@gmail.com> In-Reply-To: <3cb894d4-049f-aa25-4450-d1df36a1b92e@gmail.com> From: Salvatore Mesoraca Date: Sat, 24 Oct 2020 15:12:36 +0100 Message-ID: Subject: Re: BTI interaction between seccomp filters in systemd and glibc mprotect calls, causing service failures To: Topi Miettinen X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201024_101249_323501_93BCE756 X-CRM114-Status: GOOD ( 21.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , systemd-devel@lists.freedesktop.org, Kees Cook , Kernel Hardening , Szabolcs Nagy , Catalin Marinas , Will Deacon , "linux-kernel@vger.kernel.org" , Jeremy Linton , Mark Brown , linux-hardening@vger.kernel.org, libc-alpha@sourceware.org, Dave Martin , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, 24 Oct 2020 at 12:34, Topi Miettinen wrote: > > On 23.10.2020 20.52, Salvatore Mesoraca wrote: > > Hi, > > > > On Thu, 22 Oct 2020 at 23:24, Topi Miettinen wrote: > >> SARA looks interesting. What is missing is a prctl() to enable all W^X > >> protections irrevocably for the current process, then systemd could > >> enable it for services with MemoryDenyWriteExecute=yes. > > > > SARA actually has a procattr[0] interface to do just that. > > There is also a library[1] to help using it. > > That means that /proc has to be available and writable at that point, so > setting up procattrs has to be done before mount namespaces are set up. > In general, it would be nice for sandboxing facilities in kernel if > there would be a way to start enforcing restrictions only at next > execve(), like setexeccon() for SELinux and aa_change_onexec() for > AppArmor. Otherwise the exact order of setting up various sandboxing > options can be very tricky to arrange correctly, since each option may > have a subtle effect to the sandboxing features enabled later. In case > of SARA, the operations done between shuffling the mount namespace and > before execve() shouldn't be affected so it isn't important. Even if it > did (a new sandboxing feature in the future would need trampolines or > JIT code generation), maybe the procattr file could be opened early but > it could be written closer to execve(). A new "apply on exec" procattr file seems reasonable and relatively easy to add. As Kees pointed out, the main obstacle here is the fact that SARA is not upstream :( Salvatore _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel