mbox series

[v2,for-7.2,0/2] pci *_by_mask() coverity fix

Message ID 20220818135421.2515257-1-peter.maydell@linaro.org (mailing list archive)
Headers show
Series pci *_by_mask() coverity fix | expand

Message

Peter Maydell Aug. 18, 2022, 1:54 p.m. UTC
This patchset fixes a Coverity nit relating to the
pci_set_*_by_mask() helper functions, where we might shift off the
end of a variable if the caller passes in a bogus mask argument.
Patch 2 is the coverity fix (adding an assert() to help Coverity
out a bit and to catch potential future actual bugs). Patch 1
removes the _get_ versions of the functions, because they've been
in the tree for a decade and never had any callers at any point
in those 10 years :-)

This is only de-confusing Coverity, so this is definitely
7.2 material at this point.

All patches already have a reviewed-by tag; only change
v1->v2 is removing a couple of unnecessary mask operations
in patch 2.

thanks
-- PMM

Peter Maydell (2):
  pci: Remove unused pci_get_*_by_mask() functions
  pci: Sanity check mask argument to pci_set_*_by_mask()

 include/hw/pci/pci.h | 48 +++++++++++++++-----------------------------
 1 file changed, 16 insertions(+), 32 deletions(-)

Comments

Peter Maydell Sept. 29, 2022, 4:29 p.m. UTC | #1
Ping! This series has been reviewed.

I can take it via target-arm.next if you'd prefer.

thanks
-- PMM

On Thu, 18 Aug 2022 at 14:54, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> This patchset fixes a Coverity nit relating to the
> pci_set_*_by_mask() helper functions, where we might shift off the
> end of a variable if the caller passes in a bogus mask argument.
> Patch 2 is the coverity fix (adding an assert() to help Coverity
> out a bit and to catch potential future actual bugs). Patch 1
> removes the _get_ versions of the functions, because they've been
> in the tree for a decade and never had any callers at any point
> in those 10 years :-)
>
> This is only de-confusing Coverity, so this is definitely
> 7.2 material at this point.
>
> All patches already have a reviewed-by tag; only change
> v1->v2 is removing a couple of unnecessary mask operations
> in patch 2.
>
> thanks
> -- PMM
>
> Peter Maydell (2):
>   pci: Remove unused pci_get_*_by_mask() functions
>   pci: Sanity check mask argument to pci_set_*_by_mask()
>
>  include/hw/pci/pci.h | 48 +++++++++++++++-----------------------------
>  1 file changed, 16 insertions(+), 32 deletions(-)
Paolo Bonzini Sept. 30, 2022, 1:48 p.m. UTC | #2
On Fri, Sep 30, 2022 at 3:36 PM <no-reply@patchew.org> wrote:
> Ping! This series has been reviewed.
>
> I can take it via target-arm.next if you'd prefer.

Yeah, I would say just take it through your tree.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo
Michael S. Tsirkin Sept. 30, 2022, 3:51 p.m. UTC | #3
Will merge early next week.

On Thu, Sep 29, 2022 at 05:29:58PM +0100, Peter Maydell wrote:
> Ping! This series has been reviewed.
> 
> I can take it via target-arm.next if you'd prefer.
> 
> thanks
> -- PMM
> 
> On Thu, 18 Aug 2022 at 14:54, Peter Maydell <peter.maydell@linaro.org> wrote:
> >
> > This patchset fixes a Coverity nit relating to the
> > pci_set_*_by_mask() helper functions, where we might shift off the
> > end of a variable if the caller passes in a bogus mask argument.
> > Patch 2 is the coverity fix (adding an assert() to help Coverity
> > out a bit and to catch potential future actual bugs). Patch 1
> > removes the _get_ versions of the functions, because they've been
> > in the tree for a decade and never had any callers at any point
> > in those 10 years :-)
> >
> > This is only de-confusing Coverity, so this is definitely
> > 7.2 material at this point.
> >
> > All patches already have a reviewed-by tag; only change
> > v1->v2 is removing a couple of unnecessary mask operations
> > in patch 2.
> >
> > thanks
> > -- PMM
> >
> > Peter Maydell (2):
> >   pci: Remove unused pci_get_*_by_mask() functions
> >   pci: Sanity check mask argument to pci_set_*_by_mask()
> >
> >  include/hw/pci/pci.h | 48 +++++++++++++++-----------------------------
> >  1 file changed, 16 insertions(+), 32 deletions(-)