Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp226185ima; Fri, 1 Feb 2019 02:19:42 -0800 (PST) X-Google-Smtp-Source: ALg8bN7NUgWkr9AjuuBuaKATTMfEc+oX3TwNaZOkF4pasVbOPKOTX2fAC7kGZ56ANwZCCLWJzPzF X-Received: by 2002:a17:902:7c85:: with SMTP id y5mr38568159pll.63.1549016382595; Fri, 01 Feb 2019 02:19:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549016382; cv=none; d=google.com; s=arc-20160816; b=HWwM21qwSVowXaP/5YDNPQMa/rZ2K0jXNf7dy3eashIfE5gnnf9kTBYoTUSX67wcMb gAXVn4+/9h/zaKuDI0CfTf9GGs1hPQg4hVRqVBQsu+f1XKQkUL2XFS0gRc8CiRleFYqk gx1v+tW85mw5mnSc36CThMVZZO/Q8sX0gTh1+AgUvUJPTyi7wUtNazhb6r+P65iZwpPH sPqhZL+GwiXSRuqMIFpttA2Vhhzp7shW1LjkcKknhpm/1U6/5i3pHVS7OWiuRB6Hfe9h RNBUpz+2cYtqSa3uJrgjp10i2wV5feGyx5Ts1JUPr17woqbX5dMBZOHhju0oxxG1UKK7 FlVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=u5GIOTFH3O7dm7lapBp6BIvom8Tyb2HtT0nB8ve19eU=; b=S0d14ZDYLJ/UCo4cHbFUGMH65b860QGUdt3euQaTlP+xBT0VbuvQCsOrkitzYd56FK a5stkyXfgxZINMXHoOqqR8wfPEZr4t48sTxKQkqSibEA/5AOy+hxgzDNmy7mJCz3fbup YAdQ6Ns0l5aYf3brizCcyR+CCaAfabkpwGqcK0MNeyTf8E+YmBHdbUjv6NFH2Xab018S ZgO7T5I+YDUrQmu75YFTdnvSTm46mfrv2d1/jFjN1Yqa+WZBevd3Wuu5mGI5+Qm40C+b 3taQQ4JXL9RWXZtT6vZpmKC8ykVw6EqX+msAo752tOHC+31MjwWMeukOuNGQMmXJ5fkM kJhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CEuO1+hA; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s80si1546297pgs.165.2019.02.01.02.19.27; Fri, 01 Feb 2019 02:19:42 -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=@google.com header.s=20161025 header.b=CEuO1+hA; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729377AbfBAKLk (ORCPT + 99 others); Fri, 1 Feb 2019 05:11:40 -0500 Received: from mail-io1-f65.google.com ([209.85.166.65]:33483 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729351AbfBAKLj (ORCPT ); Fri, 1 Feb 2019 05:11:39 -0500 Received: by mail-io1-f65.google.com with SMTP id t24so5263389ioi.0 for ; Fri, 01 Feb 2019 02:11:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=u5GIOTFH3O7dm7lapBp6BIvom8Tyb2HtT0nB8ve19eU=; b=CEuO1+hA67Buh+wOoCv7i8B7SwfkAPO7roL5YPJKir8kiIpn8DPt+N09BqUAoQFHLV aVPABpC0zKzA9EGBnUy1AmwGJZDHEkv4hipGyJKcxVL/Ac0AvoHIn/luZmGWiytJCcKj yo2W5PcEzsFbsFxI0grwIKtgfHgy6VKeAIhVtda3Cp7K85682q+2eb6uAaZB8hWY2RuG IS3EE2naqqrOgp0NNE/Mhpz0llNTHtdKYQB4y91OZ0HCKLascwqn9HBbFTJEmf8gK7++ lgsCgvs39uRILZLDWpsw/3OJ+SDlkcbm2EVfqTlTpQWy2cFmn1yGYAx0Hyq1/5mXBIS4 ViEg== 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=u5GIOTFH3O7dm7lapBp6BIvom8Tyb2HtT0nB8ve19eU=; b=NSHWiTGAG61RF9FSSNc9kRGeCPB0UuY3jyVMS+cPsQsOMhGznA1/EZyuC1QaUHEyEQ 4L1gcsQo0r+BsmPKv61yGhg2/4MaqH29D0QGT+KM15b2FoWWTUicF3yqU+Z23zEka2T9 12Wd8yaJsRXMwk6goIVjZHl9aQn8ZbtlztRWbw54lFfcHoKu3/Ms5tngXNv+1OrK0jli ke+chwGUe24piQv3+/AHCClC/uuZLziRh2z3Eebf56OzcKIuuPB0DirdlDOUwKL6mWy/ NyrNHxgTkpWHzpoYAjQJ8QOe0G0MV1G6QUiVSxyIkWF9CmZLKz1bbiP8EzMAfx6qa1Lh rvLQ== X-Gm-Message-State: AJcUukfEBawgdL/Ep6R7m1S82GNgje2eJ2I9k34kKxC+tMan9HJZm/pn qrsO3o8AweaI0zak9TBwcxzgvtTARFpS5NNzEZZdMw== X-Received: by 2002:a6b:fa01:: with SMTP id p1mr21006184ioh.271.1549015898268; Fri, 01 Feb 2019 02:11:38 -0800 (PST) MIME-Version: 1.0 References: <000000000000c178e305749daba4@google.com> <9537a6ff-daf4-d572-bf93-68230909b68e@tycho.nsa.gov> <4b37e892-4d79-aefb-92ab-7753b89b8963@tycho.nsa.gov> <1ea19628-3bbe-2073-d623-824337c15ed6@tycho.nsa.gov> <6c9112a2-33f3-0c29-c944-1d129a0026e7@tycho.nsa.gov> <05340d28-36c2-267e-d54e-416fddfba211@i-love.sakura.ne.jp> In-Reply-To: From: Dmitry Vyukov Date: Fri, 1 Feb 2019 11:11:26 +0100 Message-ID: Subject: Re: WARNING in apparmor_secid_to_secctx To: Tetsuo Handa Cc: Casey Schaufler , 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 1, 2019 at 11:09 AM Dmitry Vyukov wrote: > > On Thu, Jan 31, 2019 at 1:23 AM Tetsuo Handa > wrote: > > > > On 2019/01/30 23:45, Dmitry Vyukov wrote: > > >> Dmitry, is it possible to update configs for linux-next.git , for > > >> we want to test a big change in LSM which will go to Linux 5.1 ? > > >> > > >> TOMOYO security module (CONFIG_SECURITY_TOMOYO=y) can now coexist with > > >> SELinux/Smack/AppArmor security modules, and SafeSetID security module > > >> (CONFIG_SECURITY_SAFESETID=y) was added. Testing with these modules also > > >> enabled might find something... > > > > > > Hi, > > > > > > syzbot configs/cmdline args are stored here: > > > https://github.com/google/syzkaller/tree/master/dashboard/config > > > > > > I've tried to update to the latest kernel, the diff is below. > > > Few questions: > > > 1. How are modules enabled now? > > > We pass security=selinux of security=smack on command line. What do we > > > need to pass now to enable several modules at the same time? > > > > Removing security= parameter from kernel boot command line will do it. > > > > security/apparmor/lsm.c: .flags = LSM_FLAG_LEGACY_MAJOR | LSM_FLAG_EXCLUSIVE, > > security/selinux/hooks.c: .flags = LSM_FLAG_LEGACY_MAJOR | LSM_FLAG_EXCLUSIVE, > > security/smack/smack_lsm.c: .flags = LSM_FLAG_LEGACY_MAJOR | LSM_FLAG_EXCLUSIVE, > > security/tomoyo/tomoyo.c: .flags = LSM_FLAG_LEGACY_MAJOR, > > security/security.c: if ((major->flags & LSM_FLAG_LEGACY_MAJOR) && > > > > But this means that, if same kernel config/cmdline are used between > > linux-next.git and linux.git (etc.), syzbot will need to choose from > > > > (a) stop sharing kernel cmdline between linux-next.git and linux.git (etc.) > > > > or > > > > (b) stop sharing kernel config between SELinux, Smack and AppArmor > > > > or > > > > (c) start testing after the LSM changes went to linux.git as Linux 5.1-rc1 > > > > . Is (a) or (b) possible? If this is a too much change, (c) will be OK. > > > Thanks for the explanations. > > Here is the change that I've come up with: > https://github.com/google/syzkaller/commit/aa53be276dc84aa8b3825b3416542447ff82b41a > > I've disabled CONFIG_SECURITY_TOMOYO_OMIT_USERSPACE_LOADER (it > actually looked like omitting a user-space loader that I don't have is > the right thing to do, but okay, it indeed does not with =y). > > For now I just enabled TOMOYO and SAFESETID. > I see the problem with making both linux-next and upstream work. If we > use a single config and lsm= cmdline argument, then on upstream all > kernels will use the same module (they won't understand lsm=). But if > we add security= then it will take precedence over lsm= on linux-next, > so we won't get stacked modules. > > Let's go with (c) because I don't want an additional long-term maintenance cost. > If I understand it correctly later we will need to replace: > security=selinux > security=smack > security=apparmor > > with: > lsm=yama,safesetid,integrity,selinux,tomoyo > lsm=yama,safesetid,integrity,smack,tomoyo > lsm=yama,safesetid,integrity,tomoyo,apparmor Filed https://github.com/google/syzkaller/issues/973 to not forget about it.