Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp864351ybg; Wed, 10 Jun 2020 16:10:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLlB0k+kYf/5AlnEFxvHIuQofZo5KGEI00EaUwqcJz2KMJrFDZOn2EQXv/CadKCCnC4wK8 X-Received: by 2002:a17:906:940d:: with SMTP id q13mr5667020ejx.534.1591830605666; Wed, 10 Jun 2020 16:10:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591830605; cv=none; d=google.com; s=arc-20160816; b=fu4X7uCVvRaijmNuJyA/XcPCrIf9zFK7X/viJ5IbZIG2tvZLLO0H7SpvVPuSLB8n/8 SyyY8jhXB/riN70uNdRCWttgfVRMIkQ/9b+OVTxC81WAgGdiPoAPk3hvrV3RbdfVbuQe xfMJqTKFUy2wP50DkkxG8lJtPLI9so7KbCbPf/ZbF7L9jwKjxZrPkBKFB4nWr+uDCtnc kbbg1S57xCZ6n7zrkiaUMg6YDshCO/9vcPS2pY6nJtK3B/ZnXflC/CL7NlIurwPRkZtI Xh34FyAVWghc5eQDP5ldzZo2J96HL2hSWdXRV86sweUYRJhZdkHTLOviFdRhKVB10GjC ksCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=lfKder9LaLNPLsvf+h3ucZR+botdmwfLHIjK45w/xq8=; b=0U9Ip7KdeiSBH9div4YieMAcqqeBelaPKiTRg8rT2tO5cZ7KT1umO0Q92ddgNcDCGB ExBTi2U7iVcIaOD3CxWjJUoXnTg/vLN52pObHppdkGZqV/eEP58KAzwOcYTleCFn8nNL VWLx3T+KOU5LH/Uy/7YVBy4rJzV0yyIHqpJnz5YpewI3ANYlt1jeE4nBArJHc1/kHcV0 tmeMvP9Wb7DY4ebNEC0uoDHAbWUWaD6KmYywrtRe0uSfujt+v/TMr/BY/rJ30WgTeYPK epfUHGMwZlKEBFBRzkJKkJBFUsCChEvpnoFRZy8K4dqJ21EIF8Ai6+fA9eqNrN+p1Bs+ kx3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eD8hg6rA; 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 30si652495edr.262.2020.06.10.16.09.26; Wed, 10 Jun 2020 16:10:05 -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; dkim=pass header.i=@kernel.org header.s=default header.b=eD8hg6rA; 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 S1726680AbgFJXBW (ORCPT + 99 others); Wed, 10 Jun 2020 19:01:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:55508 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726374AbgFJXBV (ORCPT ); Wed, 10 Jun 2020 19:01:21 -0400 Received: from localhost (mobile-166-170-222-206.mycingular.net [166.170.222.206]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DE7E82074B; Wed, 10 Jun 2020 23:01:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591830081; bh=D6s2GjxcLUfPry0JlH9bwLCBmcFmi7TaRMRAmNZMKz0=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=eD8hg6rA+0GGExqkSFbfQnw5Nu7bAzc41KPvENK6rPukKhTFj+EQdWP+WY+etQu2q 3YXFK5bZY5hVo2CEfTuafjisnTtBUISrPdGe10+lF8h12NeGMuUXgOi/O+nL59wFGl yLFfqyk6gkYVwsNbtKJUwwqlbUa9Ix32T7eEKSC4= Date: Wed, 10 Jun 2020 18:01:19 -0500 From: Bjorn Helgaas To: Rajat Jain Cc: Greg Kroah-Hartman , Rajat Jain , "Raj, Ashok" , "Krishnakumar, Lalithambika" , Bjorn Helgaas , linux-pci , Mika Westerberg , Jean-Philippe Brucker , Prashant Malani , Benson Leung , Todd Broch , Alex Levin , Mattias Nissler , Zubin Mithra , Bernie Keany , Aaron Durbin , Diego Rivas , Duncan Laurie , Furquan Shaikh , Jesse Barnes , Christian Kellner , Alex Williamson , Joerg Roedel , Linux Kernel Mailing List Subject: Re: [RFC] Restrict the untrusted devices, to bind to only a set of "whitelisted" drivers Message-ID: <20200610230119.GA1528268@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 09, 2020 at 05:30:13PM -0700, Rajat Jain wrote: > On Tue, Jun 9, 2020 at 5:04 PM Bjorn Helgaas wrote: > > On Tue, Jun 09, 2020 at 04:23:54PM -0700, Rajat Jain wrote: > > > Thanks for sending out the summary, I was about to send it out but got lazy. > > > ... > > > The one thing that still needs more thought is how about the > > > "pcieport" driver that enumerates the PCI bridges. I'm unsure if it > > > needs to be whitelisted for further enumeration downstream. What do > > > you think? > > > > The pcieport driver is required for AER, PCIe native hotplug, PME, > > etc., and it cannot be a module, so the whitelist wouldn't apply to > > it. > > Not that I see the need, but slight clarification needed just to make > sure I understand it clearly: > > Since pcieport driver is statically compiled in, AER, pciehp, PME, DPC > etc will always be enabled for devices plugged in during boot. But I > can still choose to choose to allow or deny for devices added *after > boot* using the whitelist, right? Yes, I think so. However, if pcieport doesn't claim hot-added devices like a dock, I don't think hotplug of PCI things downstream from the dock will work, e.g., if there are Thunderbolt switches in a monitor or something. > Also, denying pcieport driver for hot-added PCIe bridges only disables > these pcieport services on those bridges, but device enumeration > further downstream those bridges is not an issue? Right. Devices without pcieport would not be able to report hotplug events, so we wouldn't notice hot-adds or -removes involving those devices.