summaryrefslogtreecommitdiff
path: root/drivers/tty
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2014-09-10 19:06:36 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-09-24 04:19:36 (GMT)
commit99416322dd16b810ba74098cc50ef2a844091d35 (patch)
tree4bc8b94a8d26c609d84953652d47812dbc9e07a6 /drivers/tty
parentc274f6ef1c6665632767d32e4ab912aad839ce27 (diff)
downloadlinux-99416322dd16b810ba74098cc50ef2a844091d35.tar.xz
tty: Workaround Alpha non-atomic byte storage in tty_struct
The Alpha EV4/EV5 cpus can corrupt adjacent byte and short data because those cpus use RMW to store byte and short data. Thus, concurrent adjacent byte stores could become corrupted, if serialized by a different lock. tty_struct uses different locks to protect certain fields within the structure, and thus is vulnerable to byte stores which are not atomic. Merge the ->ctrl_status byte and packet mode bit, both protected by the ->ctrl_lock, into an unsigned long. The padding bits are necessary to force the compiler to allocate the type specified; otherwise, gcc will ignore the type specifier and allocate the minimum number of bytes required to store the bitfield. In turn, this would allow Alpha EV4/EV5 cpus to corrupt adjacent byte or short storage (because those cpus use RMW to store byte and short data). gcc versions < 4.7.2 will also corrupt storage adjacent to bitfields smaller than unsigned long on ia64, ppc64, hppa64, and sparc64, thus requiring more than unsigned int storage (which would otherwise be sufficient to fix the Alpha non-atomic storage problem). Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
0 files changed, 0 insertions, 0 deletions