~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/execmem.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/linux/execmem.h (Version linux-6.12-rc7) and /include/linux/execmem.h (Version ccs-tools-1.8.12)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 
  2 #ifndef _LINUX_EXECMEM_ALLOC_H                    
  3 #define _LINUX_EXECMEM_ALLOC_H                    
  4                                                   
  5 #include <linux/types.h>                          
  6 #include <linux/moduleloader.h>                   
  7                                                   
  8 #if (defined(CONFIG_KASAN_GENERIC) || defined(    
  9                 !defined(CONFIG_KASAN_VMALLOC)    
 10 #include <linux/kasan.h>                          
 11 #define MODULE_ALIGN (PAGE_SIZE << KASAN_SHADO    
 12 #else                                             
 13 #define MODULE_ALIGN PAGE_SIZE                    
 14 #endif                                            
 15                                                   
 16 /**                                               
 17  * enum execmem_type - types of executable mem    
 18  *                                                
 19  * There are several subsystems that allocate     
 20  * Architectures define different restrictions    
 21  * permissions, alignment and other parameters    
 22  * by these subsystems.                           
 23  * Types in this enum identify subsystems that    
 24  * and let architectures define parameters for    
 25  * allocations by each subsystem.                 
 26  *                                                
 27  * @EXECMEM_DEFAULT: default parameters that w    
 28  * are not explicitly defined.                    
 29  * @EXECMEM_MODULE_TEXT: parameters for module    
 30  * @EXECMEM_KPROBES: parameters for kprobes       
 31  * @EXECMEM_FTRACE: parameters for ftrace         
 32  * @EXECMEM_BPF: parameters for BPF               
 33  * @EXECMEM_MODULE_DATA: parameters for module    
 34  * @EXECMEM_TYPE_MAX:                             
 35  */                                               
 36 enum execmem_type {                               
 37         EXECMEM_DEFAULT,                          
 38         EXECMEM_MODULE_TEXT = EXECMEM_DEFAULT,    
 39         EXECMEM_KPROBES,                          
 40         EXECMEM_FTRACE,                           
 41         EXECMEM_BPF,                              
 42         EXECMEM_MODULE_DATA,                      
 43         EXECMEM_TYPE_MAX,                         
 44 };                                                
 45                                                   
 46 /**                                               
 47  * enum execmem_range_flags - options for exec    
 48  * @EXECMEM_KASAN_SHADOW:       allocate kasan    
 49  */                                               
 50 enum execmem_range_flags {                        
 51         EXECMEM_KASAN_SHADOW    = (1 << 0),       
 52 };                                                
 53                                                   
 54 /**                                               
 55  * struct execmem_range - definition of an add    
 56  *                        related data allocat    
 57  * @start:      address space start               
 58  * @end:        address space end (inclusive)     
 59  * @fallback_start: start of the secondary add    
 60  *                  allocations on architectur    
 61  * @fallback_end:   start of the secondary add    
 62  * @pgprot:     permissions for memory in this    
 63  * @alignment:  alignment required for text al    
 64  * @flags:      options for memory allocations    
 65  */                                               
 66 struct execmem_range {                            
 67         unsigned long   start;                    
 68         unsigned long   end;                      
 69         unsigned long   fallback_start;           
 70         unsigned long   fallback_end;             
 71         pgprot_t        pgprot;                   
 72         unsigned int    alignment;                
 73         enum execmem_range_flags flags;           
 74 };                                                
 75                                                   
 76 /**                                               
 77  * struct execmem_info - architecture paramete    
 78  * @ranges: array of parameter sets defining a    
 79  * parameters for executable memory allocation    
 80  * explicitly initialized by an architecture u    
 81  * @EXECMEM_DEFAULT.                              
 82  */                                               
 83 struct execmem_info {                             
 84         struct execmem_range    ranges[EXECMEM    
 85 };                                                
 86                                                   
 87 /**                                               
 88  * execmem_arch_setup - define parameters for     
 89  *                                                
 90  * A hook for architectures to define paramete    
 91  * executable memory. These parameters should     
 92  * @execmem_info structure.                       
 93  *                                                
 94  * For architectures that do not implement thi    
 95  * parameters will be used                        
 96  *                                                
 97  * Return: a structure defining architecture p    
 98  * for allocations of executable memory           
 99  */                                               
100 struct execmem_info *execmem_arch_setup(void);    
101                                                   
102 /**                                               
103  * execmem_alloc - allocate executable memory     
104  * @type: type of the allocation                  
105  * @size: how many bytes of memory are require    
106  *                                                
107  * Allocates memory that will contain executab    
108  * loaded from kernel modules.                    
109  *                                                
110  * Allocates memory that will contain data cou    
111  * like data sections in kernel modules.          
112  *                                                
113  * The memory will have protections defined by    
114  * region of the @type.                           
115  *                                                
116  * Return: a pointer to the allocated memory o    
117  */                                               
118 void *execmem_alloc(enum execmem_type type, si    
119                                                   
120 /**                                               
121  * execmem_free - free executable memory          
122  * @ptr: pointer to the memory that should be     
123  */                                               
124 void execmem_free(void *ptr);                     
125                                                   
126 #if defined(CONFIG_EXECMEM) && !defined(CONFIG    
127 void execmem_init(void);                          
128 #else                                             
129 static inline void execmem_init(void) {}          
130 #endif                                            
131                                                   
132 #endif /* _LINUX_EXECMEM_ALLOC_H */               
133                                                   

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php