Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 753fbd23 authored by Thomas Gleixner's avatar Thomas Gleixner
Browse files

xen: Validate online cpus in set_affinity



The user space interface does not filter out offline cpus. It merily
verifies that the mask contains at least one online cpu. So the
selector in the irq chip implementation needs to make sure to pick
only an online cpu because otherwise:

     Offline Core 1
     Set affinity to 0xe
     Selector will pick first set bit, i.e. core 1

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Xen <xen-devel@lists.xenproject.org>
Link: http://lkml.kernel.org/r/20140304203100.978031089@linutronix.de


Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 421d1563
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1324,7 +1324,7 @@ static int rebind_irq_to_cpu(unsigned irq, unsigned tcpu)
static int set_affinity_irq(struct irq_data *data, const struct cpumask *dest,
static int set_affinity_irq(struct irq_data *data, const struct cpumask *dest,
			    bool force)
			    bool force)
{
{
	unsigned tcpu = cpumask_first(dest);
	unsigned tcpu = cpumask_first_and(dest, cpu_online_mask);


	return rebind_irq_to_cpu(data->irq, tcpu);
	return rebind_irq_to_cpu(data->irq, tcpu);
}
}