Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3187123pxu; Mon, 19 Oct 2020 06:18:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmMDoX8ZUOJcZSNI70nN0wGHpU2j2GH7r8ItkYj9CtR+6LOgtGvkGDtNldhpUsggp2Mg6r X-Received: by 2002:aa7:d64e:: with SMTP id v14mr18780112edr.66.1603113520393; Mon, 19 Oct 2020 06:18:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603113520; cv=none; d=google.com; s=arc-20160816; b=T9VC70hPfKQh68HLJWd2I4XCIOq2AFfLc0hQzE7dDnpZn5bZk8apPCLA/hDudzuwkv k4wNUsE7egBF5KjPBs0p2HtazizCi9N5ascNTSixb2AjivOasDV7x0f2wl4I1/K+S51Q trncLNSmsaEcWWjWeE/LMiGipc2oCaNqxjtVAfMYbP7EObaqsvsLq1YcoW79/36TMFEx NKzBaeVe9uZjB8qXBD4Yqsbu7oUDGMJxA66PLPapFxV1/ebGQI/xOB5mt8UvgudelV1J 97b583zu3s4xm/63j936agQOytYD3BLHH/a9Nq3rnZl39mOGg4T2UOSdgQ1yulJUiC/M Vb/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=jP4rm9Xb26XasQO8gLkBcuMqJafwp/pvcQADDWiDWfU=; b=W8VSo44JcOPyAiedkYeby7EB83jCe+bpS7SS/RFRF4D8gSknvHcPs7K72c4m/TrZL4 maz7hpAjBqT8yf1IJO5w+nRN79QYvgZCf2H3gbq9V7RW+NPa3sK3lYy5O8Ck93HqzS5X sf0WX0iXm9cIkr1C2sbKVa3GIM9frE7Zz4n5EMjAveSrU6Jdz9DceSLOw8AoP2NZnGaB s6sL+oTp+015eqd/JHI4HnAYlj3mpehM1fWLRDbC+EfoQ/bM+b31x4FU6TMQLLJ6E9Jr tdwm/w+oQLj8/5o1kT8NkNnJt9p0b4W6uYlwfaVsBTQ596EN59+TVuwzAzDLXnG54cHz YnMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wXKW4mQM; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r26si8195910edt.63.2020.10.19.06.18.17; Mon, 19 Oct 2020 06:18:40 -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=wXKW4mQM; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728058AbgJSNPa (ORCPT + 99 others); Mon, 19 Oct 2020 09:15:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:46160 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727860AbgJSNPa (ORCPT ); Mon, 19 Oct 2020 09:15:30 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 6D64922203; Mon, 19 Oct 2020 13:15:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603113328; bh=27msb1S4BcbbJu49vog+yRYGPSReChpwq3Hep2AcYw8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=wXKW4mQMNTJ0xMUuPDRSkJqUEfbMVPTN0bVyIy0I7XYSPzvbXOjE8/BOtM+FHI2y1 yg2+OmJVV05QxMfL6O4i11oqNmGXTYWhPK65NgVUgX8E8FBQ/lVvGHM4Cm8sCztOA1 Fzc+jLOBUFLIvzzoAEjKgNxlA56UH33jYCy9KLN4= Date: Mon, 19 Oct 2020 15:16:13 +0200 From: Greg KH To: Allen Cc: linux-pci@vger.kernel.org, bhelgaas@google.com, ast@kernel.org, Linux Kernel Mailing List , Allen Pais , Allen Pais Subject: Re: [RFC] PCI: allow sysfs file owner to read the config space with CAP_SYS_RAWIO Message-ID: <20201019131613.GA3254417@kroah.com> References: <20201016055235.440159-1-allen.lkml@gmail.com> <20201016062027.GB569795@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 19, 2020 at 06:30:16PM +0530, Allen wrote: > > > > > > Access to pci config space is explictly checked with CAP_SYS_ADMIN > > > in order to read configuration space past the frist 64B. > > > > > > Since the path is only for reading, could we use CAP_SYS_RAWIO? > > > > Why? What needs this reduced capability? > > Thanks for the review. > > We need read access to /sys/bus/pci/devices/, We need write access to config, > remove, rescan & enable files under the device directory for each PCIe > functions & the downstream PCIe port. > > We need r/w access to sysfs to unbind and rebind the root complex. That didn't answer my question at all. Why can't you have the process that wants to do all of the above, have admin rights as well? Doing all of that is _very_ low-level and can cause all sorts of horrible things to happen to your machine, and is not really "raw io" in the traditional sense at all, right? greg k-h