[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 2/2] xen/pt: Avoid NULL dereference in hvm_pirq_eoi()



On Tue, Jun 27, 2017 at 06:47:53PM +0100, Andrew Cooper wrote:
> Coverity warns that pirq_dpci unconditionally dereferences a NULL pointer.
> This warning appears to be triggered by pirq_dpci() which is a hidden ternary
> expression.  In reality, it appears that both callers pass a non-NULL pirq
> parameter, so the code is ok in practice.
> 
> Rearange the logic to fail-safe, which should quiesce Coverity.
> 
> Clean up bool_t => bool and trailing whitespace for hvm_domain_use_pirq()
> while auditing this area.
> 
> No (intended) functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

hvm_gsi_eoi obviously passes a non-NULL pirq (there's a check just
before calling hvm_pirq_eoi.

The same applies to __hvm_dpci_eoi, which is also only called from
hvm_dpci_eoi (although there's no explicit check anywhere in that
case) that iterates over the list of pirqs bound to specific guest
GSI, and having a NULL there would cause havoc.

Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.