Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp148993ybe; Thu, 5 Sep 2019 19:20:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqwF0n63XgjyLZvGiN2aSsUTR1HGc0yPthckLn7v+WebxtwrLJd7BcffhKMXrDZ3bjpkB3Rm X-Received: by 2002:a17:90a:bf0a:: with SMTP id c10mr7257077pjs.78.1567736427180; Thu, 05 Sep 2019 19:20:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567736427; cv=none; d=google.com; s=arc-20160816; b=z5V8MiTyX6L0P2x+IsDuIl9fw/mEIs3tM8abKBLZCoNMDYaI1efsBh6VC/DAGx/rLO O9zwuC9qTpl13Lg7aDP4N4jZIQ8FP8XmMYlIylGCcu+RqB7SK1MqQClWVYQz06883KC5 B+0a0qVeHzzj2RcKbdRmkd5wbYEt92lGQDH+CVEzIcxYQIuNA0XiSch2MR2LM2oag9PS wJDyX6Ah+hde1qhUu3qKsn4MZKpCQl8pUIbz0DwRQ+/XI7X/wxBKs+uhF1kgyvWRJkmZ DGjeVyW6JgZCQRsCzysLE3fs8zVXUC6u2ovFA2KspZayb2u2OW6BC8vveNVh7SE0RAJy Dcng== 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:dkim-signature; bh=xn/wrzgZSZkLsOJSfeo9lwPo1on70x1JYvrNiue6jv4=; b=PJDBhKVxSJF1BmorVMItJ4W7zy8pgLxkRSn2LV+cu2zLM11RlUblZEmYfsnf/p34EV pCr2Wu2pL+vvjJ5UXL4s5aSnfNJcTIUgzQi4y2HF1vysanAbmWsdZtMdWtG+2jTLK+et +dBusWLL5tm6AVh8toUzYjPpnDN1QrTRRYrVJqaydcrWz2NNDfbI4A7TxoqAJXqjmS7s iFl8KBZ23bGrjp7slM8GH5OH0AkCatac8hCvTY+tDI6tMLMrb8y1plZlCl74+Xeg/r/r ejsezRl31WCrV1KhjulhyvQyXRpBpJsbk7GcUk829Xb/xlGAMOMY7EOC0UHk0hEf4zsA WPgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Py/zzvOg"; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c130si4324395pfc.103.2019.09.05.19.20.11; Thu, 05 Sep 2019 19:20:27 -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=@kernel.org header.s=default header.b="Py/zzvOg"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403901AbfIES3l (ORCPT + 99 others); Thu, 5 Sep 2019 14:29:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:38982 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728590AbfIES3l (ORCPT ); Thu, 5 Sep 2019 14:29:41 -0400 Received: from localhost (unknown [69.71.4.100]) (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 2F0A920825; Thu, 5 Sep 2019 18:29:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567708181; bh=T0ll8J6r0R1Visw0vbgL4AIx3iScvCP1sF/nv3g3ZCs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Py/zzvOgfmDbynLZ9gYju9DVSSesq1A4AfxzrmxTBSYpwD+XvDSPH9gJhaRfIYfXU UrboWcXDkqHBYkltpkcFFLa179lH9nqe1bqg/0mdC4M3iryPuJfXAuwo4MSLbRRMDe qM5Qap7bztJQ6dCTRpIm2xOA6LL4rZSVUr4kNH2Q= Date: Thu, 5 Sep 2019 13:29:38 -0500 From: Bjorn Helgaas To: Kelsey Skunberg Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, sathyanarayanan.kuppuswamy@linux.intel.com, berrange@redhat.com, ddutile@redhat.com, bodong@mellanox.com, linux-kernel-mentees@lists.linuxfoundation.org, Eli Cohen Subject: Re: [Linux-kernel-mentees] [PATCH] PCI/IOV: Make SR-IOV attributes with mode 0664 use 0644 Message-ID: <20190905182938.GD103977@google.com> References: <20190905063226.43269-1-skunberg.kelsey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190905063226.43269-1-skunberg.kelsey@gmail.com> 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 [+cc Bodong, Eli: just FYI since this affects sriov_drivers_autoprobe, which you added with 0e7df22401a3] On Thu, Sep 05, 2019 at 12:32:26AM -0600, Kelsey Skunberg wrote: > sriov_numvfs and sriov_drivers_autoprobe have "unusual" permissions (0664) > with no reported or found reason for allowing group write permissions. > libvirt runs as root when dealing with PCI, and chowns files for qemu > needs. There is not a need for the "0664" permissions. > > sriov_numvfs was introduced in: > commit 1789382a72a5 ("PCI: SRIOV control and status via sysfs") > > sriov_drivers_autoprobe was introduced in: > commit 0e7df22401a3 ("PCI: Add sysfs sriov_drivers_autoprobe to > control VF driver binding") > > Change sriov_numvfs and sriov_drivers_autoprobe from "0664" permissions to > "0644" permissions. > > Exchange DEVICE_ATTR() with DEVICE_ATTR_RW() which sets the mode to "0644". > DEVICE_ATTR() should only be used for "unusual" permissions. > > Signed-off-by: Kelsey Skunberg Applied with Greg's Reviewed-by and Don's Acked-by to pci/misc for v5.4, thanks! > --- > drivers/pci/iov.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c > index b335db21c85e..b3f972e8cfed 100644 > --- a/drivers/pci/iov.c > +++ b/drivers/pci/iov.c > @@ -375,12 +375,11 @@ static ssize_t sriov_drivers_autoprobe_store(struct device *dev, > } > > static DEVICE_ATTR_RO(sriov_totalvfs); > -static DEVICE_ATTR(sriov_numvfs, 0664, sriov_numvfs_show, sriov_numvfs_store); > +static DEVICE_ATTR_RW(sriov_numvfs); > static DEVICE_ATTR_RO(sriov_offset); > static DEVICE_ATTR_RO(sriov_stride); > static DEVICE_ATTR_RO(sriov_vf_device); > -static DEVICE_ATTR(sriov_drivers_autoprobe, 0664, sriov_drivers_autoprobe_show, > - sriov_drivers_autoprobe_store); > +static DEVICE_ATTR_RW(sriov_drivers_autoprobe); > > static struct attribute *sriov_dev_attrs[] = { > &dev_attr_sriov_totalvfs.attr, > -- > 2.20.1 > > _______________________________________________ > Linux-kernel-mentees mailing list > Linux-kernel-mentees@lists.linuxfoundation.org > https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees