mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Joerg Roedel <jroedel@suse.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Prarit Bhargava <prarit@redhat.com>,
	Yinghai Lu <yinghai@kernel.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org, alnovak@suse.com
Subject: Re: [PATCH] x86: irq: Check for valid irq descriptor in check_irq_vectors_for_cpu_disable
Date: Fri, 6 Feb 2015 13:28:02 +0100	[thread overview]
Message-ID: <20150206122802.GT3702@8bytes.org> (raw)
In-Reply-To: <54D304DE.90506@linux.intel.com>

Hi Jiang,

On Thu, Feb 05, 2015 at 01:51:26PM +0800, Jiang Liu wrote:
> Reviewed-by: Jiang Liu <jiang.liu@linux.intel.com>

Thanks for your review.

> Actually there's another racing pattern.
> for (irq = 0; irq < nr_irqs; irq++) {
> 	desc = irq_to_desc(irq);
> 	access desc->xxx
> }
> 
> When sparsing IRQ is enabled, there's no mechanism to protect
> desc returned by irq_to_desc(). Once I have considered a brute
> solution of disabling freeing of irq_desc:(

Hmm, how about wrapping the places that use irq_desc in rcu_read_lock()
and do a synchronize_rcu() before we free it (at least in the SPARSE_IRQ
case)? It wouldn't be a real RCU data structure, but we make at least
sure that we don't free an irq_desc thats in use.


	Joerg


  reply	other threads:[~2015-02-06 12:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-04 13:27 Joerg Roedel
2015-02-05  5:51 ` Jiang Liu
2015-02-06 12:28   ` Joerg Roedel [this message]
2015-02-18 17:08 ` [tip:irq/urgent] x86/irq: Check for valid irq descriptor in check_irq_vectors_for_cpu_disable() tip-bot for Joerg Roedel

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=20150206122802.GT3702@8bytes.org \
    --to=joro@8bytes.org \
    --cc=alnovak@suse.com \
    --cc=hpa@zytor.com \
    --cc=jiang.liu@linux.intel.com \
    --cc=jroedel@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=prarit@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=yinghai@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

Powered by JetHome