Function report |
Source Code:mm\mprotect.c |
Create Date:2022-07-28 14:52:14 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:mprotect_fixup
Proto:int mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev, unsigned long start, unsigned long end, unsigned long newflags)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct vm_area_struct * | vma | |
struct vm_area_struct ** | pprev | |
unsigned long | start | |
unsigned long | end | |
unsigned long | newflags |
377 | oldflags = Flags, see mm.h. |
378 | nrpages = end - start >> PAGE_SHIFT determines the page size |
379 | charged = 0 |
382 | dirty_accountable = 0 |
394 | If arch_has_pfn_modify_check() && Flags, see mm.h. & (Page-ranges managed without "struct page", just pure PFN | Can contain "struct page" and pure PFN pages ) && (newflags & ( currently active flags | VM_WRITE | VM_EXEC)) == 0 Then |
397 | new_pgprot = vm_get_page_prot(newflags) |
416 | If Not (oldflags & ( Is a VM accounted object | VM_WRITE | Huge TLB Page VM | VM_SHARED | should the VM suppress accounting )) Then |
419 | If security_vm_enough_memory_mm(mm, charged) Then Return -ENOMEM |
421 | newflags |= Is a VM accounted object |
428 | pgoff = Offset (within vm_file) in PAGE_SIZEunits + ( start - Our start address within vm_mm. >> PAGE_SHIFT determines the page size ) |
429 | pprev = Given a mapping request (addr,end,vm_flags,file,pgoff), figure out* whether that can be merged with its predecessor or its successor |
432 | If pprev Then |
440 | If start != Our start address within vm_mm. Then |
446 | If end != The first byte after our end addresswithin vm_mm. Then |
452 | success : |
457 | Flags, see mm.h. = newflags |
473 | vm_stat_account(mm, oldflags, - nrpages) |
474 | vm_stat_account(mm, newflags, nrpages) |
475 | perf_event_mmap(vma) |
476 | Return 0 |
478 | fail : |
479 | vm_unacct_memory(charged) |
480 | Return error |
Name | Describe |
---|---|
do_mprotect_pkey | pkey==-1 when doing a legacy mprotect() |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |