Received: by 2002:ac0:950e:0:0:0:0:0 with SMTP id f14csp222509imc; Fri, 15 Mar 2019 22:40:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0bsgy5OUUa3p+AJ79z0sz4fbn5ZDGtmr6ubPqnjuvg6OTS3fR+7iOL55cX9vfmMiV5uG0 X-Received: by 2002:a17:902:c03:: with SMTP id 3mr1588553pls.186.1552714820233; Fri, 15 Mar 2019 22:40:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552714820; cv=none; d=google.com; s=arc-20160816; b=b/aHfD+0oMZgvCGlfJwbY51pSuVYZbCDDdCm8DpVVUOCeliNZjvdFGYcQHBlV31WnR 6AqA+oZJy9vZMFPHlCEf1JYLh2OcA39e1scDVmXyurpCvbUQrN95aDrCyE9zSignVbCW ySLNH1MJelQxipnpT27fWRpQexDP599YxpAJBMkQSMFBSabpvK6qULFjE1djItCfViAr wXamGTtLxs20ab6JZ9bPI6qqAyAtzDhDXjwRpJIWM4NO7dpwX15vPoMpYk+IlRIGKN8x hRFak/DzGDDzCJkidLt0DFKJM71GDxt/IdYcdhqZqErveoyuv5YJV6r7W+1lx6rkYktJ U9iw== 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=McsnC6Ux6dcTlqrKjEcs95o7BHlPx6WeydGAsg43iK0=; b=ghYxk0JPdJ2rw09xzSgOOiRntAnFGJEvTAN9faWFD3G/MWylVMmFZMwBS5YKkzzpMr yAFUnYCoFrKh9kI3Zg38zPI5iQRQ/XcBbSsbOJOb1I3a1/ATLR6bmwKipNAZTAmQyrs3 zjfNGbkOYotgMScLAfLlr/ST7+6UqHT4kNFlvtoWuNGQ+djphKey/qOoE/5WGojY2iZq HN8V3gNh40lhYnXsI+KG3vmxsz5io63YvcWKeDYpXV1DIajaTM9fNFUtEgnXU4uW4kr5 Znu638MIINF7mdmtAulnqSryZli2dy+AD585wqK/Cm4WZdBmFG5LyR8IOKWNI6ZdXED8 vUlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Av4y7/zt"; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q11si3521070pgh.548.2019.03.15.22.39.53; Fri, 15 Mar 2019 22:40:20 -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=@chromium.org header.s=google header.b="Av4y7/zt"; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726084AbfCPFin (ORCPT + 99 others); Sat, 16 Mar 2019 01:38:43 -0400 Received: from mail-vs1-f65.google.com ([209.85.217.65]:42787 "EHLO mail-vs1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725879AbfCPFin (ORCPT ); Sat, 16 Mar 2019 01:38:43 -0400 Received: by mail-vs1-f65.google.com with SMTP id c189so6628924vsd.9 for ; Fri, 15 Mar 2019 22:38:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=McsnC6Ux6dcTlqrKjEcs95o7BHlPx6WeydGAsg43iK0=; b=Av4y7/zt4pg+TILmbNyFU5Jw2Y/UzjdGpPmtSugNeBxkjMs5KvqNxvno1loQCn7vcj zbZDzFBnoikRas6yMukwRngSrElNq3QbZh2UtlE+2lTLreo6eG1uUaa/nrJtUX7Zvc84 ig4h1sg0ZQh4fWYXpP2A2i+gTyJgOKFoS71HU= 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=McsnC6Ux6dcTlqrKjEcs95o7BHlPx6WeydGAsg43iK0=; b=M+Xyx6GlY8ud3dymJXnUivVL7jq1ha7Gx3Osdq5FsIVAzyVLmcl8fGvbLXQ3ItGYOw xj/NsdZyKsqTXzxtpR3tOtLBlFmNTKw86ThBxyMROfBxwJj59t48E7nt+UFJbUDOrQ0K bxxjmD/4OfxTcNipFb69XnCF6NP1WaG4JLeCh0XaNmwVBBNQJhp1cM9hAi/TwWDp2asw UVPA+LBz2ovPbiLbfpxp3b6zn+0dKx4aPOCwhFkZsZcAhBnogsTIZjPxQKEGEm8338KP Bl+n3R6luu8g68VbfKPUK7fk/KoGSt15qIwBRF6GheJjWTxXqvag8vwwvl2SD+uPJ7R/ cEiQ== X-Gm-Message-State: APjAAAVJv0njSiuC29V3mqum8oZPFCnj3Kpbos05aGX0ylPVNfpv/x1N DCmtzP4Fx5OSBU4bzrnsGbGRseOSxAs= X-Received: by 2002:a67:8c82:: with SMTP id o124mr3853545vsd.204.1552714721459; Fri, 15 Mar 2019 22:38:41 -0700 (PDT) Received: from mail-ua1-f50.google.com (mail-ua1-f50.google.com. [209.85.222.50]) by smtp.gmail.com with ESMTPSA id z9sm1186456vkd.22.2019.03.15.22.38.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Mar 2019 22:38:40 -0700 (PDT) Received: by mail-ua1-f50.google.com with SMTP id x1so3812166uaj.4 for ; Fri, 15 Mar 2019 22:38:40 -0700 (PDT) X-Received: by 2002:ab0:768b:: with SMTP id v11mr1584271uaq.64.1552714719686; Fri, 15 Mar 2019 22:38:39 -0700 (PDT) MIME-Version: 1.0 References: <20190315110555.0807d015@cakuba.netronome.com> <20190315120105.5541ad46@cakuba.netronome.com> <20190315165440.53b9db3c@cakuba.netronome.com> In-Reply-To: From: Kees Cook Date: Fri, 15 Mar 2019 22:38:28 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: mount.nfs: Protocol error after upgrade to linux/master To: Jakub Kicinski , linux-security-module Cc: Trond Myklebust , "open list:NFS, SUNRPC, AND..." , Anna Schumaker , LKML 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, Mar 15, 2019 at 10:24 PM Kees Cook wrote: > > On Fri, Mar 15, 2019 at 4:54 PM Jakub Kicinski > wrote: > > > > On Fri, 15 Mar 2019 12:01:05 -0700, Jakub Kicinski wrote: > > > On Fri, 15 Mar 2019 11:05:55 -0700, Jakub Kicinski wrote: > > > > Hi, > > > > > > > > I just upgraded from: > > > > > > > > commit a3b1933d34d5bb26d7503752e3528315a9e28339 (net) > > > > Merge: c6873d18cb4a 24319258660a > > > > Author: David S. Miller > > > > Date: Mon Mar 11 16:22:49 2019 -0700 > > > > > > > > to > > > > > > > > commit 3b319ee220a8795406852a897299dbdfc1b09911 > > > > Merge: 9352ca585b2a b6e88119f1ed > > > > Author: Linus Torvalds > > > > Date: Thu Mar 14 10:48:14 2019 -0700 > > > > > > > > and I'm seeing: > > > > > > > > # mount /home/ > > > > mount.nfs: Protocol error > > > > > > > > No errors in dmesg, please let me know if it's a known problem or what > > > > other info could be of use. > > > > > > Hm.. I tried to bisect but reverting to that commit doesn't help. > > > > > > Looks like the server responds with: > > > > > > ICMP parameter problem - octet 22, length 80 > > > > > > pointing at some IP options (type 134)... > > > > Okay, figured it out, it's the commit 13e735c0e953 ("LSM: Introduce > > CONFIG_LSM") and all the related changes in security/ > > > > I did olddefconfig and it changed my security module from apparmor to > > smack silently. smack must be slapping those IP options on by default. > > > > Pretty awful user experience, and a non-zero chance that users who > > upgrade their kernels will miss this and end up with the wrong security > > module... > > I wonder if we can add some kind of logic to Kconfig to retain the old > CONFIG_DEFAULT_SECURITY and include it as the first legacy-major LSM > listed in CONFIG_LSM? > > Like, but the old selector back in, but mark is as "soon to be > entirely replaced with CONFIG_LSM" and then make CONFIG_LSM's default > be "yama,loadpin,safesetid,integrity,$(CONFIG_DEFAULT_SECURITY),selinux,smack,tomoyo,apparmor" > ? Duplicates are ignored... This would initialize a default order from the earlier Kconfig items: diff --git a/security/Kconfig b/security/Kconfig index 1d6463fb1450..e3813b5c6824 100644 --- a/security/Kconfig +++ b/security/Kconfig @@ -239,8 +239,40 @@ source "security/safesetid/Kconfig" source "security/integrity/Kconfig" +choice + prompt "First legacy-major LSM to be initialized" + default DEFAULT_SECURITY_SELINUX if SECURITY_SELINUX + default DEFAULT_SECURITY_SMACK if SECURITY_SMACK + default DEFAULT_SECURITY_TOMOYO if SECURITY_TOMOYO + default DEFAULT_SECURITY_APPARMOR if SECURITY_APPARMOR + default DEFAULT_SECURITY_DAC + + help + Select the legacy-major security module that will be initialize + first. Overridden by non-default CONFIG_LSM. + + config DEFAULT_SECURITY_SELINUX + bool "SELinux" if SECURITY_SELINUX=y + + config DEFAULT_SECURITY_SMACK + bool "Simplified Mandatory Access Control" if SECURITY_SMACK=y + + config DEFAULT_SECURITY_TOMOYO + bool "TOMOYO" if SECURITY_TOMOYO=y + + config DEFAULT_SECURITY_APPARMOR + bool "AppArmor" if SECURITY_APPARMOR=y + + config DEFAULT_SECURITY_DAC + bool "Unix Discretionary Access Controls" + +endchoice + config LSM string "Ordered list of enabled LSMs" + default "yama,loadpin,safesetid,integrity,smack,selinux,tomoyo,apparmor" if DEFAULT_SECURITY_SMACK + default "yama,loadpin,safesetid,integrity,tomoyo,selinux,smack,apparmor" if DEFAULT_SECURITY_TOMOYO + default "yama,loadpin,safesetid,integrity,apparmor,selinux,smack,tomoyo" if DEFAULT_SECURITY_APPARMOR default "yama,loadpin,safesetid,integrity,selinux,smack,tomoyo,apparmor" help A comma-separated list of LSMs, in initialization order. (I don't see a way to include an earlier config string in a new default.) Thoughts? -- Kees Cook