[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/1] event_notifier: prevent accidental use afte
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 1/1] event_notifier: prevent accidental use after close |
Date: |
Fri, 3 Mar 2017 10:23:47 +0800 |
User-agent: |
Mutt/1.7.1 (2016-10-04) |
On Thu, Mar 02, 2017 at 07:13:08PM +0100, Halil Pasic wrote:
> Let's set the handles to the underlying facilities to their extremal
> value so no accidental misuse can happen, and to make it obvious that the
> notifier is dysfunctional. E.g. if we just close an fd but do not touch
> the int holding the fd eventually a read/write could succeed again when
> the fd gets reused, and corrupt the file addressed by the fd.
>
> Signed-off-by: Halil Pasic <address@hidden>
> ---
>
> No strong feelings about this, but obviously, I do think it's worth a
> try.
>
> The one who brought this unfortunate possibility to my attention was
> Michael Tsirkin.
> ---
> util/event_notifier-posix.c | 2 ++
> util/event_notifier-win32.c | 1 +
> 2 files changed, 3 insertions(+)
Reviewed-by: Stefan Hajnoczi <address@hidden>
signature.asc
Description: PGP signature