答复: [PATCH][v2] tty: fix race between flush_to_ldisc and tty_open

2019-01-13 Thread Li,Rongqing
> -邮件原件- > 发件人: Kohli, Gaurav [mailto:gko...@codeaurora.org] > 发送时间: 2019年1月11日 21:57 > 收件人: Li,Rongqing ; linux-kernel@vger.kernel.org; > jsl...@suse.com; gre...@linuxfoundation.org; a...@linux.intel.com > 主题: Re: [PATCH][v2] tty: fix race between flush_to_ldisc an

Re: [PATCH][v2] tty: fix race between flush_to_ldisc and tty_open

2019-01-11 Thread Kohli, Gaurav
Hi, it don't seems to be good idea to put lock on one function and unlock in some other function. If in future some one has to call tty_init_dev, how he can track the unlocking as well of ldisc lock. Regards Gaurav On 12/24/2018 8:13 AM, Li RongQing wrote: There still is a race window after

[PATCH][v2] tty: fix race between flush_to_ldisc and tty_open

2018-12-23 Thread Li RongQing
There still is a race window after the commit b027e2298bd588 ("tty: fix data race between tty_init_dev and flush of buf"), if receive_buf call comes before tty initialization completes in n_tty_open and tty->driver_data may be NULL. CPU0 CPU1