Mohamed Ayman commented on a discussion: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1227#note_149422


Ok, the previous check was iincorrect because fdt_getprop() returns the length 
in bytes, while the code compared it with the number of address cells. This 
could allow truncated properties to pass the check and lead to invalid memory 
access.

I fixed it by checcking against ac \* sizeof(uint32_t), which matches the 
actual data size.

I tested this change by running the RTEMS hello world on QEMU 
(qemu-system-riscv64 -M virt with #address-cells = \<2\>), and it worked 
**without any regression Nothing Breaks**.

![Screenshot from 2026-05-03 
05-53-58.png](/uploads/f76c7a97a49bc4805fc99334d59a894e/Screenshot_from_2026-05-03_05-53-58.png){width=900
 height=365}

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


_______________________________________________
bugs mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to