[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACT4Y+YGbwOPYE=Uf0PAUEWbfs+19EurKs+12AspNOAKjhCdiA@mail.gmail.com>
Date: Fri, 1 Feb 2019 11:11:26 +0100
From: Dmitry Vyukov <dvyukov@...gle.com>
To: Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>
Cc: Casey Schaufler <casey@...aufler-ca.com>,
Paul Moore <paul@...l-moore.com>,
Stephen Smalley <sds@...ho.nsa.gov>,
syzbot <syzbot+21016130b0580a9de3b5@...kaller.appspotmail.com>,
tyhicks@...onical.com, John Johansen <john.johansen@...onical.com>,
James Morris <jmorris@...ei.org>,
LKML <linux-kernel@...r.kernel.org>,
linux-security-module@...r.kernel.org,
Serge Hallyn <serge@...lyn.com>,
syzkaller-bugs <syzkaller-bugs@...glegroups.com>,
Jeffrey Vander Stoep <jeffv@...gle.com>,
SELinux <selinux@...ho.nsa.gov>,
Russell Coker <russell@...er.com.au>,
Laurent Bigonville <bigon@...ian.org>,
syzkaller <syzkaller@...glegroups.com>
Subject: Re: WARNING in apparmor_secid_to_secctx
On Fri, Feb 1, 2019 at 11:09 AM Dmitry Vyukov <dvyukov@...gle.com> wrote:
>
> On Thu, Jan 31, 2019 at 1:23 AM Tetsuo Handa
> <penguin-kernel@...ove.sakura.ne.jp> 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.
Powered by blists - more mailing lists