Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp886102ybg; Wed, 10 Jun 2020 16:52:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyx30CmeOAjl6yqHGpbh7clVYY0JA3FleDvWrHor4kl+Vh+ewyIUfWuc16e71E3PSZeJVYy X-Received: by 2002:a50:fb0b:: with SMTP id d11mr4760448edq.118.1591833131949; Wed, 10 Jun 2020 16:52:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591833131; cv=none; d=google.com; s=arc-20160816; b=yrcgH8xcKpkzRckPQtNu4eBh5tPYlTaFwYezecQ5Ia2GCT/egFIOjEPmQCUNZ6d0vF Pp80Y+OLC89Z8W7zNcnMoPBbKQ68Mjq71ZSB050N9MR3ADG0FZcetIqZmsjHbLsBFQ07 iZgnxTuIEpU4V/P1erd2q3RHIqwfMNNjmfdpLJ16vW5ge1cWYtI5u/s7hCT5tBpzmp1H SjNMwRVBU1Ipwy+1Bj+HKkea+PPN0jrGMwoOO44/4ciM9cVviWIPpvVkJ2yHfQLEpP1A MYOdWioD4ZHkoRxqI96TMSgt8w7rZ+pd95HeLoJToQcdbNSV74qeAMSUf+6/tg0G1R0Z pvDQ== 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=HXDVJ01oPr7+DVOG48ZzBnv0DUZ50rfZMiH97fPmSsY=; b=wYoZbkQEmO7O99jFEt1H3SU47dfxuBXoViCR8i0vH7MvSN3j2YofIeLk0E9FDX6R7Y +/8IofrfwZ4D7RedtPIF9xPUfkJPe1zNh9szTNh70lfFGcjMiftytUjuuImpttyFuATy ENxVx7IMcta2rrO0HNuPG8QCxfCnGxZlq22B3V9HZ/1bFkAcsJizBya+w3RnqmjD8BHI AANz6wgNY5zcpzxV2t68+p2LIIV9EN4d0NWoNw/fo9rNqp0AAf5R4y009ACNn6HZlbkb lfa2SpPaDUDKtQXed5pZbkeZcyvEMNgsdgp0h3llxx4/tNtwE/T5zpdyspdklq/AM+Rf OE2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=SPFSCgiL; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw28si638402edb.23.2020.06.10.16.51.48; Wed, 10 Jun 2020 16:52:11 -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=@google.com header.s=20161025 header.b=SPFSCgiL; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726850AbgFJXrT (ORCPT + 99 others); Wed, 10 Jun 2020 19:47:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726109AbgFJXrR (ORCPT ); Wed, 10 Jun 2020 19:47:17 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E42D2C03E96B for ; Wed, 10 Jun 2020 16:47:15 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id w15so2458329lfe.11 for ; Wed, 10 Jun 2020 16:47:15 -0700 (PDT) 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=HXDVJ01oPr7+DVOG48ZzBnv0DUZ50rfZMiH97fPmSsY=; b=SPFSCgiL1AquGxkTFcoWT8rBLkkuxrQI3VD0O4eTSCQPxHTaNuEIjvgc1S/5qAWrWQ HvXYwBFxiSLpvBDxLTDhtnFIoFhaQ9ab1FT8IH9P4C5gQWZQ1mD8xj8grVg61arzhiUH Ayw/ZfLpN3h2bCT287+R1+hQnMN2hKZljE7U7c7ZTW9FK+MD1cCK/R8w+GKXs+dKxCHX n22xK4HTDzFEk5DIRzcOEafYadSjZWt44sB9Wc0GKEtfZ9BURf2Gc0gGKI7QKCkf2sqN ianhbGVgtJ9qzuw7lWIxfK9r5l9+g4bXLBnqacYitBm+ACJQaRcULBtnA9eX2v3M7j2Q 43gA== 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=HXDVJ01oPr7+DVOG48ZzBnv0DUZ50rfZMiH97fPmSsY=; b=SRJkhVPo+m4awvhzuZWtu8KNTTLaSn2RoVfdslsvSUeZmP1pTe6cQqj4Xp3ljsr4id /M2N0v30u+c2F0FAslnNUFavKngAVe6kc12MG/eWNwAmU0xuWwaTULUgbJOwc9R0elRS PC1z3g7+YsN7Plux8eS7iyEJZPWalxsj1wJ+fdhdrra2OuyOYaDU+o3cS6slYrcyUmtR 4aAT0aayZDlMubq/bvLw1YI6Hr55ylT5oy29BXGWOsBzth8ojn5Gi8tIsGWcU/Yt36YE v1fUvXZUGnvF5XixoCihuDdphPbYEeBjo1F07tWT8dr+WoAVL/pAWne8TI8ORKdwjrHP o6zg== X-Gm-Message-State: AOAM533G4FldMuLeyktOaFEpqGyu11hGwKOLr/m0r+AhXdm/HUrx0URY VppI1clsKfQNfEgF94UlvAoffZ1oYUvAxGYlc69CtQ== X-Received: by 2002:ac2:5473:: with SMTP id e19mr2898514lfn.21.1591832833994; Wed, 10 Jun 2020 16:47:13 -0700 (PDT) MIME-Version: 1.0 References: <20200610230119.GA1528268@bjorn-Precision-5520> In-Reply-To: <20200610230119.GA1528268@bjorn-Precision-5520> From: Rajat Jain Date: Wed, 10 Jun 2020 16:46:37 -0700 Message-ID: Subject: Re: [RFC] Restrict the untrusted devices, to bind to only a set of "whitelisted" drivers To: Bjorn Helgaas 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 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 Wed, Jun 10, 2020 at 4:01 PM Bjorn Helgaas wrote: > > 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. Yes, understood, thanks. > > > 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. Understood. Thanks, Rajat