提交 28c93bc1 编写于 作者: W Wei Li 提交者: Xie XiuQi

genirq:fix concurrency issue in NMI counter

hulk inclusion
category: bugfix
bugzilla: 9298
CVE: NA

-------------------------------------------------

Incrementing the percpu kstat.irqs_sum is not safe in an NMI context as
we could have interrupted and interrupt trying to increment that same
counter.
Signed-off-by: NWei Li <liwei391@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 4452cb82
...@@ -748,7 +748,7 @@ void handle_fasteoi_nmi(struct irq_desc *desc) ...@@ -748,7 +748,7 @@ void handle_fasteoi_nmi(struct irq_desc *desc)
unsigned int irq = irq_desc_get_irq(desc); unsigned int irq = irq_desc_get_irq(desc);
irqreturn_t res; irqreturn_t res;
kstat_incr_irqs_this_cpu(desc); this_cpu_inc(*desc->kstat_irqs);
trace_irq_handler_entry(irq, action); trace_irq_handler_entry(irq, action);
/* /*
* NMIs cannot be shared, there is only one action. * NMIs cannot be shared, there is only one action.
...@@ -955,7 +955,7 @@ void handle_percpu_devid_fasteoi_nmi(struct irq_desc *desc) ...@@ -955,7 +955,7 @@ void handle_percpu_devid_fasteoi_nmi(struct irq_desc *desc)
unsigned int irq = irq_desc_get_irq(desc); unsigned int irq = irq_desc_get_irq(desc);
irqreturn_t res; irqreturn_t res;
kstat_incr_irqs_this_cpu(desc); this_cpu_inc(*desc->kstat_irqs);
trace_irq_handler_entry(irq, action); trace_irq_handler_entry(irq, action);
res = action->handler(irq, raw_cpu_ptr(action->percpu_dev_id)); res = action->handler(irq, raw_cpu_ptr(action->percpu_dev_id));
trace_irq_handler_exit(irq, action, res); trace_irq_handler_exit(irq, action, res);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册