/kernel/linux/linux-5.10/arch/powerpc/include/asm/ |
H A D | pkeys.h | 33 static inline u64 pkey_to_vmflag_bits(u16 pkey) in pkey_to_vmflag_bits() argument 35 return (((u64)pkey << VM_PKEY_SHIFT) & ARCH_VM_PKEY_FLAGS); in pkey_to_vmflag_bits() 50 #define pkey_alloc_mask(pkey) (0x1 << pkey) 54 #define __mm_pkey_allocated(mm, pkey) { \ 55 mm_pkey_allocation_map(mm) |= pkey_alloc_mask(pkey); \ 58 #define __mm_pkey_free(mm, pkey) { \ 59 mm_pkey_allocation_map(mm) &= ~pkey_alloc_mask(pkey); \ 62 #define __mm_pkey_is_allocated(mm, pkey) \ 63 (mm_pkey_allocation_map(mm) & pkey_alloc_mask(pkey)) 68 mm_pkey_is_allocated(struct mm_struct *mm, int pkey) mm_pkey_is_allocated() argument 110 mm_pkey_free(struct mm_struct *mm, int pkey) mm_pkey_free() argument 130 arch_override_mprotect_pkey(struct vm_area_struct *vma, int prot, int pkey) arch_override_mprotect_pkey() argument 148 arch_set_user_pkey_access(struct task_struct *tsk, int pkey, unsigned long init_val) arch_set_user_pkey_access() argument [all...] |
/kernel/linux/linux-6.6/arch/powerpc/include/asm/ |
H A D | pkeys.h | 33 static inline u64 pkey_to_vmflag_bits(u16 pkey) in pkey_to_vmflag_bits() argument 35 return (((u64)pkey << VM_PKEY_SHIFT) & ARCH_VM_PKEY_FLAGS); in pkey_to_vmflag_bits() 50 #define pkey_alloc_mask(pkey) (0x1 << pkey) 54 #define __mm_pkey_allocated(mm, pkey) { \ 55 mm_pkey_allocation_map(mm) |= pkey_alloc_mask(pkey); \ 58 #define __mm_pkey_free(mm, pkey) { \ 59 mm_pkey_allocation_map(mm) &= ~pkey_alloc_mask(pkey); \ 62 #define __mm_pkey_is_allocated(mm, pkey) \ 63 (mm_pkey_allocation_map(mm) & pkey_alloc_mask(pkey)) 68 mm_pkey_is_allocated(struct mm_struct *mm, int pkey) mm_pkey_is_allocated() argument 110 mm_pkey_free(struct mm_struct *mm, int pkey) mm_pkey_free() argument 130 arch_override_mprotect_pkey(struct vm_area_struct *vma, int prot, int pkey) arch_override_mprotect_pkey() argument 148 arch_set_user_pkey_access(struct task_struct *tsk, int pkey, unsigned long init_val) arch_set_user_pkey_access() argument [all...] |
/kernel/linux/linux-6.6/crypto/asymmetric_keys/ |
H A D | public_key.c | 67 software_key_determine_akcipher(const struct public_key *pkey, in software_key_determine_akcipher() argument 79 if (strcmp(pkey->pkey_algo, "rsa") == 0) { in software_key_determine_akcipher() 89 pkey->pkey_algo); in software_key_determine_akcipher() 93 pkey->pkey_algo, hash_algo); in software_key_determine_akcipher() 106 } else if (strncmp(pkey->pkey_algo, "ecdsa", 5) == 0) { in software_key_determine_akcipher() 124 } else if (strcmp(pkey->pkey_algo, "sm2") == 0) { in software_key_determine_akcipher() 131 } else if (strcmp(pkey->pkey_algo, "ecrdsa") == 0) { in software_key_determine_akcipher() 143 if (strscpy(alg_name, pkey->pkey_algo, CRYPTO_MAX_ALG_NAME) < 0) in software_key_determine_akcipher() 161 struct public_key *pkey = params->key->payload.data[asym_crypto]; in software_key_query() local 168 ret = software_key_determine_akcipher(pkey, param in software_key_query() 276 const struct public_key *pkey = params->key->payload.data[asym_crypto]; software_key_eds_op() local 379 public_key_verify_signature(const struct public_key *pkey, const struct public_key_signature *sig) public_key_verify_signature() argument [all...] |
/kernel/linux/linux-6.6/tools/testing/selftests/mm/ |
H A D | protection_keys.c | 7 * * how to set/clear bits in pkey registers (the rights register) 8 * * how to handle SEGV_PKUERR signals and extract pkey-relevant 17 * look for pkey "leaks" where it is still set on a VMA but "freed" back to the kernel 18 * do a plain mprotect() to a mprotect_pkey() area and make sure the pkey sticks 49 #include "pkey-helpers.h" 178 static u32 hw_pkey_get(int pkey, unsigned long flags) in hw_pkey_get() argument 182 dprintf1("%s(pkey=%d, flags=%lx) = %x / %d\n", in hw_pkey_get() 183 __func__, pkey, flags, 0, 0); in hw_pkey_get() 186 return (u32) get_pkey_bits(pkey_reg, pkey); in hw_pkey_get() 189 static int hw_pkey_set(int pkey, unsigne argument 210 pkey_disable_set(int pkey, int flags) pkey_disable_set() argument 251 pkey_disable_clear(int pkey, int flags) pkey_disable_clear() argument 280 pkey_write_allow(int pkey) pkey_write_allow() argument 284 pkey_write_deny(int pkey) pkey_write_deny() argument 288 pkey_access_allow(int pkey) pkey_access_allow() argument 292 pkey_access_deny(int pkey) pkey_access_deny() argument 461 sys_mprotect_pkey(void *ptr, size_t size, unsigned long orig_prot, unsigned long pkey) sys_mprotect_pkey() argument 535 sys_pkey_free(unsigned long pkey) sys_pkey_free() argument 587 mprotect_pkey(void *ptr, size_t size, unsigned long orig_prot, unsigned long pkey) mprotect_pkey() argument 696 malloc_pkey_with_mprotect(long size, int prot, u16 pkey) malloc_pkey_with_mprotect() argument 716 malloc_pkey_anon_huge(long size, int prot, u16 pkey) malloc_pkey_anon_huge() argument 797 malloc_pkey_hugetlb(long size, int prot, u16 pkey) malloc_pkey_hugetlb() argument 818 malloc_pkey_mmap_dax(long size, int prot, u16 pkey) malloc_pkey_mmap_dax() argument 853 malloc_pkey(long size, int prot, u16 pkey) malloc_pkey() argument 885 expected_pkey_fault(int pkey) expected_pkey_fault() argument 963 test_pkey_alloc_free_attach_pkey0(int *ptr, u16 pkey) test_pkey_alloc_free_attach_pkey0() argument 1015 test_read_of_write_disabled_region(int *ptr, u16 pkey) test_read_of_write_disabled_region() argument 1025 test_read_of_access_disabled_region(int *ptr, u16 pkey) test_read_of_access_disabled_region() argument 1037 test_read_of_access_disabled_region_with_page_already_mapped(int *ptr, u16 pkey) test_read_of_access_disabled_region_with_page_already_mapped() argument 1054 test_write_of_write_disabled_region_with_page_already_mapped(int *ptr, u16 pkey) test_write_of_write_disabled_region_with_page_already_mapped() argument 1065 test_write_of_write_disabled_region(int *ptr, u16 pkey) test_write_of_write_disabled_region() argument 1072 test_write_of_access_disabled_region(int *ptr, u16 pkey) test_write_of_access_disabled_region() argument 1080 test_write_of_access_disabled_region_with_page_already_mapped(int *ptr, u16 pkey) test_write_of_access_disabled_region_with_page_already_mapped() argument 1091 test_kernel_write_of_access_disabled_region(int *ptr, u16 pkey) test_kernel_write_of_access_disabled_region() argument 1103 test_kernel_write_of_write_disabled_region(int *ptr, u16 pkey) test_kernel_write_of_write_disabled_region() argument 1116 test_kernel_gup_of_access_disabled_region(int *ptr, u16 pkey) test_kernel_gup_of_access_disabled_region() argument 1138 test_kernel_gup_write_to_write_disabled_region(int *ptr, u16 pkey) test_kernel_gup_write_to_write_disabled_region() argument 1156 test_pkey_syscalls_on_non_allocated_pkey(int *ptr, u16 pkey) test_pkey_syscalls_on_non_allocated_pkey() argument 1179 test_pkey_syscalls_bad_args(int *ptr, u16 pkey) test_pkey_syscalls_bad_args() argument 1205 test_pkey_alloc_exhaust(int *ptr, u16 pkey) test_pkey_alloc_exhaust() argument 1311 test_pkey_init_state(int *ptr, u16 pkey) test_pkey_init_state() argument 1349 test_mprotect_with_pkey_0(int *ptr, u16 pkey) test_mprotect_with_pkey_0() argument 1373 test_ptrace_of_child(int *ptr, u16 pkey) test_ptrace_of_child() argument 1470 test_executing_on_unreadable_memory(int *ptr, u16 pkey) test_executing_on_unreadable_memory() argument 1497 test_implicit_mprotect_exec_only_memory(int *ptr, u16 pkey) test_implicit_mprotect_exec_only_memory() argument 1546 test_ptrace_modifies_pkru(int *ptr, u16 pkey) test_ptrace_modifies_pkru() argument 1668 test_mprotect_pkey_on_unsupported_cpu(int *ptr, u16 pkey) test_mprotect_pkey_on_unsupported_cpu() argument 1714 int pkey; run_tests_once() local [all...] |
H A D | pkey-powerpc.h | 23 #define NR_RESERVED_PKEYS_4K 27 /* pkey-0, pkey-1, exec-only-pkey 26 #define NR_RESERVED_PKEYS_64K_3KEYS 3 /* PowerNV and KVM: pkey-0, 27 pkey-1 and exec-only key */ 28 #define NR_RESERVED_PKEYS_64K_4KEYS 4 /* PowerVM: pkey-0, pkey-1, 29 pkey-31 and exec-only key */ 34 static inline u32 pkey_bit_position(int pkey) in pkey_bit_position() argument 36 return (NR_PKEYS - pkey in pkey_bit_position() 91 expect_fault_on_read_execonly_key(void *p1, int pkey) expect_fault_on_read_execonly_key() argument 105 malloc_pkey_with_mprotect_subpage(long size, int prot, u16 pkey) malloc_pkey_with_mprotect_subpage() argument [all...] |
/kernel/linux/linux-5.10/security/selinux/ |
H A D | ibpkey.c | 48 * sel_ib_pkey_hashfn - Hashing function for the pkey table 49 * @pkey: pkey number 52 * This is the hashing function for the pkey table, it returns the bucket 53 * number for the given pkey. 56 static unsigned int sel_ib_pkey_hashfn(u16 pkey) in sel_ib_pkey_hashfn() argument 58 return (pkey & (SEL_PKEY_HASH_SIZE - 1)); in sel_ib_pkey_hashfn() 62 * sel_ib_pkey_find - Search for a pkey record 67 * Search the pkey table and return the matching record. If an entry 74 struct sel_ib_pkey *pkey; in sel_ib_pkey_find() local 94 sel_ib_pkey_insert(struct sel_ib_pkey *pkey) sel_ib_pkey_insert() argument 133 struct sel_ib_pkey *pkey; sel_ib_pkey_sid_slow() local 184 struct sel_ib_pkey *pkey; sel_ib_pkey_sid() local 208 struct sel_ib_pkey *pkey, *pkey_tmp; sel_ib_pkey_flush() local [all...] |
/kernel/linux/linux-6.6/security/selinux/ |
H A D | ibpkey.c | 47 * sel_ib_pkey_hashfn - Hashing function for the pkey table 48 * @pkey: pkey number 51 * This is the hashing function for the pkey table, it returns the bucket 52 * number for the given pkey. 55 static unsigned int sel_ib_pkey_hashfn(u16 pkey) in sel_ib_pkey_hashfn() argument 57 return (pkey & (SEL_PKEY_HASH_SIZE - 1)); in sel_ib_pkey_hashfn() 61 * sel_ib_pkey_find - Search for a pkey record 66 * Search the pkey table and return the matching record. If an entry 73 struct sel_ib_pkey *pkey; in sel_ib_pkey_find() local 93 sel_ib_pkey_insert(struct sel_ib_pkey *pkey) sel_ib_pkey_insert() argument 132 struct sel_ib_pkey *pkey; sel_ib_pkey_sid_slow() local 183 struct sel_ib_pkey *pkey; sel_ib_pkey_sid() local 207 struct sel_ib_pkey *pkey, *pkey_tmp; sel_ib_pkey_flush() local [all...] |
/kernel/linux/linux-5.10/tools/testing/selftests/vm/ |
H A D | protection_keys.c | 7 * * how to set/clear bits in pkey registers (the rights register) 8 * * how to handle SEGV_PKUERR signals and extract pkey-relevant 17 * look for pkey "leaks" where it is still set on a VMA but "freed" back to the kernel 18 * do a plain mprotect() to a mprotect_pkey() area and make sure the pkey sticks 48 #include "pkey-helpers.h" 177 static u32 hw_pkey_get(int pkey, unsigned long flags) in hw_pkey_get() argument 181 dprintf1("%s(pkey=%d, flags=%lx) = %x / %d\n", in hw_pkey_get() 182 __func__, pkey, flags, 0, 0); in hw_pkey_get() 185 return (u32) get_pkey_bits(pkey_reg, pkey); in hw_pkey_get() 188 static int hw_pkey_set(int pkey, unsigne argument 209 pkey_disable_set(int pkey, int flags) pkey_disable_set() argument 250 pkey_disable_clear(int pkey, int flags) pkey_disable_clear() argument 279 pkey_write_allow(int pkey) pkey_write_allow() argument 283 pkey_write_deny(int pkey) pkey_write_deny() argument 287 pkey_access_allow(int pkey) pkey_access_allow() argument 291 pkey_access_deny(int pkey) pkey_access_deny() argument 469 sys_mprotect_pkey(void *ptr, size_t size, unsigned long orig_prot, unsigned long pkey) sys_mprotect_pkey() argument 543 sys_pkey_free(unsigned long pkey) sys_pkey_free() argument 595 mprotect_pkey(void *ptr, size_t size, unsigned long orig_prot, unsigned long pkey) mprotect_pkey() argument 704 malloc_pkey_with_mprotect(long size, int prot, u16 pkey) malloc_pkey_with_mprotect() argument 724 malloc_pkey_anon_huge(long size, int prot, u16 pkey) malloc_pkey_anon_huge() argument 805 malloc_pkey_hugetlb(long size, int prot, u16 pkey) malloc_pkey_hugetlb() argument 826 malloc_pkey_mmap_dax(long size, int prot, u16 pkey) malloc_pkey_mmap_dax() argument 861 malloc_pkey(long size, int prot, u16 pkey) malloc_pkey() argument 893 expected_pkey_fault(int pkey) expected_pkey_fault() argument 971 test_pkey_alloc_free_attach_pkey0(int *ptr, u16 pkey) test_pkey_alloc_free_attach_pkey0() argument 1023 test_read_of_write_disabled_region(int *ptr, u16 pkey) test_read_of_write_disabled_region() argument 1033 test_read_of_access_disabled_region(int *ptr, u16 pkey) test_read_of_access_disabled_region() argument 1045 test_read_of_access_disabled_region_with_page_already_mapped(int *ptr, u16 pkey) test_read_of_access_disabled_region_with_page_already_mapped() argument 1062 test_write_of_write_disabled_region_with_page_already_mapped(int *ptr, u16 pkey) test_write_of_write_disabled_region_with_page_already_mapped() argument 1073 test_write_of_write_disabled_region(int *ptr, u16 pkey) test_write_of_write_disabled_region() argument 1080 test_write_of_access_disabled_region(int *ptr, u16 pkey) test_write_of_access_disabled_region() argument 1088 test_write_of_access_disabled_region_with_page_already_mapped(int *ptr, u16 pkey) test_write_of_access_disabled_region_with_page_already_mapped() argument 1099 test_kernel_write_of_access_disabled_region(int *ptr, u16 pkey) test_kernel_write_of_access_disabled_region() argument 1111 test_kernel_write_of_write_disabled_region(int *ptr, u16 pkey) test_kernel_write_of_write_disabled_region() argument 1124 test_kernel_gup_of_access_disabled_region(int *ptr, u16 pkey) test_kernel_gup_of_access_disabled_region() argument 1146 test_kernel_gup_write_to_write_disabled_region(int *ptr, u16 pkey) test_kernel_gup_write_to_write_disabled_region() argument 1164 test_pkey_syscalls_on_non_allocated_pkey(int *ptr, u16 pkey) test_pkey_syscalls_on_non_allocated_pkey() argument 1187 test_pkey_syscalls_bad_args(int *ptr, u16 pkey) test_pkey_syscalls_bad_args() argument 1213 test_pkey_alloc_exhaust(int *ptr, u16 pkey) test_pkey_alloc_exhaust() argument 1285 test_mprotect_with_pkey_0(int *ptr, u16 pkey) test_mprotect_with_pkey_0() argument 1309 test_ptrace_of_child(int *ptr, u16 pkey) test_ptrace_of_child() argument 1406 test_executing_on_unreadable_memory(int *ptr, u16 pkey) test_executing_on_unreadable_memory() argument 1433 test_implicit_mprotect_exec_only_memory(int *ptr, u16 pkey) test_implicit_mprotect_exec_only_memory() argument 1481 test_mprotect_pkey_on_unsupported_cpu(int *ptr, u16 pkey) test_mprotect_pkey_on_unsupported_cpu() argument 1523 int pkey; run_tests_once() local [all...] |
H A D | pkey-powerpc.h | 26 #define NR_RESERVED_PKEYS_4K 27 /* pkey-0, pkey-1, exec-only-pkey 29 #define NR_RESERVED_PKEYS_64K_3KEYS 3 /* PowerNV and KVM: pkey-0, 30 pkey-1 and exec-only key */ 31 #define NR_RESERVED_PKEYS_64K_4KEYS 4 /* PowerVM: pkey-0, pkey-1, 32 pkey-31 and exec-only key */ 37 static inline u32 pkey_bit_position(int pkey) in pkey_bit_position() argument 39 return (NR_PKEYS - pkey in pkey_bit_position() 94 expect_fault_on_read_execonly_key(void *p1, int pkey) expect_fault_on_read_execonly_key() argument 108 malloc_pkey_with_mprotect_subpage(long size, int prot, u16 pkey) malloc_pkey_with_mprotect_subpage() argument [all...] |
H A D | pkey-helpers.h | 81 void expected_pkey_fault(int pkey); 83 int sys_pkey_free(unsigned long pkey); 85 unsigned long pkey); 89 #include "pkey-x86.h" 91 #include "pkey-powerpc.h" 98 static inline u64 set_pkey_bits(u64 reg, int pkey, u64 flags) in set_pkey_bits() argument 100 u32 shift = pkey_bit_position(pkey); in set_pkey_bits() 101 /* mask out bits from pkey in old value */ in set_pkey_bits() 103 /* OR in new bits for pkey */ in set_pkey_bits() 108 static inline u64 get_pkey_bits(u64 reg, int pkey) in get_pkey_bits() argument 150 __pkey_access_allow(int pkey, int do_allow) __pkey_access_allow() argument 164 __pkey_write_allow(int pkey, int do_allow_write) __pkey_write_allow() argument [all...] |
/kernel/linux/linux-5.10/arch/x86/include/asm/ |
H A D | pkeys.h | 14 extern int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, 36 int prot, int pkey); 38 int prot, int pkey) in arch_override_mprotect_pkey() 43 return __arch_override_mprotect_pkey(vma, prot, pkey); in arch_override_mprotect_pkey() 46 extern int __arch_set_user_pkey_access(struct task_struct *tsk, int pkey, 52 #define mm_set_pkey_allocated(mm, pkey) do { \ 53 mm_pkey_allocation_map(mm) |= (1U << pkey); \ 55 #define mm_set_pkey_free(mm, pkey) do { \ 56 mm_pkey_allocation_map(mm) &= ~(1U << pkey); \ 60 bool mm_pkey_is_allocated(struct mm_struct *mm, int pkey) in mm_pkey_is_allocated() argument 37 arch_override_mprotect_pkey(struct vm_area_struct *vma, int prot, int pkey) arch_override_mprotect_pkey() argument 113 mm_pkey_free(struct mm_struct *mm, int pkey) mm_pkey_free() argument [all...] |
/kernel/linux/linux-5.10/crypto/asymmetric_keys/ |
H A D | public_key.c | 68 software_key_determine_akcipher(const struct public_key *pkey, in software_key_determine_akcipher() argument 77 if (strcmp(pkey->pkey_algo, "rsa") == 0) { in software_key_determine_akcipher() 85 pkey->pkey_algo); in software_key_determine_akcipher() 89 pkey->pkey_algo, hash_algo); in software_key_determine_akcipher() 100 } else if (strncmp(pkey->pkey_algo, "ecdsa", 5) == 0) { in software_key_determine_akcipher() 118 } else if (strcmp(pkey->pkey_algo, "sm2") == 0) { in software_key_determine_akcipher() 125 } else if (strcmp(pkey->pkey_algo, "ecrdsa") == 0) { in software_key_determine_akcipher() 137 if (strscpy(alg_name, pkey->pkey_algo, CRYPTO_MAX_ALG_NAME) < 0) in software_key_determine_akcipher() 155 struct public_key *pkey = params->key->payload.data[asym_crypto]; in software_key_query() local 160 ret = software_key_determine_akcipher(pkey, param in software_key_query() 214 const struct public_key *pkey = params->key->payload.data[asym_crypto]; software_key_eds_op() local 357 public_key_verify_signature(const struct public_key *pkey, const struct public_key_signature *sig) public_key_verify_signature() argument [all...] |
/kernel/linux/linux-6.6/arch/x86/include/asm/ |
H A D | pkeys.h | 12 extern int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, 34 int prot, int pkey); 36 int prot, int pkey) in arch_override_mprotect_pkey() 41 return __arch_override_mprotect_pkey(vma, prot, pkey); in arch_override_mprotect_pkey() 47 #define mm_set_pkey_allocated(mm, pkey) do { \ 48 mm_pkey_allocation_map(mm) |= (1U << pkey); \ 50 #define mm_set_pkey_free(mm, pkey) do { \ 51 mm_pkey_allocation_map(mm) &= ~(1U << pkey); \ 55 bool mm_pkey_is_allocated(struct mm_struct *mm, int pkey) in mm_pkey_is_allocated() argument 59 * from pkey_alloc() or pkey in mm_pkey_is_allocated() 35 arch_override_mprotect_pkey(struct vm_area_struct *vma, int prot, int pkey) arch_override_mprotect_pkey() argument 108 mm_pkey_free(struct mm_struct *mm, int pkey) mm_pkey_free() argument [all...] |
/kernel/linux/linux-5.10/drivers/infiniband/core/ |
H A D | security.c | 48 struct pkey_index_qp_list *pkey = NULL; in get_pkey_idx_qp_list() local 56 pkey = tmp_pkey; in get_pkey_idx_qp_list() 61 return pkey; in get_pkey_idx_qp_list() 65 u16 *pkey, in get_pkey_and_subnet_prefix() 71 ret = ib_get_cached_pkey(dev, pp->port_num, pp->pkey_index, pkey); in get_pkey_and_subnet_prefix() 80 static int enforce_qp_pkey_security(u16 pkey, in enforce_qp_pkey_security() argument 87 ret = security_ib_pkey_access(qp_sec->security, subnet_prefix, pkey); in enforce_qp_pkey_security() 96 pkey); in enforce_qp_pkey_security() 115 u16 pkey; in check_qp_port_pkey_settings() local 123 &pkey, in check_qp_port_pkey_settings() 64 get_pkey_and_subnet_prefix(struct ib_port_pkey *pp, u16 *pkey, u64 *subnet_prefix) get_pkey_and_subnet_prefix() argument 194 check_pkey_qps(struct pkey_index_qp_list *pkey, struct ib_device *device, u8 port_num, u64 subnet_prefix) check_pkey_qps() argument 246 struct pkey_index_qp_list *pkey; port_pkey_list_insert() local 304 struct pkey_index_qp_list *pkey; port_pkey_list_remove() local 544 struct pkey_index_qp_list *pkey; ib_security_cache_change() local 557 struct pkey_index_qp_list *pkey, *tmp_pkey; ib_security_release_port_pkey_list() local 657 u16 pkey; ib_security_pkey_access() local [all...] |
/kernel/linux/linux-6.6/drivers/infiniband/core/ |
H A D | security.c | 48 struct pkey_index_qp_list *pkey = NULL; in get_pkey_idx_qp_list() local 56 pkey = tmp_pkey; in get_pkey_idx_qp_list() 61 return pkey; in get_pkey_idx_qp_list() 65 u16 *pkey, in get_pkey_and_subnet_prefix() 71 ret = ib_get_cached_pkey(dev, pp->port_num, pp->pkey_index, pkey); in get_pkey_and_subnet_prefix() 80 static int enforce_qp_pkey_security(u16 pkey, in enforce_qp_pkey_security() argument 87 ret = security_ib_pkey_access(qp_sec->security, subnet_prefix, pkey); in enforce_qp_pkey_security() 96 pkey); in enforce_qp_pkey_security() 115 u16 pkey; in check_qp_port_pkey_settings() local 123 &pkey, in check_qp_port_pkey_settings() 64 get_pkey_and_subnet_prefix(struct ib_port_pkey *pp, u16 *pkey, u64 *subnet_prefix) get_pkey_and_subnet_prefix() argument 194 check_pkey_qps(struct pkey_index_qp_list *pkey, struct ib_device *device, u32 port_num, u64 subnet_prefix) check_pkey_qps() argument 246 struct pkey_index_qp_list *pkey; port_pkey_list_insert() local 304 struct pkey_index_qp_list *pkey; port_pkey_list_remove() local 544 struct pkey_index_qp_list *pkey; ib_security_cache_change() local 557 struct pkey_index_qp_list *pkey, *tmp_pkey; ib_security_release_port_pkey_list() local 657 u16 pkey; ib_security_pkey_access() local [all...] |
/kernel/linux/linux-5.10/tools/testing/selftests/powerpc/mm/ |
H A D | pkey_exec_prot.c | 69 sigsafe_err("got a fault for an unexpected pkey\n"); in segv_handler() 79 * Reassociate the exec-only pkey with the region in segv_handler() 106 int pkey, ret, i; in test() local 153 /* Allocate a pkey that restricts execution */ in test() 155 pkey = sys_pkey_alloc(0, rights); in test() 156 FAIL_IF(pkey < 0); in test() 170 * are not set i.e. the pkey permits both read and write in test() 174 * implies PROT_READ on GNU systems. The pkey currently in test() 179 FAIL_IF(sys_pkey_mprotect(insns, pgsize, PROT_EXEC, pkey) != 0); in test() 180 printf("read from %p, pkey permission in test() [all...] |
/kernel/linux/linux-6.6/tools/testing/selftests/powerpc/mm/ |
H A D | pkey_exec_prot.c | 69 sigsafe_err("got a fault for an unexpected pkey\n"); in segv_handler() 79 * Reassociate the exec-only pkey with the region in segv_handler() 106 int pkey, ret, i; in test() local 153 /* Allocate a pkey that restricts execution */ in test() 155 pkey = sys_pkey_alloc(0, rights); in test() 156 FAIL_IF(pkey < 0); in test() 170 * are not set i.e. the pkey permits both read and write in test() 174 * implies PROT_READ on GNU systems. The pkey currently in test() 179 FAIL_IF(sys_pkey_mprotect(insns, pgsize, PROT_EXEC, pkey) != 0); in test() 180 printf("read from %p, pkey permission in test() [all...] |
/kernel/linux/linux-5.10/drivers/infiniband/ulp/ipoib/ |
H A D | ipoib_vlan.c | 61 * Since the legacy sysfs interface uses pkey for deletion it cannot in is_child_unique() 62 * support more than one interface with the same pkey, it creates in is_child_unique() 74 if (ppriv->pkey == priv->pkey) in is_child_unique() 78 if (tpriv->pkey == priv->pkey && in is_child_unique() 96 u16 pkey, int type) in __ipoib_vlan_add() 116 if (pkey == 0 || pkey == 0x8000) { in __ipoib_vlan_add() 124 priv->pkey in __ipoib_vlan_add() 95 __ipoib_vlan_add(struct ipoib_dev_priv *ppriv, struct ipoib_dev_priv *priv, u16 pkey, int type) __ipoib_vlan_add() argument 168 ipoib_vlan_add(struct net_device *pdev, unsigned short pkey) ipoib_vlan_add() argument 248 ipoib_vlan_delete(struct net_device *pdev, unsigned short pkey) ipoib_vlan_delete() argument [all...] |
/kernel/linux/linux-6.6/drivers/infiniband/ulp/ipoib/ |
H A D | ipoib_vlan.c | 60 * Since the legacy sysfs interface uses pkey for deletion it cannot in is_child_unique() 61 * support more than one interface with the same pkey, it creates in is_child_unique() 73 if (ppriv->pkey == priv->pkey) in is_child_unique() 77 if (tpriv->pkey == priv->pkey && in is_child_unique() 95 u16 pkey, int type) in __ipoib_vlan_add() 115 if (pkey == 0 || pkey == 0x8000) { in __ipoib_vlan_add() 123 priv->pkey in __ipoib_vlan_add() 94 __ipoib_vlan_add(struct ipoib_dev_priv *ppriv, struct ipoib_dev_priv *priv, u16 pkey, int type) __ipoib_vlan_add() argument 167 ipoib_vlan_add(struct net_device *pdev, unsigned short pkey) ipoib_vlan_add() argument 247 ipoib_vlan_delete(struct net_device *pdev, unsigned short pkey) ipoib_vlan_delete() argument [all...] |
/kernel/linux/linux-5.10/tools/testing/selftests/powerpc/include/ |
H A D | pkeys.h | 52 void pkey_set_rights(int pkey, unsigned long rights) in pkey_set_rights() argument 56 shift = (NR_PKEYS - pkey - 1) * PKEY_BITS_PER_PKEY; in pkey_set_rights() 63 int sys_pkey_mprotect(void *addr, size_t len, int prot, int pkey) in sys_pkey_mprotect() argument 65 return syscall(__NR_pkey_mprotect, addr, len, prot, pkey); in sys_pkey_mprotect() 73 int sys_pkey_free(int pkey) in sys_pkey_free() argument 75 return syscall(__NR_pkey_free, pkey); in sys_pkey_free() 81 int pkey; in pkeys_unsupported() local 88 pkey = sys_pkey_alloc(0, 0); in pkeys_unsupported() 89 SKIP_IF(pkey < 0); in pkeys_unsupported() 90 sys_pkey_free(pkey); in pkeys_unsupported() [all...] |
/kernel/linux/linux-6.6/tools/testing/selftests/powerpc/include/ |
H A D | pkeys.h | 52 void pkey_set_rights(int pkey, unsigned long rights) in pkey_set_rights() argument 56 shift = (NR_PKEYS - pkey - 1) * PKEY_BITS_PER_PKEY; in pkey_set_rights() 63 int sys_pkey_mprotect(void *addr, size_t len, int prot, int pkey) in sys_pkey_mprotect() argument 65 return syscall(__NR_pkey_mprotect, addr, len, prot, pkey); in sys_pkey_mprotect() 73 int sys_pkey_free(int pkey) in sys_pkey_free() argument 75 return syscall(__NR_pkey_free, pkey); in sys_pkey_free() 81 int pkey; in pkeys_unsupported() local 88 pkey = sys_pkey_alloc(0, 0); in pkeys_unsupported() 89 SKIP_IF(pkey < 0); in pkeys_unsupported() 90 sys_pkey_free(pkey); in pkeys_unsupported() [all...] |
/kernel/linux/common_modules/newip/third_party/linux-5.10/include/net/ |
H A D | nndisc.h | 28 static inline bool neigh_key_eq800(const struct neighbour *n, const void *pkey) in neigh_key_eq800() argument 32 a1 = (struct nip_addr *)(pkey); in neigh_key_eq800() 40 static inline u32 nndisc_hashfn(const void *pkey, const struct net_device *dev, in nndisc_hashfn() argument 43 return (*(int *)pkey % NEWIP_NEIGH_BUCKET_MAX); in nndisc_hashfn() 47 const void *pkey) in __nip_neigh_lookup_noref() 50 pkey, dev); in __nip_neigh_lookup_noref() 54 const void *pkey) in __nip_neigh_lookup() 59 n = __nip_neigh_lookup_noref(dev, pkey); in __nip_neigh_lookup() 46 __nip_neigh_lookup_noref(struct net_device *dev, const void *pkey) __nip_neigh_lookup_noref() argument 53 __nip_neigh_lookup(struct net_device *dev, const void *pkey) __nip_neigh_lookup() argument
|
/kernel/linux/linux-5.10/arch/powerpc/mm/book3s64/ |
H A D | pkeys.c | 44 #define pkeyshift(pkey) (PKEY_REG_BITS - ((pkey+1) * AMR_BITS_PER_PKEY)) 114 * pkey_to_vmflag_bits() assumes that the pkey bits are contiguous in pkey_early_init_devtree() 127 /* scan the device tree for pkey feature */ in pkey_early_init_devtree() 260 static inline void init_amr(int pkey, u8 init_bits) in init_amr() argument 262 u64 new_amr_bits = (((u64)init_bits & 0x3UL) << pkeyshift(pkey)); in init_amr() 263 u64 old_amr = read_amr() & ~((u64)(0x3ul) << pkeyshift(pkey)); in init_amr() 268 static inline void init_iamr(int pkey, u8 init_bits) in init_iamr() argument 270 u64 new_iamr_bits = (((u64)init_bits & 0x1UL) << pkeyshift(pkey)); in init_iamr() 271 u64 old_iamr = read_iamr() & ~((u64)(0x1ul) << pkeyshift(pkey)); in init_iamr() 280 __arch_set_user_pkey_access(struct task_struct *tsk, int pkey, unsigned long init_val) __arch_set_user_pkey_access() argument 369 __arch_override_mprotect_pkey(struct vm_area_struct *vma, int prot, int pkey) __arch_override_mprotect_pkey() argument 393 pkey_access_permitted(int pkey, bool write, bool execute) pkey_access_permitted() argument [all...] |
/kernel/linux/linux-6.6/arch/powerpc/mm/book3s64/ |
H A D | pkeys.c | 49 #define pkeyshift(pkey) (PKEY_REG_BITS - ((pkey+1) * AMR_BITS_PER_PKEY)) 122 * pkey_to_vmflag_bits() assumes that the pkey bits are contiguous in pkey_early_init_devtree() 135 /* scan the device tree for pkey feature */ in pkey_early_init_devtree() 314 static inline void init_amr(int pkey, u8 init_bits) in init_amr() argument 316 u64 new_amr_bits = (((u64)init_bits & 0x3UL) << pkeyshift(pkey)); in init_amr() 317 u64 old_amr = current_thread_amr() & ~((u64)(0x3ul) << pkeyshift(pkey)); in init_amr() 322 static inline void init_iamr(int pkey, u8 init_bits) in init_iamr() argument 324 u64 new_iamr_bits = (((u64)init_bits & 0x1UL) << pkeyshift(pkey)); in init_iamr() 325 u64 old_iamr = current_thread_iamr() & ~((u64)(0x1ul) << pkeyshift(pkey)); in init_iamr() 337 __arch_set_user_pkey_access(struct task_struct *tsk, int pkey, unsigned long init_val) __arch_set_user_pkey_access() argument 390 __arch_override_mprotect_pkey(struct vm_area_struct *vma, int prot, int pkey) __arch_override_mprotect_pkey() argument 414 pkey_access_permitted(int pkey, bool write, bool execute) pkey_access_permitted() argument [all...] |
/kernel/linux/linux-5.10/include/net/ |
H A D | neighbour.h | 199 __u32 (*hash)(const void *pkey, 202 bool (*key_eq)(const struct neighbour *, const void *pkey); 207 int (*is_multicast)(const void *pkey); 266 static inline bool neigh_key_eq32(const struct neighbour *n, const void *pkey) in neigh_key_eq32() argument 268 return *(const u32 *)n->primary_key == *(const u32 *)pkey; in neigh_key_eq32() 271 static inline bool neigh_key_eq128(const struct neighbour *n, const void *pkey) in neigh_key_eq128() argument 274 const u32 *p32 = pkey; in neigh_key_eq128() 282 bool (*key_eq)(const struct neighbour *n, const void *pkey), in ___neigh_lookup_noref() 283 __u32 (*hash)(const void *pkey, in ___neigh_lookup_noref() 286 const void *pkey, in ___neigh_lookup_noref() 280 ___neigh_lookup_noref( struct neigh_table *tbl, bool (*key_eq)(const struct neighbour *n, const void *pkey), __u32 (*hash)(const void *pkey, const struct net_device *dev, __u32 *hash_rnd), const void *pkey, struct net_device *dev) ___neigh_lookup_noref() argument 304 __neigh_lookup_noref(struct neigh_table *tbl, const void *pkey, struct net_device *dev) __neigh_lookup_noref() argument 317 neigh_create(struct neigh_table *tbl, const void *pkey, struct net_device *dev) neigh_create() argument 516 __neigh_lookup(struct neigh_table *tbl, const void *pkey, struct net_device *dev, int creat) __neigh_lookup() argument 528 __neigh_lookup_errno(struct neigh_table *tbl, const void *pkey, struct net_device *dev) __neigh_lookup_errno() argument [all...] |