mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris Wright <chrisw@sous-sol.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Dave Airlie <airlied@gmail.com>,
	Dave Young <hidave.darkstar@gmail.com>,
	linux-kernel@vger.kernel.org, David Airlie <airlied@linux.ie>,
	dri-devel@lists.freedesktop.org,
	Chris Wright <chrisw@sous-sol.org>,
	James Morris <jmorris@namei.org>
Subject: Re: Regression - Xorg start failed
Date: Sun, 13 Feb 2011 16:35:31 -0800	[thread overview]
Message-ID: <20110214003531.GH9869@sequoia.sous-sol.org> (raw)
In-Reply-To: <AANLkTimxCMgdfht7rrg8QiCppb=D7fvR92eeiewdqCpH@mail.gmail.com>

* Linus Torvalds (torvalds@linux-foundation.org) wrote:
> On Sat, Feb 12, 2011 at 11:53 PM, Dave Airlie <airlied@gmail.com> wrote:
> > Probably should revert first, then work out what is crapping out libpciaccess.
> 
> Yeah, I'll revert. The patch is one of those "obviously a good idea,
> but in practice it's not something we can change now".

Turns out I'm just a bona fide idiot.

I was not testing the right kernel _and_ didn't get the logic right.

sorry for the screw up,
-chris
---

Subject: [PATCH] pci: use security_capable correctly during config space read

Commit 47970b1 ("pci: use security_capable() when checking capablities
during config space read") is just plain broken.  The normal capable()
interface returns true on success, but the LSM interface returns 0 on
success.

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---

I've tested this quickly (lspci behaviour is as expected).

diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index f7771f3..ea25e5b 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -369,7 +369,7 @@ pci_read_config(struct file *filp, struct kobject *kobj,
 	u8 *data = (u8*) buf;
 
 	/* Several chips lock up trying to read undefined config space */
-	if (security_capable(filp->f_cred, CAP_SYS_ADMIN)) {
+	if (security_capable(filp->f_cred, CAP_SYS_ADMIN) == 0) {
 		size = dev->cfg_size;
 	} else if (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) {
 		size = 128;



  reply	other threads:[~2011-02-14  0:35 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-13  6:22 Dave Young
2011-02-13  7:53 ` Dave Airlie
2011-02-13 15:50   ` Linus Torvalds
2011-02-14  0:35     ` Chris Wright [this message]
2011-02-14  1:04       ` James Morris
2011-02-15  1:21         ` [PATCH v3] pci: use security_capable() when checking capablities during config space read Chris Wright
2011-02-15  9:39           ` James Morris
2011-02-16  6:24           ` Alex Riesen
2011-02-14  5:38       ` Regression - Xorg start failed Dave Young
2011-02-14 16:56         ` Chris Wright
2011-02-13 23:31   ` Chris Wright
2011-02-13 23:34     ` Dave Airlie
2011-02-13 23:35       ` Chris Wright
2011-02-13  8:15 ` Alex Riesen
2011-02-13 20:26 Sedat Dilek
2011-02-14 16:01 Sedat Dilek
2011-02-14 16:20 ` Chris Wright
2011-02-14 16:35   ` Sedat Dilek
2011-02-14 16:57     ` Chris Wright

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110214003531.GH9869@sequoia.sous-sol.org \
    --to=chrisw@sous-sol.org \
    --cc=airlied@gmail.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hidave.darkstar@gmail.com \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®