[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH for-6.2 0/4] Zero sockaddr_in when initializing it
|
From: |
Peter Maydell |
|
Subject: |
Re: [PATCH for-6.2 0/4] Zero sockaddr_in when initializing it |
|
Date: |
Thu, 26 Aug 2021 15:34:35 +0100 |
On Fri, 13 Aug 2021 at 16:05, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> The POSIX spec for sockaddr_in says that implementations are allowed
> to have implementation-dependent extensions controlled by extra
> fields in the struct, and that the way to ensure these are not
> accidentally activated is to zero out the whole data structure.
> We have several places in our codebase where we don't zero-init
> sockaddr_in structs and so (at least in theory) might run into this.
> Coverity spotted the ones in the net code (CID 1005338); the
> others in this series I found by looking at all uses of sockaddr_in.
> (The gdbstub patch changes also a sockaddr_un use, for symmetry.)
>
> Thanks to Eric for the analysis of what the spec says and why
> Coverity is correct here.
>
> thanks
> -- PMM
>
> Peter Maydell (4):
> net: Zero sockaddr_in in parse_host_port()
> gdbstub: Zero-initialize sockaddr structs
> tests/qtest/ipmi-bt-test: Zero-initialize sockaddr struct
> tests/tcg/multiarch/linux-test: Zero-initialize sockaddr structs
I'll take this series via target-arm.next unless anybody objects.
thanks
-- PMM
- [PATCH for-6.2 3/4] tests/qtest/ipmi-bt-test: Zero-initialize sockaddr struct, (continued)
- Re: [PATCH for-6.2 0/4] Zero sockaddr_in when initializing it,
Peter Maydell <=