Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp646057ybk; Wed, 13 May 2020 09:18:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9X5PX+spTUOHBavQw9KD1/z1BH0nzpBhLP4N/Ksljjz0J0/HJArbUkSyX8dtwxidwbSXz X-Received: by 2002:a05:6402:946:: with SMTP id h6mr387064edz.245.1589386709685; Wed, 13 May 2020 09:18:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589386709; cv=none; d=google.com; s=arc-20160816; b=DFVZFWYu4g2scBbp+zMDIIYtYhbHqsUND62fWrPgpbar2et9MeYb3zzbPWz3D7EbgQ 4yH9Me5+J1NxQMYsER3h3iASeQ1Dt6gVE+Ct/RL9/MegmUpryFOWqNLp984C3uqndMRI BraJ3K8bGnAeasExaipgLIDXb9gAeXWQry8A2nj509b0zNJ40qcgZT4mPkYsc74zNHzL xALsIu671+F4EWlmQYcmJW1mQhwLDxV1M8SMY5cRB58d1hLEcSOLMu4bi6l5RXq9XnRp wbZwhZojkH9wxXE5LUr8L1Wf5VfPwzhifj9S6tzkhKEfDmpp13Vkk0G/EDKJNe7Iy74x Cnhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=MR3hivTTbv7WsNknULGT8vpeXwpVVOP1nEJHvXl4q6Q=; b=kE2YqINGp2xcl6JZA4oof8EDMDxj933uqonYgyrqCpzfNFh1uimS5xe0baQGs1rwr1 sIKIPFQW8P5+V5L8eYSuV64uJGlmfGKoXssfDi7vKPYt77vGNhEYjxhger1EwwB6Gygc xkrIP1aNMzvi9zDtpfPu0fMn4VMOCFd0UrsYUca826pUKvA31QcVQ1lcPRbFSugAcChx +WkX8O3qwisXQes0mXUF0y2vLmqIdPFMNrQLkIUt1B0KQOu8ILsvAoHekuiFzQ4Xr02A /BLGcjQAatmRrTPi3jChE5Z/owu9DPYCoLkkqbzRQXlYwW4JjPtq44yvJO4MbC15n2eO UZgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qp11si77080ejb.316.2020.05.13.09.18.05; Wed, 13 May 2020 09:18:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389526AbgEMQQZ (ORCPT + 99 others); Wed, 13 May 2020 12:16:25 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:42344 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730063AbgEMQQZ (ORCPT ); Wed, 13 May 2020 12:16:25 -0400 Received: by mail-pl1-f196.google.com with SMTP id k19so22176pll.9; Wed, 13 May 2020 09:16:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=MR3hivTTbv7WsNknULGT8vpeXwpVVOP1nEJHvXl4q6Q=; b=CGXlki91Z2AbkgMsh7IlOWcTNbnmSz+EJS9v9wrqLzHQJ48nzZ6IMVeeZ30THNgvBo +uyhrOfa4h/rA73eunJA29vtgNtIBqZNAzp1fpIEDnBBWPwHTjhUUosvYpu5JS+ZOBRC AhYk0Y9uOt4qdQoSPMCChWPRKPPKUV0ip3lTEmPSXX8Yo3EQXlB4EsIu14MRTAsYmUuL +ujxDfoP4Y01jEdRwBMpJ9Q9ppkj10i4yywDMbfensA7oJUZ0zGsyQNh1oTy4BFCJBX1 D2sT++pbbU5y65x0r+H5/VfaOC54oK61WsCr+nqnYNPms1vhoYKWkZi11qggGDJuYRNz euDA== X-Gm-Message-State: AGi0PubaRUfos4UQAprK/z+HuztdMu3AjvgJS+JjrLwbVgUnGOWQ//FL RUJpK6OnkpIw9NnazSZR980= X-Received: by 2002:a17:902:ba95:: with SMTP id k21mr24684399pls.160.1589386584264; Wed, 13 May 2020 09:16:24 -0700 (PDT) Received: from 42.do-not-panic.com (42.do-not-panic.com. [157.230.128.187]) by smtp.gmail.com with ESMTPSA id b15sm21492pfd.139.2020.05.13.09.16.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2020 09:16:23 -0700 (PDT) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id 452DA4063E; Wed, 13 May 2020 16:16:22 +0000 (UTC) Date: Wed, 13 May 2020 16:16:22 +0000 From: Luis Chamberlain To: "Eric W. Biederman" , Josh Triplett Cc: viro@zeniv.linux.org.uk, gregkh@linuxfoundation.org, rafael@kernel.org, jeyu@kernel.org, jmorris@namei.org, keescook@chromium.org, paul@paul-moore.com, stephen.smalley.work@gmail.com, eparis@parisplace.org, nayna@linux.ibm.com, zohar@linux.ibm.com, scott.branden@broadcom.com, dan.carpenter@oracle.com, skhan@linuxfoundation.org, geert@linux-m68k.org, tglx@linutronix.de, bauerman@linux.ibm.com, dhowells@redhat.com, linux-integrity@vger.kernel.org, linux-fsdevel@vger.kernel.org, kexec@lists.infradead.org, linux-security-module@vger.kernel.org, selinux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] security: add symbol namespace for reading file data Message-ID: <20200513161622.GS11244@42.do-not-panic.com> References: <20200513152108.25669-1-mcgrof@kernel.org> <20200513152108.25669-3-mcgrof@kernel.org> <87k11fonbk.fsf@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87k11fonbk.fsf@x220.int.ebiederm.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 13, 2020 at 10:40:31AM -0500, Eric W. Biederman wrote: > Luis Chamberlain writes: > > > Certain symbols are not meant to be used by everybody, the security > > helpers for reading files directly is one such case. Use a symbol > > namespace for them. > > > > This will prevent abuse of use of these symbols in places they were > > not inteded to be used, and provides an easy way to audit where these > > types of operations happen as a whole. > > Why not just remove the ability for the firmware loader to be a module? > > Is there some important use case that requires the firmware loader > to be a module? > > We already compile the code in by default. So it is probably just > easier to remove the modular support all together. Which would allow > the export of the security hooks to be removed as well. Yeah, that's a better solution. The only constaint I am aware of is we *cannot* change the name of the module from firmware_class since the old fallback sysfs loader depends on the module name. So, so long as we take care with that on built-in and document this very well, I think we should be good. I checked the commit logs and this was tristate since the code was added upstream, so I cannot see any good reason it was enabled as modular. Speaking with a *backports experience* hat on, we did have a use case to use a module for it in case a new feature was added upstream which was not present on older kernels. However I think that using a separate symbol prefix would help with that. Would any Android stakeholders / small / embedded folks whave any issue with this? Luis