Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4595803ybi; Sat, 6 Jul 2019 08:32:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqw5eY9xcsZpw0R/tPUDFfv1WVdmnwE8MrTtdXCPvQhzLEqq2ld6FeEJVDQxTEv7qgzurWq2 X-Received: by 2002:a17:902:20b:: with SMTP id 11mr12248568plc.78.1562427178836; Sat, 06 Jul 2019 08:32:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562427178; cv=none; d=google.com; s=arc-20160816; b=EVz+KTg6IZMz4LabBiH9F7VBdXQqHSzdn1KqPUw7zCnrVf4bGxSGrthDGjxr5CyyKf 6o884JDoUR4csfHtK8x9SsICjgBiylzzExucs12IprhZCQCvXCQS2vwjLnEB2mPBGG7F g7KiAi/VpINwMkvpQavjIccArGjoUCD76PWBtq0g4bbI0rcMsc7Urtrr+2AgQRLdB/aZ bHToY0qflGDPLYNKUDloHn7RRGsma6VqSrMsrdLxeAg/Nwwmzi8yzOdLWmeB+4NvhIkr NfZ2BXOCDSOw+kdeJ9lrLXYOTmQL4YYGYhn8HFdMaoAIxxfxct1nMBykopGBLJGypBtP wgug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=Q/Uw5dIsHFTudDNvgVGgrJz9lD9sd+Kaa8O2sHnXsmw=; b=dA4zQCVrBJYsYOveJhhJ83pLQ89sNZz7LvjiTAldEEpRHbJlyxrSv+Ie1Lu4M3ZGZK 8adsaloMe7kytmdF1k+FY4SPPX+y0SS0LBAsX6EVQ0SxICInjhRmJ3Unp4zjccSRCarm RsYvzAzAGlQS7X2EAI8fzKaq5tBqdnXRvJFh3CdQYeWjW/p2hWCZe4NNEoBtHyAF90+n zJUTx2dJn31qqYhwMj6ZJRp0YoUJGhvdeD8TE7S0tEiy4pgFMpH13tbBa08rL9s/55Jx tfE+PCFuMLJaB4MYmpUgkIhFA2SSextdWUCD+zJKJUbEq/oAKhY2PGZ94OaCI7k1nqvS 4qlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=cmJgo3I5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i71si12141201pge.3.2019.07.06.08.32.44; Sat, 06 Jul 2019 08:32:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=cmJgo3I5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726808AbfGFPcU (ORCPT + 99 others); Sat, 6 Jul 2019 11:32:20 -0400 Received: from merlin.infradead.org ([205.233.59.134]:41944 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726267AbfGFPcU (ORCPT ); Sat, 6 Jul 2019 11:32:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Q/Uw5dIsHFTudDNvgVGgrJz9lD9sd+Kaa8O2sHnXsmw=; b=cmJgo3I5TzZVReZe18xORp8oxP VXY4xNfqtX2mnXvoN/6ZEpFJNjR9dviNSO7LpOBOvXrbcTA9HelIkGn2GEfsOomvE11BQ3jWcK4Ng igvVajyszClx57PmbMHN/yeS3vriO30/nDt2jk/M11usjctitA7eVWBJPGE7eglxLDy738JqLqM93 E0jRy/EdKzzOr0Vie7pv4vCQjYbGTyIVL23duY59LFdKPtiT0J7mmWXCWTUTtsQMGuCsaS2jxcHsC W+5Gys7PPNHitASuKSwYx5KvL32myUym+NFbDVrTIne5ykAP5n0trGhDacbe/h+B2QN17BBiPExzb 5edt6X1w==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by merlin.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hjmfQ-00017D-Aw; Sat, 06 Jul 2019 15:32:00 +0000 Subject: Re: [PATCH v5 08/12] S.A.R.A.: trampoline emulation To: Salvatore Mesoraca , linux-kernel@vger.kernel.org Cc: kernel-hardening@lists.openwall.com, linux-mm@kvack.org, linux-security-module@vger.kernel.org, Alexander Viro , Brad Spengler , Casey Schaufler , Christoph Hellwig , James Morris , Jann Horn , Kees Cook , PaX Team , "Serge E. Hallyn" , Thomas Gleixner References: <1562410493-8661-1-git-send-email-s.mesoraca16@gmail.com> <1562410493-8661-9-git-send-email-s.mesoraca16@gmail.com> From: Randy Dunlap Message-ID: <28431b5d-c34c-a54b-acbf-70d1ae635e0d@infradead.org> Date: Sat, 6 Jul 2019 08:31:58 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <1562410493-8661-9-git-send-email-s.mesoraca16@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/6/19 3:54 AM, Salvatore Mesoraca wrote: > diff --git a/security/sara/Kconfig b/security/sara/Kconfig > index 54a96e0..458e0e8 100644 > --- a/security/sara/Kconfig > +++ b/security/sara/Kconfig > @@ -117,6 +117,24 @@ choice > Documentation/admin-guide/LSM/SARA.rst. > endchoice > > +config SECURITY_SARA_WXPROT_EMUTRAMP > + bool "Enable emulation for some types of trampolines" > + depends on SECURITY_SARA_WXPROT > + depends on ARCH_HAS_LSM_PAGEFAULT > + depends on X86 > + default y > + help > + Some programs and libraries need to execute special small code > + snippets from non-executable memory pages. > + Most notable examples are the GCC and libffi trampolines. > + This features make it possible to execute those trampolines even This feature makes it possible > + if they reside in non-executable memory pages. > + This features need to be enabled on a per-executable basis This feature needs to be > + via user-space utilities. > + See Documentation/admin-guide/LSM/SARA.rst. for further information. > + > + If unsure, answer y. > + > config SECURITY_SARA_WXPROT_DISABLED > bool "WX protection will be disabled at boot." > depends on SECURITY_SARA_WXPROT -- ~Randy