[bug report] mm: replace vma->vm_flags direct modifications with modifier calls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Suren Baghdasaryan,

The patch 1c71222e5f23: "mm: replace vma->vm_flags direct
modifications with modifier calls" from Jan 26, 2023, leads to the
following Smatch static checker warning:

	./include/linux/mm.h:729 vma_start_write()
	warn: sleeping in atomic context

include/linux/mm.h
    722 static inline void vma_start_write(struct vm_area_struct *vma)
    723 {
    724         int mm_lock_seq;
    725 
    726         if (__is_vma_write_locked(vma, &mm_lock_seq))
    727                 return;
    728 
--> 729         down_write(&vma->vm_lock->lock);
    730         vma->vm_lock_seq = mm_lock_seq;
    731         up_write(&vma->vm_lock->lock);
    732 }

The call tree is:

gru_fault() <- disables preempt
-> remap_pfn_range()
   -> track_pfn_remap()
   -> remap_pfn_range_notrack()
      -> vm_flags_set()
         -> vma_start_write()

Before track_pfn_remap() and remap_pfn_range_notrack() would just do |=
to set the flags but now they use vm_flags_set() so there is a potential
they could sleep.

regards,
dan carpenter




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux