[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH-for-5.0] tools/virtiofsd/passthrough_ll: Fix double close()
From: |
Stefan Hajnoczi |
Subject: |
Re: [PATCH-for-5.0] tools/virtiofsd/passthrough_ll: Fix double close() |
Date: |
Mon, 23 Mar 2020 11:08:58 +0000 |
On Sat, Mar 21, 2020 at 01:06:54PM +0100, Philippe Mathieu-Daudé wrote:
> On success, the fdopendir() call closes fd. Later on the error
> path we try to close an already-closed fd. This can lead to
> use-after-free. Fix by only closing the fd if the fdopendir()
> call failed.
>
> Cc: address@hidden
> Fixes: 7c6b66027 (Import passthrough_ll from libfuse fuse-3.8.0)
> Reported-by: Coverity (CID 1421933 USE_AFTER_FREE)
> Suggested-by: Peter Maydell <address@hidden>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> tools/virtiofsd/passthrough_ll.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
Thanks!
Reviewed-by: Stefan Hajnoczi <address@hidden>
signature.asc
Description: PGP signature