mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
f962e8361a
0x7d and 0x7e bytes are meant to be escaped in the data portion of
frames, but this didn't occur since next_chunk_len() had an off-by-one
error. That also resulted in the final byte of a payload being written
as a separate tty write op.
The chunk prior to an escaped byte would be one byte short, and the
next call would never test the txpos+1 case, which is where the escaped
byte was located. That meant it never hit the escaping case in
mctp_serial_tx_work().
Example Input: 01 00 08 c8 7e 80 02
Previous incorrect chunks from next_chunk_len():
01 00 08
c8 7e 80
02
With this fix:
01 00 08 c8
7e
80 02
Cc: stable@vger.kernel.org
Fixes:
|
||
---|---|---|
.. | ||
Kconfig | ||
Makefile | ||
mctp-i2c.c | ||
mctp-i3c.c | ||
mctp-serial.c |