mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris Wright <chris@wirex.com>
To: Greg KH <greg@kroah.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC] PCI device list locking
Date: Tue, 17 Jun 2003 15:13:35 -0700	[thread overview]
Message-ID: <20030617151335.A17117@figure1.int.wirex.com> (raw)
In-Reply-To: <20030617212628.GA12723@kroah.com>; from greg@kroah.com on Tue, Jun 17, 2003 at 02:26:28PM -0700

* Greg KH (greg@kroah.com) wrote:
> 
> Comments?  Places I missed protecting?

Is it safe to ignore pcibios_init?  This happens after smp_init, but are
could there be multiple events (that would effect pcibios_sort)?

> --- a/drivers/pci/proc.c	Tue Jun 17 12:47:27 2003
> +++ b/drivers/pci/proc.c	Tue Jun 17 12:47:27 2003
> @@ -12,6 +12,7 @@
>  #include <linux/proc_fs.h>
>  #include <linux/seq_file.h>
>  #include <linux/smp_lock.h>
> +#include "pci.h"
>  
>  #include <asm/uaccess.h>
>  #include <asm/byteorder.h>
> @@ -311,20 +312,32 @@
>  	struct list_head *p = &pci_devices;
>  	loff_t n = *pos;
>  
> -	/* XXX: surely we need some locking for traversing the list? */
> +	spin_lock(&pci_bus_lock);

should you just grab this lock here (pci_seq_start), and release in
pci_seq_stop, holding for duration of ->seq_start() ->seq_next()
->seq_stop().  IOW, what happens when you grab list element in
->seq_start(), it's removed from list, you reference a bogus ->next
pointer in ->seq_next()?

thanks,
-chris
-- 
Linux Security Modules     http://lsm.immunix.org     http://lsm.bkbits.net

  reply	other threads:[~2003-06-17 22:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-17 21:26 Greg KH
2003-06-17 22:13 ` Chris Wright [this message]
2003-06-17 22:23   ` Greg KH
2003-06-17 22:51 ` Andrew Morton

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=20030617151335.A17117@figure1.int.wirex.com \
    --to=chris@wirex.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.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®