lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220314091432.4288-1-ilpo.jarvinen@linux.intel.com>
Date:   Mon, 14 Mar 2022 11:14:31 +0200
From:   Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To:     linux-serial@...r.kernel.org, Greg KH <gregkh@...uxfoundation.org>,
        Jiri Slaby <jirislaby@...nel.org>
Cc:     linux-kernel@...r.kernel.org, Johan Hovold <johan@...nel.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Miquel Raynal <miquel.raynal@...tlin.com>,
        Lukas Wunner <lukas@...ner.de>,
        Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
        Gilles Buloz <gilles.buloz@...tron.com>,
        Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Subject: [PATCH 0/1] Fix 8250 XON/XOFF for DMA-capable devices

DMA-capable 8250 was not properly taking XON/XOFF into account
right since it was introduced in 2013. There was no attempt to
send x_char out at all which is fixed by this patch.

After making this fix, it was further reported by Gilles Buloz
that also rx side fails to work as expected if the receiving
side is not reading from tty. I took look into that issue and
and determined that XOFF char gets stuck in an intermediate
buffer until enough data can be processed in receive_buf().
So it's not very useful from flow control perspective :-). While
the problem is more likely to occur with DMA, the code does not
look robust and the problem can likely occur also w/o DMA.

I was thinking of fixing the rx side issue by adding lookahead.
The most natural place to call lookahead handler would seem
to be from flush_to_ldisc() in the case when receive_buf() does
not eat all characters that were passed to it. Does anybody have
other opinions on how it should be fixed?

Ilpo Järvinen (1):
  serial: 8250: fix XOFF/XON sending when DMA is used

 drivers/tty/serial/8250/8250_dma.c  | 11 ++++++++++-
 drivers/tty/serial/8250/8250_port.c |  4 +---
 drivers/tty/serial/serial_core.c    | 14 ++++++++++++++
 include/linux/serial_core.h         |  2 ++
 4 files changed, 27 insertions(+), 4 deletions(-)

-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ