/Linux-v4.19/arch/powerpc/include/asm/ |
D | pkeys.h | 28 static inline u64 pkey_to_vmflag_bits(u16 pkey) in pkey_to_vmflag_bits() argument 30 return (((u64)pkey << VM_PKEY_SHIFT) & ARCH_VM_PKEY_FLAGS); in pkey_to_vmflag_bits() 72 #define pkey_alloc_mask(pkey) (0x1 << pkey) argument 76 #define __mm_pkey_allocated(mm, pkey) { \ argument 77 mm_pkey_allocation_map(mm) |= pkey_alloc_mask(pkey); \ 80 #define __mm_pkey_free(mm, pkey) { \ argument 81 mm_pkey_allocation_map(mm) &= ~pkey_alloc_mask(pkey); \ 84 #define __mm_pkey_is_allocated(mm, pkey) \ argument 85 (mm_pkey_allocation_map(mm) & pkey_alloc_mask(pkey)) 87 #define __mm_pkey_is_reserved(pkey) (reserved_allocation_mask & \ argument [all …]
|
D | mman.h | 24 unsigned long pkey) in arch_calc_vm_prot_bits() argument 27 return (((prot & PROT_SAO) ? VM_SAO : 0) | pkey_to_vmflag_bits(pkey)); in arch_calc_vm_prot_bits() 32 #define arch_calc_vm_prot_bits(prot, pkey) arch_calc_vm_prot_bits(prot, pkey) argument
|
/Linux-v4.19/tools/testing/selftests/x86/ |
D | protection_keys.c | 402 static u32 hw_pkey_get(int pkey, unsigned long flags) in hw_pkey_get() argument 410 __func__, pkey, flags, 0, 0); in hw_pkey_get() 413 shifted_pkru = (pkru >> (pkey * PKRU_BITS_PER_PKEY)); in hw_pkey_get() 424 static int hw_pkey_set(int pkey, unsigned long rights, unsigned long flags) in hw_pkey_set() argument 436 new_pkru &= ~(mask << (pkey * PKRU_BITS_PER_PKEY)); in hw_pkey_set() 438 new_pkru |= (rights << (pkey * PKRU_BITS_PER_PKEY)); in hw_pkey_set() 443 __func__, pkey, rights, flags, 0, __rdpkru(), old_pkru); in hw_pkey_set() 447 void pkey_disable_set(int pkey, int flags) in pkey_disable_set() argument 455 pkey, flags); in pkey_disable_set() 458 pkey_rights = hw_pkey_get(pkey, syscall_flags); in pkey_disable_set() [all …]
|
D | pkey-helpers.h | 109 static inline void __pkey_access_allow(int pkey, int do_allow) in __pkey_access_allow() argument 112 int bit = pkey * 2; in __pkey_access_allow() 123 static inline void __pkey_write_allow(int pkey, int do_allow_write) in __pkey_write_allow() argument 126 int bit = pkey * 2 + 1; in __pkey_write_allow()
|
/Linux-v4.19/security/selinux/ |
D | ibpkey.c | 66 static unsigned int sel_ib_pkey_hashfn(u16 pkey) in sel_ib_pkey_hashfn() argument 68 return (pkey & (SEL_PKEY_HASH_SIZE - 1)); in sel_ib_pkey_hashfn() 84 struct sel_ib_pkey *pkey; in sel_ib_pkey_find() local 87 list_for_each_entry_rcu(pkey, &sel_ib_pkey_hash[idx].list, list) { in sel_ib_pkey_find() 88 if (pkey->psec.pkey == pkey_num && in sel_ib_pkey_find() 89 pkey->psec.subnet_prefix == subnet_prefix) in sel_ib_pkey_find() 90 return pkey; in sel_ib_pkey_find() 104 static void sel_ib_pkey_insert(struct sel_ib_pkey *pkey) in sel_ib_pkey_insert() argument 111 idx = sel_ib_pkey_hashfn(pkey->psec.pkey); in sel_ib_pkey_insert() 112 list_add_rcu(&pkey->list, &sel_ib_pkey_hash[idx].list); in sel_ib_pkey_insert() [all …]
|
/Linux-v4.19/arch/x86/include/asm/ |
D | pkeys.h | 9 extern int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, 31 int prot, int pkey); 33 int prot, int pkey) in arch_override_mprotect_pkey() argument 38 return __arch_override_mprotect_pkey(vma, prot, pkey); in arch_override_mprotect_pkey() 41 extern int __arch_set_user_pkey_access(struct task_struct *tsk, int pkey, 47 #define mm_set_pkey_allocated(mm, pkey) do { \ argument 48 mm_pkey_allocation_map(mm) |= (1U << pkey); \ 50 #define mm_set_pkey_free(mm, pkey) do { \ argument 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 [all …]
|
/Linux-v4.19/drivers/infiniband/core/ |
D | security.c | 44 struct pkey_index_qp_list *pkey = NULL; in get_pkey_idx_qp_list() local 53 pkey = tmp_pkey; in get_pkey_idx_qp_list() 58 return pkey; in get_pkey_idx_qp_list() 62 u16 *pkey, in get_pkey_and_subnet_prefix() argument 68 ret = ib_get_cached_pkey(dev, pp->port_num, pp->pkey_index, pkey); in get_pkey_and_subnet_prefix() 77 static int enforce_qp_pkey_security(u16 pkey, in enforce_qp_pkey_security() argument 84 ret = security_ib_pkey_access(qp_sec->security, subnet_prefix, pkey); in enforce_qp_pkey_security() 93 pkey); in enforce_qp_pkey_security() 112 u16 pkey; in check_qp_port_pkey_settings() local 120 &pkey, in check_qp_port_pkey_settings() [all …]
|
/Linux-v4.19/arch/powerpc/mm/ |
D | pkeys.c | 29 #define pkeyshift(pkey) (PKEY_REG_BITS - ((pkey+1) * AMR_BITS_PER_PKEY)) argument 207 static bool is_pkey_enabled(int pkey) in is_pkey_enabled() argument 210 u64 pkey_bits = 0x3ul << pkeyshift(pkey); in is_pkey_enabled() 221 static inline void init_amr(int pkey, u8 init_bits) in init_amr() argument 223 u64 new_amr_bits = (((u64)init_bits & 0x3UL) << pkeyshift(pkey)); in init_amr() 224 u64 old_amr = read_amr() & ~((u64)(0x3ul) << pkeyshift(pkey)); in init_amr() 229 static inline void init_iamr(int pkey, u8 init_bits) in init_iamr() argument 231 u64 new_iamr_bits = (((u64)init_bits & 0x1UL) << pkeyshift(pkey)); in init_iamr() 232 u64 old_iamr = read_iamr() & ~((u64)(0x1ul) << pkeyshift(pkey)); in init_iamr() 241 int __arch_set_user_pkey_access(struct task_struct *tsk, int pkey, in __arch_set_user_pkey_access() argument [all …]
|
D | fault.c | 107 int pkey) in __bad_area_nosemaphore() argument 117 _exception_pkey(SIGSEGV, regs, si_code, address, pkey); in __bad_area_nosemaphore() 128 int pkey) in __bad_area() argument 138 return __bad_area_nosemaphore(regs, address, si_code, pkey); in __bad_area() 147 int pkey) in bad_key_fault_exception() argument 149 return __bad_area_nosemaphore(regs, address, SEGV_PKUERR, pkey); in bad_key_fault_exception() 551 int pkey = vma_pkey(vma); in __do_page_fault() local 554 return bad_key_fault_exception(regs, address, pkey); in __do_page_fault()
|
/Linux-v4.19/drivers/infiniband/ulp/ipoib/ |
D | ipoib_vlan.c | 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() argument 109 if (pkey == 0 || pkey == 0x8000) { in __ipoib_vlan_add() 115 priv->pkey = pkey; in __ipoib_vlan_add() 162 int ipoib_vlan_add(struct net_device *pdev, unsigned short pkey) in ipoib_vlan_add() argument 183 ppriv->dev->name, pkey); in ipoib_vlan_add() 192 result = __ipoib_vlan_add(ppriv, priv, pkey, IPOIB_LEGACY_CHILD); in ipoib_vlan_add() 240 int ipoib_vlan_delete(struct net_device *pdev, unsigned short pkey) in ipoib_vlan_delete() argument 260 if (priv->pkey == pkey && in ipoib_vlan_delete()
|
/Linux-v4.19/crypto/ |
D | rsa.c | 89 const struct rsa_mpi_key *pkey = rsa_get_key(tfm); in rsa_enc() local 97 if (unlikely(!pkey->n || !pkey->e)) { in rsa_enc() 107 ret = _rsa_enc(pkey, c, m); in rsa_enc() 128 const struct rsa_mpi_key *pkey = rsa_get_key(tfm); in rsa_dec() local 136 if (unlikely(!pkey->n || !pkey->d)) { in rsa_dec() 146 ret = _rsa_dec(pkey, m, c); in rsa_dec() 166 const struct rsa_mpi_key *pkey = rsa_get_key(tfm); in rsa_sign() local 174 if (unlikely(!pkey->n || !pkey->d)) { in rsa_sign() 184 ret = _rsa_sign(pkey, s, m); in rsa_sign() 205 const struct rsa_mpi_key *pkey = rsa_get_key(tfm); in rsa_verify() local [all …]
|
/Linux-v4.19/include/net/ |
D | neighbour.h | 197 __u32 (*hash)(const void *pkey, 200 bool (*key_eq)(const struct neighbour *, const void *pkey); 254 static inline bool neigh_key_eq16(const struct neighbour *n, const void *pkey) in neigh_key_eq16() argument 256 return *(const u16 *)n->primary_key == *(const u16 *)pkey; in neigh_key_eq16() 259 static inline bool neigh_key_eq32(const struct neighbour *n, const void *pkey) in neigh_key_eq32() argument 261 return *(const u32 *)n->primary_key == *(const u32 *)pkey; in neigh_key_eq32() 264 static inline bool neigh_key_eq128(const struct neighbour *n, const void *pkey) in neigh_key_eq128() argument 267 const u32 *p32 = pkey; in neigh_key_eq128() 275 bool (*key_eq)(const struct neighbour *n, const void *pkey), in ___neigh_lookup_noref() argument 276 __u32 (*hash)(const void *pkey, in ___neigh_lookup_noref() argument [all …]
|
D | ndisc.h | 367 static inline u32 ndisc_hashfn(const void *pkey, const struct net_device *dev, __u32 *hash_rnd) in ndisc_hashfn() argument 369 const u32 *p32 = pkey; in ndisc_hashfn() 377 static inline struct neighbour *__ipv6_neigh_lookup_noref(struct net_device *dev, const void *pkey) in __ipv6_neigh_lookup_noref() argument 379 return ___neigh_lookup_noref(&nd_tbl, neigh_key_eq128, ndisc_hashfn, pkey, dev); in __ipv6_neigh_lookup_noref() 382 static inline struct neighbour *__ipv6_neigh_lookup(struct net_device *dev, const void *pkey) in __ipv6_neigh_lookup() argument 387 n = __ipv6_neigh_lookup_noref(dev, pkey); in __ipv6_neigh_lookup() 396 const void *pkey) in __ipv6_confirm_neigh() argument 401 n = __ipv6_neigh_lookup_noref(dev, pkey); in __ipv6_confirm_neigh()
|
/Linux-v4.19/tools/testing/selftests/powerpc/ptrace/ |
D | Makefile | 4 ptrace-tm-spd-vsx ptrace-tm-spr ptrace-hwbreak ptrace-pkey core-pkey \ 14 ptrace-pkey core-pkey: child.h 15 ptrace-pkey core-pkey: LDLIBS += -pthread
|
/Linux-v4.19/include/linux/ |
D | pkeys.h | 12 #define arch_override_mprotect_pkey(vma, prot, pkey) (0) argument 21 static inline bool mm_pkey_is_allocated(struct mm_struct *mm, int pkey) in mm_pkey_is_allocated() argument 23 return (pkey == 0); in mm_pkey_is_allocated() 31 static inline int mm_pkey_free(struct mm_struct *mm, int pkey) in mm_pkey_free() argument 36 static inline int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, in arch_set_user_pkey_access() argument
|
D | mman.h | 81 #define arch_calc_vm_prot_bits(prot, pkey) 0 argument 117 calc_vm_prot_bits(unsigned long prot, unsigned long pkey) in calc_vm_prot_bits() argument 122 arch_calc_vm_prot_bits(prot, pkey); in calc_vm_prot_bits()
|
/Linux-v4.19/arch/x86/mm/ |
D | pkeys.c | 89 int __arch_override_mprotect_pkey(struct vm_area_struct *vma, int prot, int pkey) in __arch_override_mprotect_pkey() argument 95 if (pkey != -1) in __arch_override_mprotect_pkey() 96 return pkey; in __arch_override_mprotect_pkey() 105 pkey = execute_only_pkey(vma->vm_mm); in __arch_override_mprotect_pkey() 106 if (pkey > 0) in __arch_override_mprotect_pkey() 107 return pkey; in __arch_override_mprotect_pkey() 126 #define PKRU_AD_KEY(pkey) (PKRU_AD_BIT << ((pkey) * PKRU_BITS_PER_PKEY)) argument
|
D | fault.c | 177 u32 *pkey) in fill_sig_info_pkey() argument 193 if (!pkey) { in fill_sig_info_pkey() 203 info->si_pkey = *pkey; in fill_sig_info_pkey() 208 struct task_struct *tsk, u32 *pkey, int fault) in force_sig_info_fault() argument 224 fill_sig_info_pkey(si_signo, si_code, &info, pkey); in force_sig_info_fault() 845 unsigned long address, u32 *pkey, int si_code) in __bad_area_nosemaphore() argument 893 force_sig_info_fault(SIGSEGV, si_code, address, tsk, pkey, 0); in __bad_area_nosemaphore() 906 unsigned long address, u32 *pkey) in bad_area_nosemaphore() argument 908 __bad_area_nosemaphore(regs, error_code, address, pkey, SEGV_MAPERR); in bad_area_nosemaphore() 916 u32 pkey; in __bad_area() local [all …]
|
/Linux-v4.19/drivers/infiniband/hw/hfi1/ |
D | ud.c | 111 u16 pkey; in ud_loopback() local 115 pkey = hfi1_get_pkey(ibp, sqp->s_pkey_index); in ud_loopback() 118 if (unlikely(ingress_pkey_check(ppd, pkey, sc5, in ud_loopback() 121 hfi1_bad_pkey(ibp, pkey, in ud_loopback() 288 u16 *pkey, u32 extra_bytes, bool bypass) in hfi1_make_bth_deth() argument 305 *pkey = hfi1_get_pkey(ibp, wqe->ud_wr.pkey_index); in hfi1_make_bth_deth() 307 *pkey = hfi1_get_pkey(ibp, qp->s_pkey_index); in hfi1_make_bth_deth() 309 bth0 |= *pkey; in hfi1_make_bth_deth() 326 u16 len, slid, dlid, pkey; in hfi1_make_ud_req_9B() local 384 hfi1_make_bth_deth(qp, wqe, ohdr, &pkey, extra_bytes, false); in hfi1_make_ud_req_9B() [all …]
|
D | trace_ibhdrs.h | 108 u16 *pkey, u32 *psn, u32 *qpn); 119 u16 *entropy, u16 *len, u16 *pkey, 126 u16 len, u16 pkey, u32 dlid, u32 slid); 131 u8 tver, u16 pkey, u32 psn, u32 qpn, 171 __field(u16, pkey) 199 &__entry->pkey, 238 &__entry->pkey, 269 __entry->pkey, 285 __entry->pkey, 330 __field(u16, pkey) [all …]
|
/Linux-v4.19/Documentation/x86/ |
D | protection-keys.txt | 31 int pkey_free(int pkey); 33 unsigned long prot, int pkey); 35 Before a pkey can be used, it must first be allocated with 42 pkey = pkey_alloc(0, PKEY_DISABLE_WRITE); 44 ret = pkey_mprotect(ptr, PAGE_SIZE, real_prot, pkey); 50 pkey_set(pkey, 0); // clear PKEY_DISABLE_WRITE 52 pkey_set(pkey, PKEY_DISABLE_WRITE); // set PKEY_DISABLE_WRITE again 54 Now when it frees the memory, it will also free the pkey since it 58 pkey_free(pkey); 74 pkey = pkey_alloc(0, PKEY_DISABLE_WRITE | PKEY_DISABLE_READ); [all …]
|
/Linux-v4.19/lib/ |
D | digsig.c | 81 MPI in = NULL, res = NULL, pkey[2]; in digsig_verify_rsa() local 115 pkey[i] = mpi_read_from_buffer(datap, &remaining); in digsig_verify_rsa() 116 if (IS_ERR(pkey[i])) { in digsig_verify_rsa() 117 err = PTR_ERR(pkey[i]); in digsig_verify_rsa() 123 mblen = mpi_get_nbits(pkey[0]); in digsig_verify_rsa() 148 err = mpi_powm(res, in, pkey[1], pkey[0]); in digsig_verify_rsa() 180 mpi_free(pkey[i]); in digsig_verify_rsa()
|
/Linux-v4.19/mm/ |
D | mprotect.c | 457 unsigned long prot, int pkey) in do_mprotect_pkey() argument 491 if ((pkey != -1) && !mm_pkey_is_allocated(current->mm, pkey)) in do_mprotect_pkey() 538 new_vma_pkey = arch_override_mprotect_pkey(vma, prot, pkey); in do_mprotect_pkey() 586 unsigned long, prot, int, pkey) in SYSCALL_DEFINE4() 588 return do_mprotect_pkey(start, len, prot, pkey); in SYSCALL_DEFINE4() 593 int pkey; in SYSCALL_DEFINE2() local 604 pkey = mm_pkey_alloc(current->mm); in SYSCALL_DEFINE2() 607 if (pkey == -1) in SYSCALL_DEFINE2() 610 ret = arch_set_user_pkey_access(current, pkey, init_val); in SYSCALL_DEFINE2() 612 mm_pkey_free(current->mm, pkey); in SYSCALL_DEFINE2() [all …]
|
/Linux-v4.19/include/rdma/ |
D | ib_cache.h | 70 u16 *pkey); 85 u16 pkey, 101 u16 pkey,
|
/Linux-v4.19/crypto/asymmetric_keys/ |
D | public_key.c | 65 int public_key_verify_signature(const struct public_key *pkey, in public_key_verify_signature() argument 80 BUG_ON(!pkey); in public_key_verify_signature() 109 ret = crypto_akcipher_set_pub_key(tfm, pkey->key, pkey->keylen); in public_key_verify_signature()
|