Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1240754imm; Fri, 14 Sep 2018 13:49:59 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY9Epbrz95hE/Oh7Rt1RL9994miTq5TMYdjYAgJpMZ6o6Y7un1NAfwUtZNFXE6NaaVcJ8GW X-Received: by 2002:a62:880c:: with SMTP id l12-v6mr14528368pfd.204.1536958199067; Fri, 14 Sep 2018 13:49:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536958199; cv=none; d=google.com; s=arc-20160816; b=fcGa+2B8J5qpSlm7K6lPiWB+RV64N/c+IusQhdSln8BcuFx813H6Ev0kaGMU1IofSk oPB9deTWZ+8KP4Mfx5dUDDlDo5jrO/nC3MMmRtPjJcbDLTBbSw728BuYh8Sdk/f+viH+ gACQEZPZylKyWJGbx+cPphnvbgDmiLF395ib/IT6XLDi/8WUlr59S4cdl2XJAMMRMSrP 9FEPrMs+hHXotvukl9dSsA4zut3uXvC0JS1kXT9jRO9X0cUd/EJdH4+Me1KL0fs53jJL WNCtRDGBuvv2SiTGfTtnkJcuXhtjelJx/zacX/1KB9w/J0nN+ULKh/VikMHHE2vi2iQ/ Vn3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=2uVeTV5Ex1ksHGlBVF0sXXy3gManY/sEHQgGZdBAnSQ=; b=Ntm6vfnMHDzFEDGYcmf7vxp218kmx/OoTPKk/Rsw5A1UVfPSQbfNdoq6j7OUN3g5a3 73KzPkAfkIxbpP7k/Y6+VVIBYU5T0NmGaTZxFU4y5qTbRFmLtVAFyItSr+EoXOQN+m0z SwuvFm838cVwGZpSSnu0DsIO0yDABdC0UjKiZnMjtp68LG4o+kVQxUy3AleNkPH75trc 2iyNO+gdQx5TNgb7QqTKA4BZ1o+H5/EvvB8rahjfFSWxxuFgjbuV2w58FrGA221vLyiY +bzb9SXOVhvTThj9wdkx9M8xZx7UpxPpHoWLpGB81HN+7l1Vc6L+eWeVBsxA608TTAzT xJng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=WbixYg5x; 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 p7-v6si8180973pli.82.2018.09.14.13.49.42; Fri, 14 Sep 2018 13:49:59 -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=pass header.i=@yahoo.com header.s=s2048 header.b=WbixYg5x; 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 S1728121AbeIOCEM (ORCPT + 99 others); Fri, 14 Sep 2018 22:04:12 -0400 Received: from sonic305-10.consmr.mail.bf2.yahoo.com ([74.6.133.49]:34882 "EHLO sonic305-10.consmr.mail.bf2.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727745AbeIOCEL (ORCPT ); Fri, 14 Sep 2018 22:04:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1536958082; bh=2uVeTV5Ex1ksHGlBVF0sXXy3gManY/sEHQgGZdBAnSQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=WbixYg5xKemFlquPZHv1GAcCx5izsGn0acE7DvrwUXF0XCm5098zvTJ+l+MeqSX53vcVCf965QTfDcdnTbQ7EOtTZvD6a3AK1i9ZJDFQyqkBv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jxy6.BYYu_gQMF0Kbnufdup95U2DduNqB_ECyAFxEZ.41FbzC7gJxuS3l89QXYSN TvIHZofbvkjn_ueTBld0aBKmvv_rT5HwedLch1XRfUeBI1FEo8WtmezKxGo_.MG3gVhzB32OAx4P z9innDm3QAdtkNAPillemP2SsUlFJgFR7Kcn..VKN93x_gH2uGSIwyedC9Cob55.eMdkjS_kHHP8 2cXDnPhlaZn89g3mG4VASlEusHgNccD8- Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.bf2.yahoo.com with HTTP; Fri, 14 Sep 2018 20:48:02 +0000 Received: from c-67-169-65-224.hsd1.ca.comcast.net (EHLO [192.168.0.102]) ([67.169.65.224]) by smtp426.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 680dcabb72fd6524d94ab1481012a204; Fri, 14 Sep 2018 20:47:59 +0000 (UTC) Subject: Re: [PATCH 10/10] LSM: Blob sharing support for S.A.R.A and LandLock To: Kees Cook Cc: Paul Moore , linux-security-module , James Morris , LKML , SE Linux , John Johansen , Tetsuo Handa , Stephen Smalley , "linux-fsdevel@vger.kernel.org" , Alexey Dobriyan , "Schaufler, Casey" References: <5b983bba-049c-795a-3354-a2e8ab33cecf@schaufler-ca.com> <2bc5e4f5-8429-6843-f255-8fab6dacf39b@schaufler-ca.com> From: Casey Schaufler Message-ID: Date: Fri, 14 Sep 2018 13:47:55 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/14/2018 1:05 PM, Kees Cook wrote: > On Fri, Sep 14, 2018 at 8:57 AM, Casey Schaufler wrote: >> On 9/13/2018 5:19 PM, Kees Cook wrote: >>> We already have the minor LSMs that cannot change order. >> Are you saying that we don't have a mechanism to change >> the order, or that they wouldn't work right in a different >> order? Well, there's the capability module that has to be >> first. > I just meant their order is explicit in security.c. > >>> They aren't >>> part of security= parsing either. >> True, but there's no reason now that we couldn't change that. >> Except for capability. Hmm. > Right, we have at least one that MUST be first (and must not be disabled). > >>> Should "blob-sharing" LSMs be like major LSMs or minor LSMs? >> I like the idea of changing the minor modules to do the full >> registration process. That would make them all the same. >> Except for capability. In any case, the "blob-sharing" LSMs >> need to do the full registration process to account for their >> blobs sizes, and that brings the "major" behavior along with it. > I agree. I'm working on some clean-ups that I'll send out soon, though > I'm worried about some of the various boot-time options... Looking forward to seeing them. >>> If someone is booting with "security=selinux,tomoyo" and then SARA >>> lands upstream, does that person have to explicitly add "sara" to >>> their boot args, since they're doing a non-default list of LSMs? >> Yes. security= is explicit. >> >>> (I actually prefer the answer being "yes" here, FWIW, I just want to >>> nail down the expectations.) >> For now let's leave the minor (capability, yama, loadpin) as they are, >> and require all new modules of any flavor to use full registration. > I would even be fine to convert yama and loadpin. That shouldn't be difficult. >> We could consider something like >> >> security=$lsm # Stack with $lsm at priority 2 - Existing behavior >> $lsm.stacked=N # Add $lsm to the stack at priority N. Delete if N == 0 >> >> It's OK to specify "selinux.stacked=2" and "sara.stacked=2". Which gets >> called first is left up to the system to decide. Whatever the behavior is >> gets documented. Capability will always be first and have priority 1. >> It's OK to specify "smack.stacked=1". > I'm less excited about this kind of stacking priority, but, whatever > the case, I think my cleanups may help with whatever we decide. OK >> The default stack is determined by CONFIG_SECURITY_$lsm_STACKED at >> build time. CONFIG_SECURITY_$lsm_STACKED changes from a boolean to >> an integer value to establish the default hook order. >> >> /sys/kernel/security/lsm reports the modules in hook call order. > Didn't I send a patch to new-line terminate this list? I always get > annoyed when I "cat" it. ;) SELinux set the precedence on that one. Not my fault! >> /sys/kernel/security/lsm-stack reports the list with the hook call priority >> >> capability:1,yama:1,selinux:1,sara:5,landlack:17 >> >> If stacking is not configured $lsm.stacked=0 is treated as security=none. >> For other values of N $lsm.stacked=N is treated as security=$lsm. > I feel like "order" is bad enough. Can we avoid adding "priority"? Sorry. I changed terminology (order and priority) halfway through the message. Yes, I like order better. We should stick with that.