Re: [PATCH 4/9] tty : kill receive_room usage in vt

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

 



On Sun,  4 Mar 2012 18:59:15 +0100
Matthieu CASTET <castet.matthieu@xxxxxxx> wrote:

> Signed-off-by: Matthieu CASTET <castet.matthieu@xxxxxxx>
> ---
>  drivers/tty/vt/selection.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/vt/selection.c b/drivers/tty/vt/selection.c
> index 7a0a12a..3e9a914 100644
> --- a/drivers/tty/vt/selection.c
> +++ b/drivers/tty/vt/selection.c
> @@ -332,8 +332,7 @@ int paste_selection(struct tty_struct *tty)
>  			continue;
>  		}
>  		count = sel_buffer_lth - pasted;
> -		count = min(count, tty->receive_room);
> -		tty->ldisc->ops->receive_buf(tty, sel_buffer + pasted,
> +		count = tty->ldisc->ops->receive_buf(tty, sel_buffer + pasted,
>  								NULL, count);

This is unsafe in your model - it's not valid to call it as selection
does in the first place. You have two parallel consumers here so any
result is nonsense (and it'll make messes elsewhere)

It's unsafe in the existing model too, but the existing one will recover
whereas once you switch behaviour the new one won't.

--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux