Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755433AbdDLUlN (ORCPT ); Wed, 12 Apr 2017 16:41:13 -0400 Received: from nm29-vm3.bullet.mail.ne1.yahoo.com ([98.138.91.159]:33572 "EHLO nm29-vm3.bullet.mail.ne1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754805AbdDLUlK (ORCPT ); Wed, 12 Apr 2017 16:41:10 -0400 X-Yahoo-Newman-Id: 574827.35490.bm@smtp201.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: U3MJMXgVM1lv3Ph4cqJ8ufwam2of1T9Eb0XD6a2X36IeLJs NqnqiSBP7rE0dZ4jJJwDc8c7LX.umY6jafzDR3h.PyFV046nAVG8BVIvIOSb 70QtySCus4A.w1gzhuxGtMz_XJoSfP7PxjERcDUFFHBp2Ytrxd6tzMgRs8.p l4eVflSp3WeYBUuoq7Dgfkakv3VACHgAQUX7YuLMt0gMYx.zJ9tI_ePoeoCf Lj3YNoHDd7JTyqZAUhJQTI7EIQBt3FftKzQiYaf4RsuM9GhrQf5Oagg.Pndo zYRZlhtL3sC8wYuYW0ng5HhhowqnbYIX8wLbmpyfSw__a5wa.GCCrlLOWAkt jbiseNXO0P6hN_LEYwbgWz3xaJA9VRRoRKoia9x9COZtaMoZiYNFEO_Vn5tf sbn209abh4JNJyUtfN2N1Ocg1_oksia0dFgE9civzYGIubIWSEj9M2N_jsOG COmPBxMkoyBXLlwJlRrgGTNQiazElvTWo8gb0Wpl0mSkpybTVgxcfFOH3s22 QcvH.CnQFlyWrXeTX28ZTQd2ssOM6tqGfNT8FIZ0YvjsjjB8- X-Yahoo-SMTP: OIJXglSswBDfgLtXluJ6wiAYv6_cnw-- Subject: Re: [kernel-hardening] Re: [PATCH RFC v2 1/3] LSM: Allow per LSM module per "struct task_struct" blob. To: Djalal Harouni , Kees Cook References: <1491734530-25002-1-git-send-email-tixxdz@gmail.com> <1491734530-25002-2-git-send-email-tixxdz@gmail.com> <2698e97b-397e-0fc0-84a1-dc9a4226117a@schaufler-ca.com> Cc: Linux Kernel Mailing List , Andy Lutomirski , Andrew Morton , "kernel-hardening@lists.openwall.com" , LSM List , Linux API , Dongsu Park , James Morris , "Serge E. Hallyn" , Paul Moore , Tetsuo Handa , Greg Kroah-Hartman , Casey Schaufler From: Casey Schaufler Message-ID: <065b8eeb-3558-509c-5233-5bacb247e79c@schaufler-ca.com> Date: Wed, 12 Apr 2017 13:41:03 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2076 Lines: 37 On 4/12/2017 9:22 AM, Djalal Harouni wrote: > On Tue, Apr 11, 2017 at 6:43 AM, Kees Cook wrote: >> On Mon, Apr 10, 2017 at 1:00 PM, Djalal Harouni wrote: >>> On Mon, Apr 10, 2017 at 9:26 PM, Casey Schaufler wrote: >>>> I think that would be the prudent approach. There is still >>>> the possibility that blob sharing (or full stacking, if you >>>> prefer) won't be accepted any time soon. >>> Ok Casey! I will wait for more feedback, and if other maintainers do >>> not object, I will convert it back to rhashtables in next iterations >>> making sure that it should be simple to convert later to a blob >>> sharing mechanism. >> Would it be possible just to add a single field to task_struct if this >> LSM is built in? I feel like rhashtables is a huge overhead when a >> single field is all that's needed. > Well, yes rhashtables can have an overhead especially when reclaiming > memory back, I could not identify a way how to separate tables unless > we use cgroups as an ID. Anyway this of course could be added in > task_struct and updated to work like the capability security hooks > rather than a proper LSM with its own name. But as noted in the other > response, we may need task->security field for Yama anyway. I'm open > to suggestion ? I may try to converge the task->security blob with > what Casey is proposing and see! otherwise fallback to task_struct as > a last resort! > > Thanks! I can present a patch set based on my existing stacking work that includes the move from module based memory management to infrastructure memory management but pretty well stops there. There will be changes to Kconfig to allow stacking of everything except SELinux and Smack, because that's the only combination with other conficts. Well, there's /proc/attr, but I'd include the module specific subdirectories, too. That would allow landlock to come in and TOMOYO (and potentially YAMA) to use/share the task blob. I see this as taking down a barrier rather than otherwise pointless infrastructure change.