提交 c3b3f16d 编写于 作者: D Daniel De Graaf 提交者: Konrad Rzeszutek Wilk

xen/events: prevent calling evtchn_get on invalid channels

The event channel number provided to evtchn_get can be provided by
userspace, so needs to be checked against the maximum number of event
channels prior to using it to index into evtchn_to_irq.
Signed-off-by: NDaniel De Graaf <dgdegra@tycho.nsa.gov>
Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
上级 9438ce9d
......@@ -1104,6 +1104,9 @@ int evtchn_get(unsigned int evtchn)
struct irq_info *info;
int err = -ENOENT;
if (evtchn >= NR_EVENT_CHANNELS)
return -EINVAL;
mutex_lock(&irq_mapping_update_lock);
irq = evtchn_to_irq[evtchn];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册