Console/stdio use after free
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest2 patches 0 repliesNew
- v10 of 2 patches 0 repliesSuperseded
Changes in v2 from the cover letter
- Comment new function
- Add comment stating this needs a proper fix
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | stdio: Introduce stdio_valid()common/ include/ | +22 | 1 reply | |
| 2/2 | console: Don't start/stop console if stdio device invalidcommon/ | +9 | 10 replies |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Simon Glass |
|---|---|
| 1/2 | R-b |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/2] Console/stdio use after free
With today's master, 70c2525c0d3c ('IOMUX: Stop dropped consoles') introduces a use after free in usb_kbd_remove():
- usbkbd's stdio device is de-registered with stdio_deregister_dev(), the struct stdio_dev is freed.
- iomux_doenv() is called, usbkbd removed from the console list, and console_stop() is called on the struct stdio_dev pointer that no longer exists.
This series mitigates this by making sure the pointer is really a stdio device prior performing the stop operation. It's not ideal, but I couldn't figure out a nicer way to fix this.
Regards,
Nicolas
---
Changes since v1:
- Comment new function
- Add comment stating this needs a proper fix
Nicolas Saenz Julienne (2):
stdio: Introduce stdio_valid()
console: Don't start/stop console if stdio device invalid
common/console.c | 9 +++++++++ common/stdio.c | 11 +++++++++++ include/stdio_dev.h | 11 +++++++++++ 3 files changed, 31 insertions(+)
Signature · 1 line
2.30.0