Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 629ad8c6 authored by Osvaldo Banuelos's avatar Osvaldo Banuelos
Browse files

Merge tty fixes from v3.12.23 into msm-3.10



Several fixes in tty were introduced in v.3.12+. We've encountered
a use-after-free in tty_ldisc_try() through slub debug testing. The
improved synchronization via an ld semaphore potentially resolves
this issue. Prior to these patches, tty_ldisc_halt() wasn't synchronized
with respect to tty_ldisc_try().

tty: Replace ldisc locking with ldisc_sem:

Line discipline locking was performed with a combination of
a mutex, a status bit, a count, and a waitqueue -- basically,
a rw semaphore.
Replace the existing combination with an ld_semaphore.
Fixes:
 1) the 'reference acquire after ldisc locked' bug
 2) the over-complicated halt mechanism
 3) lock order wrt. tty_lock()
 4) dropping locks while changing ldisc
 5) previously unidentified deadlock while locking ldisc from
    both linked ttys concurrently
 6) previously unidentified recursive deadlocks

* (4 commits):
  tty: Replace ldisc locking with ldisc_sem
  tty: Add lock/unlock ldisc pair functions
  tty: Fix tty_ldisc_lock name collision
  tty: Add timed, writer-prioritized rw semaphore

Change-Id: I5f22eee6b844fb91e1a0b9330e38630b90ec2eb1
Signed-off-by: default avatarOsvaldo Banuelos <osvaldob@codeaurora.org>
parents 9ff7b179 e2034cb8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment