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:
Osvaldo Banuelos <osvaldob@codeaurora.org>
Loading
Please register or sign in to comment