Home
last modified time | relevance | path

Searched refs:pkey (Results 1 – 25 of 171) sorted by relevance

1234567

/Linux-v5.4/arch/powerpc/include/asm/
Dpkeys.h28 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 …]
Dmman.h21 unsigned long pkey) in arch_calc_vm_prot_bits() argument
24 return (((prot & PROT_SAO) ? VM_SAO : 0) | pkey_to_vmflag_bits(pkey)); in arch_calc_vm_prot_bits()
29 #define arch_calc_vm_prot_bits(prot, pkey) arch_calc_vm_prot_bits(prot, pkey) argument
/Linux-v5.4/crypto/asymmetric_keys/
Dpublic_key.c65 const struct public_key *pkey, in software_key_determine_akcipher() argument
78 pkey->pkey_algo); in software_key_determine_akcipher()
82 pkey->pkey_algo, hash_algo); in software_key_determine_akcipher()
87 strcpy(alg_name, pkey->pkey_algo); in software_key_determine_akcipher()
107 struct public_key *pkey = params->key->payload.data[asym_crypto]; in software_key_query() local
114 pkey, alg_name); in software_key_query()
122 key = kmalloc(pkey->keylen + sizeof(u32) * 2 + pkey->paramlen, in software_key_query()
126 memcpy(key, pkey->key, pkey->keylen); in software_key_query()
127 ptr = key + pkey->keylen; in software_key_query()
128 ptr = pkey_pack_u32(ptr, pkey->algo); in software_key_query()
[all …]
/Linux-v5.4/tools/testing/selftests/x86/
Dprotection_keys.c402 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 …]
Dpkey-helpers.h109 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-v5.4/security/selinux/
Dibpkey.c56 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()
74 struct sel_ib_pkey *pkey; in sel_ib_pkey_find() local
77 list_for_each_entry_rcu(pkey, &sel_ib_pkey_hash[idx].list, list) { in sel_ib_pkey_find()
78 if (pkey->psec.pkey == pkey_num && in sel_ib_pkey_find()
79 pkey->psec.subnet_prefix == subnet_prefix) in sel_ib_pkey_find()
80 return pkey; in sel_ib_pkey_find()
94 static void sel_ib_pkey_insert(struct sel_ib_pkey *pkey) in sel_ib_pkey_insert() argument
101 idx = sel_ib_pkey_hashfn(pkey->psec.pkey); in sel_ib_pkey_insert()
102 list_add_rcu(&pkey->list, &sel_ib_pkey_hash[idx].list); in sel_ib_pkey_insert()
[all …]
/Linux-v5.4/arch/x86/include/asm/
Dpkeys.h9 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-v5.4/drivers/infiniband/core/
Dsecurity.c48 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() argument
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()
[all …]
/Linux-v5.4/arch/powerpc/mm/book3s64/
Dpkeys.c31 #define pkeyshift(pkey) (PKEY_REG_BITS - ((pkey+1) * AMR_BITS_PER_PKEY)) argument
209 static bool is_pkey_enabled(int pkey) in is_pkey_enabled() argument
212 u64 pkey_bits = 0x3ul << pkeyshift(pkey); in is_pkey_enabled()
223 static inline void init_amr(int pkey, u8 init_bits) in init_amr() argument
225 u64 new_amr_bits = (((u64)init_bits & 0x3UL) << pkeyshift(pkey)); in init_amr()
226 u64 old_amr = read_amr() & ~((u64)(0x3ul) << pkeyshift(pkey)); in init_amr()
231 static inline void init_iamr(int pkey, u8 init_bits) in init_iamr() argument
233 u64 new_iamr_bits = (((u64)init_bits & 0x1UL) << pkeyshift(pkey)); in init_iamr()
234 u64 old_iamr = read_iamr() & ~((u64)(0x1ul) << pkeyshift(pkey)); in init_iamr()
243 int __arch_set_user_pkey_access(struct task_struct *tsk, int pkey, in __arch_set_user_pkey_access() argument
[all …]
/Linux-v5.4/drivers/infiniband/ulp/ipoib/
Dipoib_vlan.c74 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
115 if (pkey == 0 || pkey == 0x8000) { in __ipoib_vlan_add()
121 priv->pkey = pkey; in __ipoib_vlan_add()
165 int ipoib_vlan_add(struct net_device *pdev, unsigned short pkey) in ipoib_vlan_add() argument
186 ppriv->dev->name, pkey); in ipoib_vlan_add()
195 result = __ipoib_vlan_add(ppriv, priv, pkey, IPOIB_LEGACY_CHILD); in ipoib_vlan_add()
243 int ipoib_vlan_delete(struct net_device *pdev, unsigned short pkey) in ipoib_vlan_delete() argument
263 if (priv->pkey == pkey && in ipoib_vlan_delete()
/Linux-v5.4/include/net/
Dneighbour.h200 __u32 (*hash)(const void *pkey,
203 bool (*key_eq)(const struct neighbour *, const void *pkey);
262 static inline bool neigh_key_eq16(const struct neighbour *n, const void *pkey) in neigh_key_eq16() argument
264 return *(const u16 *)n->primary_key == *(const u16 *)pkey; in neigh_key_eq16()
267 static inline bool neigh_key_eq32(const struct neighbour *n, const void *pkey) in neigh_key_eq32() argument
269 return *(const u32 *)n->primary_key == *(const u32 *)pkey; in neigh_key_eq32()
272 static inline bool neigh_key_eq128(const struct neighbour *n, const void *pkey) in neigh_key_eq128() argument
275 const u32 *p32 = pkey; in neigh_key_eq128()
283 bool (*key_eq)(const struct neighbour *n, const void *pkey), in ___neigh_lookup_noref() argument
284 __u32 (*hash)(const void *pkey, in ___neigh_lookup_noref() argument
[all …]
Dndisc.h370 static inline u32 ndisc_hashfn(const void *pkey, const struct net_device *dev, __u32 *hash_rnd) in ndisc_hashfn() argument
372 const u32 *p32 = pkey; in ndisc_hashfn()
380 static inline struct neighbour *__ipv6_neigh_lookup_noref(struct net_device *dev, const void *pkey) in __ipv6_neigh_lookup_noref() argument
382 return ___neigh_lookup_noref(&nd_tbl, neigh_key_eq128, ndisc_hashfn, pkey, dev); in __ipv6_neigh_lookup_noref()
387 const void *pkey) in __ipv6_neigh_lookup_noref_stub() argument
390 ndisc_hashfn, pkey, dev); in __ipv6_neigh_lookup_noref_stub()
393 static inline struct neighbour *__ipv6_neigh_lookup(struct net_device *dev, const void *pkey) in __ipv6_neigh_lookup() argument
398 n = __ipv6_neigh_lookup_noref(dev, pkey); in __ipv6_neigh_lookup()
407 const void *pkey) in __ipv6_confirm_neigh() argument
412 n = __ipv6_neigh_lookup_noref(dev, pkey); in __ipv6_confirm_neigh()
[all …]
/Linux-v5.4/tools/testing/selftests/powerpc/ptrace/
DMakefile4 ptrace-tm-spd-vsx ptrace-tm-spr ptrace-hwbreak ptrace-pkey core-pkey \
12 $(OUTPUT)/ptrace-pkey $(OUTPUT)/core-pkey: child.h
13 $(OUTPUT)/ptrace-pkey $(OUTPUT)/core-pkey: LDLIBS += -pthread
/Linux-v5.4/crypto/
Drsa.c57 const struct rsa_mpi_key *pkey = rsa_get_key(tfm); in rsa_enc() local
65 if (unlikely(!pkey->n || !pkey->e)) { in rsa_enc()
75 ret = _rsa_enc(pkey, c, m); in rsa_enc()
96 const struct rsa_mpi_key *pkey = rsa_get_key(tfm); in rsa_dec() local
104 if (unlikely(!pkey->n || !pkey->d)) { in rsa_dec()
114 ret = _rsa_dec(pkey, m, c); in rsa_dec()
230 struct rsa_mpi_key *pkey = akcipher_tfm_ctx(tfm); in rsa_max_size() local
232 return mpi_get_size(pkey->n); in rsa_max_size()
237 struct rsa_mpi_key *pkey = akcipher_tfm_ctx(tfm); in rsa_exit_tfm() local
239 rsa_free_mpi_key(pkey); in rsa_exit_tfm()
/Linux-v5.4/include/linux/
Dpkeys.h12 #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
Dmman.h81 #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-v5.4/arch/x86/mm/
Dpkeys.c77 int __arch_override_mprotect_pkey(struct vm_area_struct *vma, int prot, int pkey) in __arch_override_mprotect_pkey() argument
83 if (pkey != -1) in __arch_override_mprotect_pkey()
84 return pkey; in __arch_override_mprotect_pkey()
93 pkey = execute_only_pkey(vma->vm_mm); in __arch_override_mprotect_pkey()
94 if (pkey > 0) in __arch_override_mprotect_pkey()
95 return pkey; in __arch_override_mprotect_pkey()
114 #define PKRU_AD_KEY(pkey) (PKRU_AD_BIT << ((pkey) * PKRU_BITS_PER_PKEY)) argument
/Linux-v5.4/drivers/infiniband/hw/hfi1/
Dud.c112 u16 pkey; in ud_loopback() local
116 pkey = hfi1_get_pkey(ibp, sqp->s_pkey_index); in ud_loopback()
119 if (unlikely(ingress_pkey_check(ppd, pkey, sc5, in ud_loopback()
122 hfi1_bad_pkey(ibp, pkey, in ud_loopback()
268 u16 *pkey, u32 extra_bytes, bool bypass) in hfi1_make_bth_deth() argument
285 *pkey = hfi1_get_pkey(ibp, rvt_get_swqe_pkey_index(wqe)); in hfi1_make_bth_deth()
287 *pkey = hfi1_get_pkey(ibp, qp->s_pkey_index); in hfi1_make_bth_deth()
289 bth0 |= *pkey; in hfi1_make_bth_deth()
307 u16 len, slid, dlid, pkey; in hfi1_make_ud_req_9B() local
365 hfi1_make_bth_deth(qp, wqe, ohdr, &pkey, extra_bytes, false); in hfi1_make_ud_req_9B()
[all …]
Dtrace_ibhdrs.h118 u16 *pkey, u32 *psn, u32 *qpn);
129 u16 *entropy, u16 *len, u16 *pkey,
136 u16 len, u16 pkey, u32 dlid, u32 slid);
141 u8 tver, u16 pkey, u32 psn, u32 qpn,
181 __field(u16, pkey)
209 &__entry->pkey,
248 &__entry->pkey,
279 __entry->pkey,
295 __entry->pkey,
340 __field(u16, pkey)
[all …]
Druc.c79 u16 pkey = packet->pkey; in hfi1_ruc_check_hdr() local
104 if (unlikely(rcv_pkey_check(ppd_from_ibp(ibp), pkey, in hfi1_ruc_check_hdr()
106 hfi1_bad_pkey(ibp, pkey, sl, 0, qp->ibqp.qp_num, in hfi1_ruc_check_hdr()
141 if (unlikely(rcv_pkey_check(ppd_from_ibp(ibp), pkey, in hfi1_ruc_check_hdr()
143 hfi1_bad_pkey(ibp, pkey, sl, 0, qp->ibqp.qp_num, in hfi1_ruc_check_hdr()
282 u16 pkey = hfi1_get_pkey(ibp, qp->s_pkey_index); in hfi1_make_ruc_header_16B() local
327 bth0 |= pkey; in hfi1_make_ruc_header_16B()
343 pkey, becn, 0, l4, priv->s_sc); in hfi1_make_ruc_header_16B()
368 u16 pkey = hfi1_get_pkey(ibp, qp->s_pkey_index); in hfi1_make_ruc_header_9B() local
404 bth0 |= pkey; in hfi1_make_ruc_header_9B()
Dhfi.h382 u16 pkey; member
1011 u16 pkey; member
1613 u16 pkey, u32 slid, u32 dlid, u8 sc5,
1616 u32 remote_qpn, u16 pkey, u32 slid, u32 dlid,
1619 u32 remote_qpn, u16 pkey, u32 slid, u32 dlid,
1623 int egress_pkey_check(struct hfi1_pportdata *ppd, u32 slid, u16 pkey,
1665 static inline int ingress_pkey_matches_entry(u16 pkey, u16 ent) in ingress_pkey_matches_entry() argument
1667 u16 mkey = pkey & PKEY_LOW_15_MASK; in ingress_pkey_matches_entry()
1676 if (!(pkey & PKEY_MEMBER_MASK)) in ingress_pkey_matches_entry()
1688 static int ingress_pkey_table_search(struct hfi1_pportdata *ppd, u16 pkey) in ingress_pkey_table_search() argument
[all …]
/Linux-v5.4/Documentation/core-api/
Dprotection-keys.rst38 int pkey_free(int pkey);
40 unsigned long prot, int pkey);
42 Before a pkey can be used, it must first be allocated with
50 pkey = pkey_alloc(0, PKEY_DISABLE_WRITE);
52 ret = pkey_mprotect(ptr, PAGE_SIZE, real_prot, pkey);
58 pkey_set(pkey, 0); // clear PKEY_DISABLE_WRITE
60 pkey_set(pkey, PKEY_DISABLE_WRITE); // set PKEY_DISABLE_WRITE again
62 Now when it frees the memory, it will also free the pkey since it
66 pkey_free(pkey);
83 pkey = pkey_alloc(0, PKEY_DISABLE_WRITE | PKEY_DISABLE_READ);
[all …]
/Linux-v5.4/lib/
Ddigsig.c78 MPI in = NULL, res = NULL, pkey[2]; in digsig_verify_rsa() local
112 pkey[i] = mpi_read_from_buffer(datap, &remaining); in digsig_verify_rsa()
113 if (IS_ERR(pkey[i])) { in digsig_verify_rsa()
114 err = PTR_ERR(pkey[i]); in digsig_verify_rsa()
120 mblen = mpi_get_nbits(pkey[0]); in digsig_verify_rsa()
145 err = mpi_powm(res, in, pkey[1], pkey[0]); in digsig_verify_rsa()
177 mpi_free(pkey[i]); in digsig_verify_rsa()
/Linux-v5.4/mm/
Dmprotect.c453 unsigned long prot, int pkey) in do_mprotect_pkey() argument
489 if ((pkey != -1) && !mm_pkey_is_allocated(current->mm, pkey)) in do_mprotect_pkey()
536 new_vma_pkey = arch_override_mprotect_pkey(vma, prot, pkey); in do_mprotect_pkey()
584 unsigned long, prot, int, pkey) in SYSCALL_DEFINE4()
586 return do_mprotect_pkey(start, len, prot, pkey); in SYSCALL_DEFINE4()
591 int pkey; in SYSCALL_DEFINE2() local
602 pkey = mm_pkey_alloc(current->mm); in SYSCALL_DEFINE2()
605 if (pkey == -1) in SYSCALL_DEFINE2()
608 ret = arch_set_user_pkey_access(current, pkey, init_val); in SYSCALL_DEFINE2()
610 mm_pkey_free(current->mm, pkey); in SYSCALL_DEFINE2()
[all …]
/Linux-v5.4/include/rdma/
Dib_cache.h74 u16 *pkey);
89 u16 pkey,
105 u16 pkey,

1234567