The source for the Linux kernel used in Windows Subsystem for Linux 2 (WSL2)
Перейти к файлу
Ilpo Järvinen d0bcf6caa2 serial: 8250: Fix serial8250_tx_empty() race with DMA Tx
commit 146a37e05d upstream.

There's a potential race before THRE/TEMT deasserts when DMA Tx is
starting up (or the next batch of continuous Tx is being submitted).
This can lead to misdetecting Tx empty condition.

It is entirely normal for THRE/TEMT to be set for some time after the
DMA Tx had been setup in serial8250_tx_dma(). As Tx side is definitely
not empty at that point, it seems incorrect for serial8250_tx_empty()
claim Tx is empty.

Fix the race by also checking in serial8250_tx_empty() whether there's
DMA Tx active.

Note: This fix only addresses in-kernel race mainly to make using
TCSADRAIN/FLUSH robust. Userspace can still cause other races but they
seem userspace concurrency control problems.

Fixes: 9ee4b83e51 ("serial: 8250: Add support for dmaengine")
Cc: stable@vger.kernel.org
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230317113318.31327-3-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-17 11:50:31 +02:00
Documentation riscv: Move early dtb mapping into the fixmap region 2023-05-01 08:23:24 +09:00
LICENSES
arch ARM: dts: s5pv210: correct MIPI CSIS clock name 2023-05-17 11:50:24 +02:00
block blk-crypto: make blk_crypto_evict_key() more robust 2023-05-11 23:00:16 +09:00
certs
crypto crypto: engine - fix crypto_queue backlog handling 2023-05-17 11:50:20 +02:00
drivers serial: 8250: Fix serial8250_tx_empty() race with DMA Tx 2023-05-17 11:50:31 +02:00
fs ext4: fix invalid free tracking in ext4_xattr_move_to_block() 2023-05-17 11:50:30 +02:00
include ASoC: soc-pcm: Fix DPCM lockdep warning due to nested stream locks 2023-05-17 11:50:26 +02:00
init
io_uring io_uring: avoid null-ptr-deref in io_arm_poll_handler 2023-03-22 13:31:37 +01:00
ipc
kernel locking/rwsem: Add __always_inline annotation to __down_read_common() and inlined callers 2023-05-17 11:50:29 +02:00
lib debugobject: Ensure pool refill (again) 2023-05-11 23:00:40 +09:00
mm writeback, cgroup: fix null-ptr-deref write in bdi_split_work_to_wbs 2023-05-11 23:00:18 +09:00
net af_packet: Don't send zero-byte data in packet_sendmsg_spkt(). 2023-05-17 11:50:18 +02:00
samples
scripts scripts/gdb: fix lx-timerlist for Python3 2023-05-11 23:00:39 +09:00
security selinux: ensure av_permissions.h is built when needed 2023-05-11 23:00:19 +09:00
sound ASoC: soc-pcm.c: call __soc_pcm_close() in soc_pcm_close() 2023-05-17 11:50:27 +02:00
tools perf stat: Separate bperf from bpf_profiler 2023-05-17 11:50:21 +02:00
usr
virt KVM: fix memoryleak in kvm_init() 2023-03-17 08:49:04 +01:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS counter: Internalize sysfs interface code 2023-04-20 12:13:55 +02:00
Makefile Linux 5.15.111 2023-05-11 23:00:40 +09:00
README

README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.