[PATCH] lib: sbi: dbtr: validate complete shared memory range

Pengpeng Hou hppiscas at 163.com
Wed Oct 14 02:02:37 PDT 2026


Hi liutong, Himanshu,

I checked the domain setup and DBTR ecall path at master 6ad246a14948.
The handler passes sbi_domain_thishart_ptr() to sbi_dbtr_setup_shmem().
On the cold-boot path, sbi_domain_init() allocates the domain-pointer
offset and registers the root domain for the available harts before
sbi_ecall_init(). A domain initialization failure stops that path
rather than reaching ecall registration.

I have not established a normal initialized ecall path that supplies a
NULL domain. This does not prove that every internal caller or platform
path excludes it, so I would not describe NULL-domain bypass as a
demonstrated runtime bug.

Would removing the dom && guard from the assigned-hart check be
appropriate as defensive validation? sbi_domain_is_assigned_hart()
already returns false for NULL, so this would reject it separately
from the complete shared-memory range check.

Thanks,
Pengpeng




More information about the opensbi mailing list