lkml.org 
[lkml]   [2018]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tty: fix data race in n_tty_receive_buf_common
> But in above case , there we can hit another race, if we have a sequence 
> like this
> tty_init_dev->alloc_tty_struct -> tty_ldisc_init -> this will initialize
> ldisc ,
> but at this moment disc_data is still NULL
>
> And if flush_to_ldisc comes in between, it will take ldisc reference and
> proceeds receive buffer.

So you need to move the lock up one line to protect the assignment to
tty->port->itty. We can do that.

At that point your flush_to_ldisc should see either port->itty = NULL or a
valid initialized ldisc.

Alan

\
 
 \ /
  Last update: 2018-01-05 15:16    [W:0.060 / U:1.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site