linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC] kvm: vgic: are these warnings wrong?
@ 2017-11-14  6:47 AKASHI Takahiro
  2017-11-14  9:07 ` Marc Zyngier
  2017-11-14 13:38 ` Marc Zyngier
  0 siblings, 2 replies; 4+ messages in thread
From: AKASHI Takahiro @ 2017-11-14  6:47 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Marc,

I've just run a static analyzer to v4.14.
While most of warnings/errors are false-positive, as you can easily imagine,
there are something dubious. Can you please check ones below?

virt/kvm/arm/vgic/vgic-v3.c:352 vgic_v3_save_pending_tables() error: uninitialized symbol 'val'.
virt/kvm/arm/vgic/vgic-its.c:424 its_sync_lpi_pending_table() error: uninitialized symbol 'pendmask'.
virt/kvm/arm/vgic/vgic-its.c:779 vgic_its_alloc_collection() error: potential null dereference 'collection'.  (kzalloc returns null)
virt/kvm/arm/vgic/vgic-irqfd.c:115 kvm_vgic_setup_default_irq_routing() warn: double check that we're allocating correct size: 48 vs 64

# I believe that the messages here are self-describing.

Thanks,
-Takahiro AKASHI

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [RFC] kvm: vgic: are these warnings wrong?
  2017-11-14  6:47 [RFC] kvm: vgic: are these warnings wrong? AKASHI Takahiro
@ 2017-11-14  9:07 ` Marc Zyngier
  2017-11-15  0:34   ` AKASHI Takahiro
  2017-11-14 13:38 ` Marc Zyngier
  1 sibling, 1 reply; 4+ messages in thread
From: Marc Zyngier @ 2017-11-14  9:07 UTC (permalink / raw)
  To: linux-arm-kernel

On 14/11/17 06:47, AKASHI Takahiro wrote:
> Hi Marc,
> 
> I've just run a static analyzer to v4.14.
> While most of warnings/errors are false-positive, as you can easily imagine,
> there are something dubious. Can you please check ones below?
> 
> virt/kvm/arm/vgic/vgic-v3.c:352 vgic_v3_save_pending_tables() error: uninitialized symbol 'val'.
> virt/kvm/arm/vgic/vgic-its.c:424 its_sync_lpi_pending_table() error: uninitialized symbol 'pendmask'.
> virt/kvm/arm/vgic/vgic-its.c:779 vgic_its_alloc_collection() error: potential null dereference 'collection'.  (kzalloc returns null)
> virt/kvm/arm/vgic/vgic-irqfd.c:115 kvm_vgic_setup_default_irq_routing() warn: double check that we're allocating correct size: 48 vs 64
> 
> # I believe that the messages here are self-describing.

Hi Takahiro,

All of these are pretty good findings... Out of curiosity, what is the
tool you've been using?

Many thanks for reporting these bugs.

	M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [RFC] kvm: vgic: are these warnings wrong?
  2017-11-14  6:47 [RFC] kvm: vgic: are these warnings wrong? AKASHI Takahiro
  2017-11-14  9:07 ` Marc Zyngier
@ 2017-11-14 13:38 ` Marc Zyngier
  1 sibling, 0 replies; 4+ messages in thread
From: Marc Zyngier @ 2017-11-14 13:38 UTC (permalink / raw)
  To: linux-arm-kernel

On 14/11/17 06:47, AKASHI Takahiro wrote:
> Hi Marc,
> 
> I've just run a static analyzer to v4.14.
> While most of warnings/errors are false-positive, as you can easily imagine,
> there are something dubious. Can you please check ones below?
> 
> virt/kvm/arm/vgic/vgic-v3.c:352 vgic_v3_save_pending_tables() error: uninitialized symbol 'val'.
> virt/kvm/arm/vgic/vgic-its.c:424 its_sync_lpi_pending_table() error: uninitialized symbol 'pendmask'.
> virt/kvm/arm/vgic/vgic-its.c:779 vgic_its_alloc_collection() error: potential null dereference 'collection'.  (kzalloc returns null)
> virt/kvm/arm/vgic/vgic-irqfd.c:115 kvm_vgic_setup_default_irq_routing() warn: double check that we're allocating correct size: 48 vs 64
> 
> # I believe that the messages here are self-describing.
For the record, I've stashed fixes for these here[1], based on kvmarm/next.

Thanks,

	M.

[1]:
https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/log/?h=kvm-arm64/fixes-4.15
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [RFC] kvm: vgic: are these warnings wrong?
  2017-11-14  9:07 ` Marc Zyngier
@ 2017-11-15  0:34   ` AKASHI Takahiro
  0 siblings, 0 replies; 4+ messages in thread
From: AKASHI Takahiro @ 2017-11-15  0:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 14, 2017 at 09:07:46AM +0000, Marc Zyngier wrote:
> On 14/11/17 06:47, AKASHI Takahiro wrote:
> > Hi Marc,
> > 
> > I've just run a static analyzer to v4.14.
> > While most of warnings/errors are false-positive, as you can easily imagine,
> > there are something dubious. Can you please check ones below?
> > 
> > virt/kvm/arm/vgic/vgic-v3.c:352 vgic_v3_save_pending_tables() error: uninitialized symbol 'val'.
> > virt/kvm/arm/vgic/vgic-its.c:424 its_sync_lpi_pending_table() error: uninitialized symbol 'pendmask'.
> > virt/kvm/arm/vgic/vgic-its.c:779 vgic_its_alloc_collection() error: potential null dereference 'collection'.  (kzalloc returns null)
> > virt/kvm/arm/vgic/vgic-irqfd.c:115 kvm_vgic_setup_default_irq_routing() warn: double check that we're allocating correct size: 48 vs 64
> > 
> > # I believe that the messages here are self-describing.
> 
> Hi Takahiro,
> 
> All of these are pretty good findings... Out of curiosity, what is the
> tool you've been using?

smatch!
https://blogs.oracle.com/linuxkernel/smatch-static-analysis-tool-overview,-by-dan-carpenter

> Many thanks for reporting these bugs.

I want to find more bugs with such tools :) Just kidding.

-Takahiro AKASHI

> 	M.
> -- 
> Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-15  0:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-14  6:47 [RFC] kvm: vgic: are these warnings wrong? AKASHI Takahiro
2017-11-14  9:07 ` Marc Zyngier
2017-11-15  0:34   ` AKASHI Takahiro
2017-11-14 13:38 ` Marc Zyngier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).