[PATCH v2 00/10] Coverity fixes for vchan-socket-proxy

Jason Andryuk posted 10 patches 3 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/xen tags/patchew/20200611032936.350657-1-jandryuk@gmail.com
Maintainers: Ian Jackson <ian.jackson@eu.citrix.com>, Wei Liu <wl@xen.org>
tools/libvchan/vchan-socket-proxy.c | 183 ++++++++++++++++++----------
1 file changed, 119 insertions(+), 64 deletions(-)
[PATCH v2 00/10] Coverity fixes for vchan-socket-proxy
Posted by Jason Andryuk 3 years, 10 months ago
This series addresses some Coverity reports.  To handle closing FDs, a
state struct is introduced to track FDs closed in both main() and
data_loop().

v2 changes "Ensure UNIX path NUL terminated" to avoid a warning with
gcc-10.  Also, "Move perror() into listen_socket" and "Move perror()
into connect_socket" are new.

Jason Andryuk (10):
  vchan-socket-proxy: Ensure UNIX path NUL terminated
  vchan-socket-proxy: Move perror() into listen_socket
  vchan-socket-proxy: Move perror() into connect_socket
  vchan-socket-proxy: Check xs_watch return value
  vchan-socket-proxy: Unify main return value
  vchan-socket-proxy: Use a struct to store state
  vchan-socket-proxy: Switch data_loop() to take state
  vchan-socket-proxy: Set closed FDs to -1
  vchan-socket-proxy: Cleanup resources on exit
  vchan-socket-proxy: Handle closing shared input/output_fd

 tools/libvchan/vchan-socket-proxy.c | 183 ++++++++++++++++++----------
 1 file changed, 119 insertions(+), 64 deletions(-)

-- 
2.25.1


Re: [PATCH v2 00/10] Coverity fixes for vchan-socket-proxy
Posted by Wei Liu 3 years, 10 months ago
On Wed, Jun 10, 2020 at 11:29:26PM -0400, Jason Andryuk wrote:
> This series addresses some Coverity reports.  To handle closing FDs, a
> state struct is introduced to track FDs closed in both main() and
> data_loop().
> 
> v2 changes "Ensure UNIX path NUL terminated" to avoid a warning with
> gcc-10.  Also, "Move perror() into listen_socket" and "Move perror()
> into connect_socket" are new.
> 
> Jason Andryuk (10):
>   vchan-socket-proxy: Ensure UNIX path NUL terminated
>   vchan-socket-proxy: Move perror() into listen_socket
>   vchan-socket-proxy: Move perror() into connect_socket
>   vchan-socket-proxy: Check xs_watch return value
>   vchan-socket-proxy: Unify main return value
>   vchan-socket-proxy: Use a struct to store state
>   vchan-socket-proxy: Switch data_loop() to take state
>   vchan-socket-proxy: Set closed FDs to -1
>   vchan-socket-proxy: Cleanup resources on exit
>   vchan-socket-proxy: Handle closing shared input/output_fd

Acked-by: Wei Liu <wl@xen.org>

Cc Paul. V1 of this series was posted back in May. I consider this
series bug fixes, so they should be applied for 4.14. The risk is low
because vchan-socket-proxy is a small utility used by a small number of
users.

Marek, you gave Review tags in v1. Do they still apply here?

> 
>  tools/libvchan/vchan-socket-proxy.c | 183 ++++++++++++++++++----------
>  1 file changed, 119 insertions(+), 64 deletions(-)
> 
> -- 
> 2.25.1
> 

Re: [PATCH v2 00/10] Coverity fixes for vchan-socket-proxy
Posted by Marek Marczykowski-Górecki 3 years, 10 months ago
On Fri, Jun 26, 2020 at 10:18:07AM +0000, Wei Liu wrote:
> On Wed, Jun 10, 2020 at 11:29:26PM -0400, Jason Andryuk wrote:
> > This series addresses some Coverity reports.  To handle closing FDs, a
> > state struct is introduced to track FDs closed in both main() and
> > data_loop().
> > 
> > v2 changes "Ensure UNIX path NUL terminated" to avoid a warning with
> > gcc-10.  Also, "Move perror() into listen_socket" and "Move perror()
> > into connect_socket" are new.
> > 
> > Jason Andryuk (10):
> >   vchan-socket-proxy: Ensure UNIX path NUL terminated
> >   vchan-socket-proxy: Move perror() into listen_socket
> >   vchan-socket-proxy: Move perror() into connect_socket
> >   vchan-socket-proxy: Check xs_watch return value
> >   vchan-socket-proxy: Unify main return value
> >   vchan-socket-proxy: Use a struct to store state
> >   vchan-socket-proxy: Switch data_loop() to take state
> >   vchan-socket-proxy: Set closed FDs to -1
> >   vchan-socket-proxy: Cleanup resources on exit
> >   vchan-socket-proxy: Handle closing shared input/output_fd
> 
> Acked-by: Wei Liu <wl@xen.org>
> 
> Cc Paul. V1 of this series was posted back in May. I consider this
> series bug fixes, so they should be applied for 4.14. The risk is low
> because vchan-socket-proxy is a small utility used by a small number of
> users.
> 
> Marek, you gave Review tags in v1. Do they still apply here?

Yes. And also for the new patches 2-3. I thought I've posted it here,
but must have missed clicking "send"...

> > 
> >  tools/libvchan/vchan-socket-proxy.c | 183 ++++++++++++++++++----------
> >  1 file changed, 119 insertions(+), 64 deletions(-)
> > 
> > -- 
> > 2.25.1
> > 

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
Re: [PATCH v2 00/10] Coverity fixes for vchan-socket-proxy
Posted by Wei Liu 3 years, 10 months ago
On Fri, Jun 26, 2020 at 01:12:01PM +0200, Marek Marczykowski-Górecki wrote:
> On Fri, Jun 26, 2020 at 10:18:07AM +0000, Wei Liu wrote:
> > On Wed, Jun 10, 2020 at 11:29:26PM -0400, Jason Andryuk wrote:
> > > This series addresses some Coverity reports.  To handle closing FDs, a
> > > state struct is introduced to track FDs closed in both main() and
> > > data_loop().
> > > 
> > > v2 changes "Ensure UNIX path NUL terminated" to avoid a warning with
> > > gcc-10.  Also, "Move perror() into listen_socket" and "Move perror()
> > > into connect_socket" are new.
> > > 
> > > Jason Andryuk (10):
> > >   vchan-socket-proxy: Ensure UNIX path NUL terminated
> > >   vchan-socket-proxy: Move perror() into listen_socket
> > >   vchan-socket-proxy: Move perror() into connect_socket
> > >   vchan-socket-proxy: Check xs_watch return value
> > >   vchan-socket-proxy: Unify main return value
> > >   vchan-socket-proxy: Use a struct to store state
> > >   vchan-socket-proxy: Switch data_loop() to take state
> > >   vchan-socket-proxy: Set closed FDs to -1
> > >   vchan-socket-proxy: Cleanup resources on exit
> > >   vchan-socket-proxy: Handle closing shared input/output_fd
> > 
> > Acked-by: Wei Liu <wl@xen.org>
> > 
> > Cc Paul. V1 of this series was posted back in May. I consider this
> > series bug fixes, so they should be applied for 4.14. The risk is low
> > because vchan-socket-proxy is a small utility used by a small number of
> > users.
> > 
> > Marek, you gave Review tags in v1. Do they still apply here?
> 
> Yes. And also for the new patches 2-3. I thought I've posted it here,
> but must have missed clicking "send"...

Thanks for confirming.

Wei.

RE: [PATCH v2 00/10] Coverity fixes for vchan-socket-proxy
Posted by Paul Durrant 3 years, 10 months ago
> -----Original Message-----
> From: Wei Liu <wl@xen.org>
> Sent: 26 June 2020 11:18
> To: Jason Andryuk <jandryuk@gmail.com>
> Cc: xen-devel@lists.xenproject.org; Ian Jackson <ian.jackson@eu.citrix.com>; Wei Liu <wl@xen.org>;
> Paul Durrant <paul@xen.org>; marmarek@invisiblethingslab.com
> Subject: Re: [PATCH v2 00/10] Coverity fixes for vchan-socket-proxy
> 
> On Wed, Jun 10, 2020 at 11:29:26PM -0400, Jason Andryuk wrote:
> > This series addresses some Coverity reports.  To handle closing FDs, a
> > state struct is introduced to track FDs closed in both main() and
> > data_loop().
> >
> > v2 changes "Ensure UNIX path NUL terminated" to avoid a warning with
> > gcc-10.  Also, "Move perror() into listen_socket" and "Move perror()
> > into connect_socket" are new.
> >
> > Jason Andryuk (10):
> >   vchan-socket-proxy: Ensure UNIX path NUL terminated
> >   vchan-socket-proxy: Move perror() into listen_socket
> >   vchan-socket-proxy: Move perror() into connect_socket
> >   vchan-socket-proxy: Check xs_watch return value
> >   vchan-socket-proxy: Unify main return value
> >   vchan-socket-proxy: Use a struct to store state
> >   vchan-socket-proxy: Switch data_loop() to take state
> >   vchan-socket-proxy: Set closed FDs to -1
> >   vchan-socket-proxy: Cleanup resources on exit
> >   vchan-socket-proxy: Handle closing shared input/output_fd
> 
> Acked-by: Wei Liu <wl@xen.org>
> 
> Cc Paul. V1 of this series was posted back in May. I consider this
> series bug fixes, so they should be applied for 4.14. The risk is low
> because vchan-socket-proxy is a small utility used by a small number of
> users.
> 

Agreed. Series...

Release-acked-by: Paul Durrant <paul@xen.org>

> Marek, you gave Review tags in v1. Do they still apply here?
> 
> >
> >  tools/libvchan/vchan-socket-proxy.c | 183 ++++++++++++++++++----------
> >  1 file changed, 119 insertions(+), 64 deletions(-)
> >
> > --
> > 2.25.1
> >