Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp224907ima; Fri, 1 Feb 2019 02:18:23 -0800 (PST) X-Google-Smtp-Source: ALg8bN6Y9aSEuseCxsYaIu6SaShKgetHrFjqfNr+sab0dQeEoykyrmWJVea4zc+DPEdHCmR83czD X-Received: by 2002:a62:9fcf:: with SMTP id v76mr38228466pfk.144.1549016303860; Fri, 01 Feb 2019 02:18:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549016303; cv=none; d=google.com; s=arc-20160816; b=0vikORoI7DL+lHkVkDskjyAbj5OpzxSjkn0VzP1p4SBXNnmeaGfsMbjySZIbmojsky /7uapFV/2cOyqBKKagqEUeEQrnolCsl8JISlzCFj2WUhC7M7gq8F9N+Q+T+Mj+rBvo4h q6KMBSfZFml8Gw/6/cJV97v17Z3p5gdRdph1E7dF3FqLjD5aibWJ8HBLu09pp+dfe1lO rLe3FolRE6BqKL0YoHNwbt0idpySnSPCpbbcOvjzgPTc4EnT8/8KKDa432qo+jegaEmm ahkf5Vvf9RKeNxLYWIu2Ksf9lnKFPJ/1vcgZXFnCT4mN2EdvI4mkUMYC+k75T+7+Mc28 FBuA== 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=ZJGU6V0Qpvv03UVFSHLRsVJebkWB5dQmQ6QU9nLThiA=; b=kbjilUbPEWqhilbkADUv5AythwjQa3JMIXMzBT4yfuMRUJijVsdnT4nkMnMo/bywDB /XXc6KqdnfOwtViq43Hd7Q8O1z/RHXkP6p19GW5xFXu5SVGd2waWAu3LP3D/EcfQUVmK wCfKw37kUZztMn28QYxxWWA/A8ePwTkZDJbn9ngSPB44u74ukqaO4WNU53NhSQBTIO// zyvxuks1b1wRh9W9fPmrn69zjmkfRs225l8R7wgV2r1/zo/ocxxPl+YrlkyI41RIn73e JX4jWf9B7DwS5AaQZXXYDtcWzmZaNw9Gprsy8SSE99JGtjkNuz+KRAWYHnvqnw7ZRiIc mWNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Lqe+JqFv; 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 s2si2411748pgj.60.2019.02.01.02.18.08; Fri, 01 Feb 2019 02:18:23 -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=Lqe+JqFv; 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 S1729232AbfBAKJ5 (ORCPT + 99 others); Fri, 1 Feb 2019 05:09:57 -0500 Received: from mail-it1-f193.google.com ([209.85.166.193]:55261 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726761AbfBAKJ4 (ORCPT ); Fri, 1 Feb 2019 05:09:56 -0500 Received: by mail-it1-f193.google.com with SMTP id i145so8308854ita.4 for ; Fri, 01 Feb 2019 02:09:55 -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=ZJGU6V0Qpvv03UVFSHLRsVJebkWB5dQmQ6QU9nLThiA=; b=Lqe+JqFvQaMlkAbWLM69XZaGSWD9E/2GEfDn0m+WPVGATOFTTJTR1Fm22+Fm2ynlfO 033BBD4y98Z1ldvo023zNiuEP0khx+E9HA8Zvx8JI44sTa2ECt5Iir0m+oL1iXG7alPs uy0q4OTR+JK6c9tXBdRsGFnUVjou+kRQ04FFnz9hhQu/gz1PRTesKd4tb/lb7EBNymrR MOp29ulgvhx0xK5HtlljsdnxsQ7ZbrMzwgq8yS+yDmAe5VtyHZcHJsNA83qKsJdF8r5r EmwYVqpIgVTqiXpwt9VfEEdaHwHqxPCNXtX5eONx/2D+Ti7sNIzv0FAvdoUKyo5hyjXZ XJfg== 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=ZJGU6V0Qpvv03UVFSHLRsVJebkWB5dQmQ6QU9nLThiA=; b=P7z4zAfBvVhgz/QyFqSEoJvCX7LQLZ7bivoLayEQx6vCyh9mU2cPpy6nxHhRc8wdkY CjkwAbkqmPiPa2qQ9KNqdXV4bnzgE/Yi+MPZNDKWf0FV0iFmygfnf6GiKaRBq024RmRs j9JVOhlxiYeqewI895tMIZicBS9oQv5yqTyhI2xs5SWt9yMBMk819CI8GFSu/98mVU+o 4B0IfZ+2csbH7ksVTckS5RIEexS6YL1VwkWEenKWShXqlBZrCSTiFUxRoXu6SXlF/sHB M/J++5KeV7NxJFGBMufqQylyCHnpjR+ze9fPozOjTI8pPWgGJN9ot6DuUEifz8+jqmlm So9w== X-Gm-Message-State: AHQUAuYAcdvWPGRZhnpQ24kHLO6HnYAyGEvHml2ErsA8/fgkDJnj8N/0 B/4TztepAZTqZyOzQMV2Ylm8gOHfpfWmmKVOdWJ24w== X-Received: by 2002:a24:6511:: with SMTP id u17mr1023990itb.12.1549015795099; Fri, 01 Feb 2019 02:09:55 -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: <05340d28-36c2-267e-d54e-416fddfba211@i-love.sakura.ne.jp> From: Dmitry Vyukov Date: Fri, 1 Feb 2019 11:09:42 +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 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