CV-Bowen opened a new pull request, #22392:
URL: https://github.com/apache/nuttx/pull/22392

   ## Summary
   
   Depends on apache/nuttx#22391 (counter-based flow control); this branch
   is stacked on it.
   
   `drivers/serial/uart_rpmsg: scope and lock the dmatx abort`:
   `uart_rpmsg_device_destroy()` is called for every rpmsg device that goes
   away, and it aborted the in-flight TX of every rpmsg tty, outside the
   "endpoint belongs to this device" test and without a lock. A writer
   blocked in `uart_rpmsg_dmasend()` then resumed with a zeroed transfer
   and copied from a NULL `nbuffer` (ASan: SEGV on address 0 in
   `uart_rpmsg_dmasend()`). The abort is now limited to the device that
   owns the endpoint and runs under `dev->lock`.
   
   ## Impact
   
   Teardown of one rpmsg link no longer aborts the TX of uart_rpmsg devices
   on other links. No API, Kconfig or wire format change.
   
   ## Testing
   
   Host: Ubuntu 22.04.5 LTS x86_64, QEMU version 10.2.1, sim: cc (Ubuntu 
13.1.0-8ubuntu1~22.04) 13.1.0, qemu-armv8a: aarch64-none-elf-gcc (Arm GNU 
Toolchain 12.2.Rel1 (Build arm-12.24)) 12.2.1 20221205
   
   Builds sim:rpserver, sim:rpproxy, qemu-armv8a:rpserver and
   qemu-armv8a:rpproxy with 0 warnings. Through `cu /dev/ttyproxy` on sim:
   15 rounds of `ls -l /proc` and `cat /proc/meminfo` on the proxy, each
   followed by `rpmsg ping all 5 512 1 0` on the server: 45/45.
   
   Not reproduced here: the crash itself (needs a second rpmsg link that
   goes away while a tty on another link is writing).
   
   No regression in rpmsg: sim:rpserver/rpproxy and 
qemu-armv8a:rpserver/rpproxy boot and pass the fixed rpmsg cases (dump, ping, 
rpmsgfs; 15/15; the sim proxy cases run over `/dev/ttyproxy`). qemu-armv8a was 
built with LIBC_ENVPATH and BINFMT_CHECKEXEC disabled, which current master 
needs for nxinit to start nsh there; unrelated to this change.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

  • [PR] drivers/serial/uart_rpms... CV-Bowen (via GitHub) via commits

Reply via email to