Re: [PATCH] spicevmc: Drop unsent data on client disconnection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Wed, Jan 13, 2016 at 11:55:56AM +0100, Christophe Fergeau wrote:
> For what it's worth, I'm fairly sure the smartcard code needs the same
> fix, but I'm not sure how to reproduce failures with it:

Yeah, I agree. In this case might be worth to have a debug message
before the buffer release so it can help in some unforeseen (not tested)
scenario.

Acked-by: Victor Toso <victortoso@xxxxxxxxxx>

> commit 4ab65457d6c83da2c6e19f5b6fa51737085dcb51
> Author: Christophe Fergeau <cfergeau@xxxxxxxxxx>
> Date:   Tue Sep 29 12:12:48 2015 +0200
>
>     smartcard: Drop unsent data on client disconnection
>
>     Similarly to the spicevmc patch, we need to drop partial channel data on
>     client disconnect, otherwise the smartcard channel may assert upon
>     reconnection.
> 
> diff --git a/server/smartcard.c b/server/smartcard.c
> index aad22aa..29d5f5f 100644
> --- a/server/smartcard.c
> +++ b/server/smartcard.c
> @@ -549,9 +549,14 @@ static void smartcard_channel_on_disconnect(RedChannelClient *rcc)
>  {
>      SmartCardChannelClient *scc = SPICE_CONTAINEROF(rcc, SmartCardChannelClient, base);
> 
> +
>      if (scc->smartcard_state) {
>          SmartCardDeviceState *st = scc->smartcard_state;
> 
> +        if (scc->write_buf) { /* msg hasn't been pushed to the guest */
> +            spice_char_device_write_buffer_release(st->chardev_st, scc->write_buf);
> +            scc->write_buf = NULL;
> +        }
>          smartcard_char_device_detach_client(scc);
>          smartcard_char_device_notify_reader_remove(st);
>      }
> 
> Christophe


_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]