• Arun Easi's avatar
    scsi: qedi: Fix bad pte call trace when iscsiuio is stopped. · 5e901d0b
    Arun Easi authored
    munmap done by iscsiuio during a stop of the service triggers a "bad
    pte" warning sometimes. munmap kernel path goes through the mmapped
    pages and has a validation check for mapcount (in struct page) to be
    zero or above. kzalloc, which we had used to allocate udev->ctrl, uses
    slab allocations, which re-uses mapcount (union) for other purposes that
    can make the mapcount look negative. Avoid all these trouble by invoking
    one of the __get_free_pages wrappers to be used instead of kzalloc for
    udev->ctrl.
    
     BUG: Bad page map in process iscsiuio  pte:80000000aa624067 pmd:3e6777067
     page:ffffea0002a98900 count:2 mapcount:-2143289280
         mapping: (null) index:0xffff8800aa624e00
     page flags: 0x10075d00000090(dirty|slab)
     page dumped because: bad pte
     addr:00007fcba70a3000 vm_flags:0c0400fb anon_vma: (null)
         mapping:ffff8803edf66e90 index:0
    
     Call Trace:
         dump_stack+0x19/0x1b
         print_bad_pte+0x1af/0x250
         unmap_page_range+0x7a7/0x8a0
         unmap_single_vma+0x81/0xf0
         unmap_vmas+0x49/0x90
         unmap_region+0xbe/0x140
         ? vma_rb_erase+0x121/0x220
         do_munmap+0x245/0x420
         vm_munmap+0x41/0x60
         SyS_munmap+0x22/0x30
         tracesys+0xdd/0xe2
    Signed-off-by: default avatarArun Easi <arun.easi@cavium.com>
    Signed-off-by: default avatarManish Rangankar <manish.rangankar@cavium.com>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    5e901d0b
qedi_main.c 50.1 KB