mirror of
https://github.com/apache/nuttx.git
synced 2026-08-11 07:25:13 +00:00
uart_putxmitchar() manipulates dev->xmit.head/buffer directly with no internal locking - every other caller (uart_write()) takes dev->xmit.lock first. uart_readv()'s ECHO handling (both the backspace/delete erase sequence and the normal character echo) calls uart_putxmitchar() without taking that lock, so a concurrent uart_write() and a local echo can race on the same circular buffer state, corrupting it. Take dev->xmit.lock around each echo's uart_putxmitchar() calls, matching what uart_write() already does. uart_readv() holds dev->recv.lock for its own duration, but no other code path ever acquires recv.lock while holding xmit.lock, so nesting xmit.lock inside the existing recv.lock scope here doesn't introduce a new lock-ordering cycle. Fixes #14845 Signed-off-by: yi chen <94xhn1@gmail.com> |
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| Kconfig | ||
| Kconfig-16550 | ||
| Kconfig-cmsdk | ||
| Kconfig-lpuart | ||
| Kconfig-pci | ||
| Kconfig-pl011 | ||
| Kconfig-sci | ||
| Kconfig-uart | ||
| Kconfig-usart | ||
| Kconfig-xlnxps | ||
| Make.defs | ||
| ptmx.c | ||
| pty.c | ||
| pty.h | ||
| serial.c | ||
| serial_cmsdk.c | ||
| serial_dma.c | ||
| serial_gdbstub.c | ||
| serial_io.c | ||
| uart_16550.c | ||
| uart_bth4.c | ||
| uart_bth5.c | ||
| uart_hostfs.c | ||
| uart_pci_16550.c | ||
| uart_pl011.c | ||
| uart_ram.c | ||
| uart_rpmsg.c | ||
| uart_rpmsg_raw.c | ||
| uart_xlnx_ps.c | ||