diff options
author | Dmitry Safonov <dima@arista.com> | 2018-11-01 01:24:51 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-12-05 12:16:33 +0100 |
commit | 110b89282f658593a5a4a96a300d5aa51f1bf88f (patch) | |
tree | 07c22aa906036c8799904235865098ce21f91e24 /scripts | |
parent | tty/ldsem: Convert to regular lockdep annotations (diff) | |
download | linux-110b89282f658593a5a4a96a300d5aa51f1bf88f.tar.xz linux-110b89282f658593a5a4a96a300d5aa51f1bf88f.zip |
tty/ldsem: Add lockdep asserts for ldisc_sem
Make sure under CONFIG_LOCKDEP that each change to line discipline
is done with held write semaphor.
Otherwise potential reader will have a good time dereferencing
incomplete/uninitialized ldisc.
An exception here is tty_ldisc_open(), as it's called without ldisc_sem
locked by tty_init_dev() => tty_ldisc_setup() for the tty->link.
It seem valid as tty_init_dev() will call tty_driver_install_tty()
which will find ops->install(). Install will establish tty->link in
pty_common_install(), just after allocation of slave tty with
alloc_tty_struct(). So, no one should have a reference to slave pty yet.
Cc: Jiri Slaby <jslaby@suse.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions