Skip to contentSkip to conversation

find_vma_intersection

DISCUSSION Mark Hounschell 1 participant 2 messages Dec 30, 2005

lore
Share & tools
lore
#0 lore raw

Can someone enlighten me as to what it really means when a user land shmat call, in which the virtual address is provided, fails in the kernel find_vma_intersection function because

end_addr(of my SHM) is <= vma->vm_start?

static inline struct vm_area_struct * find_vma_intersection(struct mm_struct * mm, unsigned long start_addr, unsigned long end_addr)

{
        struct vm_area_struct * vma = find_vma(mm,start_addr);

        if (vma && end_addr <= vma->vm_start)
                vma = NULL;
        return vma;
}

Thanks in advance
Mark

#1 lore raw
Quoted 5 lines · Mark Hounschell

Can someone enlighten me as to what it really means when a user land shmat call, in which the virtual address is provided, fails in the kernel find_vma_intersection function because

end_addr(of my SHM) is <= vma->vm_start?

Actually because its ! <= vma->vm_start.

Quoted 11 lines

static inline struct vm_area_struct * find_vma_intersection(struct mm_struct * mm, unsigned long start_addr, unsigned long end_addr)

{
        struct vm_area_struct * vma = find_vma(mm,start_addr);

        if (vma && end_addr <= vma->vm_start)
                vma = NULL;
        return vma;
}

Thanks
Mark