Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp561789imj; Thu, 7 Feb 2019 08:26:03 -0800 (PST) X-Google-Smtp-Source: AHgI3IYP+sA6kAIPiQhs+yU5Hi6laHIqW5u9jLKLl+0SzoGdkpZorPa2jx5mwX1KMPR2FBwg0D0P X-Received: by 2002:a63:555b:: with SMTP id f27mr798990pgm.313.1549556763114; Thu, 07 Feb 2019 08:26:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549556763; cv=none; d=google.com; s=arc-20160816; b=rwU5RXo5owRFi8c/buwLUG1KoutCI/7srfgX0DZ1yHqsuSdj0eKkagbG2FZaG6n1f8 owSQRucAJKS27KXT2cdGXNmEBdu3Cw4wUTtiGKJucqhZ5QEgLX8GLj1Nv2vFQMu55NbW HGSM5g1NkXiedJ4JYloQl4ftlAZB3MZ7IMS2tWeGGlqSUpX39ZYV46JSZuf1RDwTq8Zm ZRMLBpIzGb2o/ygMS0qsHS4Ms/A/bv/E0FVkzK9KCRHi7aEj4Ih2NvqcjYiFVrvjUyDs iL8LdZQXM/aBqmIe1+HK8rwgyEGaOTFNzF59ZbFlis4ZfT+e3+uD8pQF1+hH0SoXMmOl FWcw== 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=HbuGRpu6I7YIxZ4SNLsPqCYI80Aa+PLh8ijdAqJqYkI=; b=zUZf6L499zy6rMoDf6dQej29ftVEV/HuMAeLTXXJxv+IF7b/ItlNmwhcGU5GM/ABRL YUidwR1xudnI1lw8pie0kOrPk72tsw0BOJCROALOPURD8KF7lUo8H9ErNkUQQWFIwgSO tPDbOQBdiWI/vho9g/noz1Frv4hGkuXyJGSOFx0fp6Cc0gqw+DLjmWJ6YaA5IneUX20I afdmmxsNvzExVZ/HuYwIhJm0DpYjdhPYrZMX9dZgrQPHa1e2OAG9f6SX9AIk8dDvq7XR 2UpmU4mjRvgTEWU9WF1UzZfaxI1GoAJW/zu/xbOc0UqYdVxnJLos/eQUulnaN/vOfZGw 5rfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b="Bx/IIEUm"; 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 h6si8809926pgc.589.2019.02.07.08.25.46; Thu, 07 Feb 2019 08:26:03 -0800 (PST) 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="Bx/IIEUm"; 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 S1726791AbfBGQYe (ORCPT + 99 others); Thu, 7 Feb 2019 11:24:34 -0500 Received: from sonic302-27.consmr.mail.gq1.yahoo.com ([98.137.68.153]:35155 "EHLO sonic302-27.consmr.mail.gq1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726734AbfBGQYe (ORCPT ); Thu, 7 Feb 2019 11:24:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1549556673; bh=HbuGRpu6I7YIxZ4SNLsPqCYI80Aa+PLh8ijdAqJqYkI=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=Bx/IIEUmq4Kjd+ahXb4HSW26GP5xt4g5oZO6o8z18ZYM7E9e30otly9LRgnIentv51/mCn58vBTNxzx/KFzg2CM/Z6X0NPd/hfIUM8rk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ArEUWJSCbdJYp__NIszOUhbmkbh_hPN25sSlCwu8Pwpf1adWE23QEBXT08q cx8eXiR7crQ1F07WBqEbC4L503yetlC2dBMK6aA2vDNIKTsl0ToHfuQenBLt9hT4sfRtB9Vhysma 4E7GysdhExnND8ahJVaxHDn5ol1.22q9SuTPch8gHHXV2I.wFvURi0q5o1gz8A5aBthbe_gGqzHY 4anFjhZyAKItLKZpJSuExDCLwwKzxDQwLPfnMYSzyDi1rm64psBWeazHFqrH__lm9_bmKgLhKtpR Q4FdXNSuX54_3EeajgYWr8H_h8_9mp0XavdgHveLhXJe_9XGoOw-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.gq1.yahoo.com with HTTP; Thu, 7 Feb 2019 16:24:33 +0000 Received: from c-67-169-65-224.hsd1.ca.comcast.net (EHLO [192.168.0.100]) ([67.169.65.224]) by smtp422.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 44df19590cf964fcb3866ff781d6ea2e; Thu, 07 Feb 2019 16:24:28 +0000 (UTC) Subject: Re: [PATCH] LSM: Allow syzbot to ignore security= parameter. To: Tetsuo Handa Cc: Dmitry Vyukov , Paul Moore , Stephen Smalley , syzbot , tyhicks@canonical.com, John Johansen , James Morris , LKML , linux-security-module@vger.kernel.org, Serge Hallyn , syzkaller-bugs , Jeffrey Vander Stoep , SELinux , Russell Coker , Laurent Bigonville , syzkaller , Andrew Morton , Kees Cook References: <8f48e1d0-c109-f8a9-ea94-9659b16cae49@i-love.sakura.ne.jp> <0d23d1a5-d4af-debf-6b5f-aaaf698daaa8@schaufler-ca.com> <201902070230.x172UUG6002087@www262.sakura.ne.jp> From: Casey Schaufler Message-ID: <6def6199-0235-7c37-974c-baf731725606@schaufler-ca.com> Date: Thu, 7 Feb 2019 08:24:26 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <201902070230.x172UUG6002087@www262.sakura.ne.jp> Content-Type: text/plain; charset=iso-2022-jp 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 2/6/2019 6:30 PM, Tetsuo Handa wrote: > Casey Schaufler wrote: >> On 2/6/2019 2:23 AM, Tetsuo Handa wrote: >>> But as I update the documentation ( https://tomoyo.osdn.jp/2.6/chapter-3.html.en#3.6 ), >>> I came to think that we should ignore security= parameter when lsm= parameter is specified. >>> >>> Currently, it is possible to enable TOMOYO and only one of SELinux/Smack/AppArmor. Therefore, >>> it is possible to disable only TOMOYO by specifying security=selinux when we want to enable >>> only SELinux, by specifying security=smack when we want to enable only Smack, by specifying >>> security=apparmor when we want to enable only AppArmor. That is, we can use security= parameter >>> in order to specify the other LSM module which should not be disabled. >>> >>> But when it becomes possible to enable TOMOYO and more than one of SELinux/Smack/AppArmor, >>> we will no longer be able to selectively disable one LSM module using security= parameter, for >>> security= parameter is intended for specifying only one LSM module which should be enabled. >>> That is, we will need to use lsm= parameter in order to selectively disable LSM modules. >> Yes. That is correct. The existing behavior of security= is maintained. > But the existing behavior of CONFIG_DEFAULT_SECURITY is not maintained. That's a developer interface, not a user interface. I realize that may be splitting hairs, but it had to change. > This might cause a problem like > > commit e5a3b95f581da62e2054ef79d3be2d383e9ed664 > Author: Tetsuo Handa > Date: Sat Feb 14 11:46:56 2009 +0900 > > TOMOYO: Don't create securityfs entries unless registered. > > TOMOYO should not create /sys/kernel/security/tomoyo/ interface unless > TOMOYO is registered. > > for Ubuntu users because Ubuntu kernels are built with > > CONFIG_SECURITY_SELINUX=y > CONFIG_SECURITY_SMACK=y > CONFIG_SECURITY_TOMOYO=y > CONFIG_SECURITY_APPARMOR=y > CONFIG_SECURITY_YAMA=y > CONFIG_DEFAULT_SECURITY="apparmor" > > . Due to CONFIG_DEFAULT_SECURITY="apparmor", majority of Ubuntu users are enabling > only AppArmor without explicitly specifying "security=apparmor". > > Currently default CONFIG_LSM setting is > > "yama,loadpin,safesetid,integrity,selinux,smack,tomoyo,apparmor" > > but Ubuntu kernels would have to be built with non-default CONFIG_LSM setting like > > "yama,loadpin,safesetid,integrity,apparmor,selinux,smack,tomoyo" > > in order to make sure that AppArmor is by default chosen for the LSM_FLAG_EXCLUSIVE module. Yes, and Yocto Project is likely to want Smack specified first. > Now that TOMOYO becomes a !LSM_FLAG_EXCLUSIVE module, not specifying "security=apparmor" will > automatically enable TOMOYO. And majority of Ubuntu users will unexpectedly encounter TOMOYO > messages. But removing "tomoyo" from CONFIG_LSM setting in order to save majority of Ubuntu > users from unexpectedly encountering TOMOYO messages also has a problem; Ubuntu users who want > to enable only TOMOYO from LSM_FLAG_LEGACY_MAJOR modules can specify "security=tomoyo", but > Ubuntu users who want to enable TOMOYO and one of SELinux,Smack,AppArmor (including syzbot) > will have to explicitly specify "lsm=" because "security=" can't allow enabling multiple > LSM_FLAG_LEGACY_MAJOR modules. I believe we got general buy in from Ubuntu, and I understand that the LSM list is awkward, but I don't see a rational alternate. I know that I played with a half dozen, and nothing was closer to maintaining the status quo. >> The new behavior of lsm= is provided to allow general handling of a list >> of security modules. It uses the same form of data as CONFIG_LSM. >> >>> Then, I think that it is straightforward (and easier to manage) to ignore security= parameter >>> when lsm= parameter is specified. >> That reduces flexibility somewhat. If I am debugging security modules >> I may want to use lsm= to specify the order while using security= to >> identify a specific exclusive module. I could do that using lsm= by >> itself, but habits die hard. > "lsm=" can be used for identifying a specific exclusive module, and Ubuntu kernels would > have to use CONFIG_LSM (or "lsm=") for identifying the default exclusive module (in order > to allow enabling both TOMOYO and one of SELinux,Smack,AppArmor at the same time). > > Since "security=" can't be used for selectively enable/disable more than one of > SELinux,Smack,TOMOYO,AppArmor, I think that recommending users to migrate to "lsm=" is the > better direction. And ignoring "security=" when "lsm=" is specified is easier to understand. I added Kees to the CC list. Kees, what to you think about ignoring security= if lsm= is specified? I'm ambivalent.