git: nvmm: fix os_vmobj_map_user() to use a hint to map into process space

Aaron LI aly at crater.dragonflybsd.org
Tue Dec 1 08:22:58 PST 2026


commit 71ed2336d5b6803b15978edd4543a87be1178e23
Author: Aaron LI <aly at aaronly.me>
Date:   Mon Nov 30 19:56:35 2026 +0800

    nvmm: fix os_vmobj_map_user() to use a hint to map into process space
    
    This fixes a real bug that the function previously could map an object
    at the address 0; for example, a mapped comm page could have a zero
    address, breaking the '!= NULL' condition.
    
    Fix the bug by using a hint from vm_map_hint() when mapping into the
    current process space.  This is the similar behavior used in kern_mmap()
    for a mmap(2).
    
    By the way, this extra hint code exists in the NetBSD's implementation,
    so it was my mistake when porting this function to DragonFly.

Summary of changes:
 sys/dev/virtual/nvmm/nvmm_dragonfly.c | 5 +++++
 1 file changed, 5 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/71ed2336d5b6803b15978edd4543a87be1178e23


-- 
DragonFly BSD source repository


More information about the Commits mailing list