RTEMS | microblaze: harden stdout-path parsing for console (!981)

Sam Price (@TheSamPrice) gitlab at rtems.org
Mon Feb 2 05:38:37 UTC 2026



Sam Price created a merge request: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/981

Project:Branches: TheSamPrice/rtems:fix/microblaze-stdout-path to rtems/rtos/rtems:main
Author:   Sam Price




## Summary

microblaze: harden stdout-path parsing for console

Details:

- Top test could crash early when /chosen/stdout-path used an alias (e.g. serial0:115200n8); the previous code passed a non NUL-terminated substring into libfdt, leading to corrupt reads and an illegal opcode before Init ran.

- Parse stdout-path into a bounded, NUL-terminated buffer, strip the baud/format suffix, and resolve aliases via fdt_get_alias_namelen().

- Use fdt_path_offset() on the resolved path so the console device node is found without libfdt walking past the string, allowing top.exe to boot and run normally under QEMU.


## AI Details
<!-- Make sure you have read our statement at https://www.rtems.org/generative-ai/ -->

### Prompt used
Lots of debugging to track down crash.

### AI model used
Codex 5.2

### How AI was used for the contribution

- [X] Formatting
- [N/A] Test creation.
- [X] Code comments.
- [X] The entire contribution was generated using AI
- [ ] AI code completion such as Copilot in VSCode.


I am not great with the device tree calls.
If a better way exists to catch null pointers out of this let me know via comments.

### Access
<!-- Please state that you have not used a product that claims copyright and you have legitimate access. -->


<!-- Default settings, if it is a dropdown it will set after submission -->

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/981
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260202/737b8e15/attachment.htm>


More information about the bugs mailing list