/openbmc/linux/include/linux/ |
H A D | highuid.h | 48 #define high2lowgid(gid) ((gid) & ~0xFFFF ? (old_gid_t)overflowgid : (old_gid_t)(gid)) argument 54 #define low2highgid(gid) ((gid) == (old_gid_t)-1 ? (gid_t)-1 : (gid_t)(gid)) argument 58 #define __convert_gid(size, gid) \ argument 59 (size >= sizeof(gid) ? (gid) : high2lowgid(gid)) 65 #define __convert_gid(size, gid) (gid) argument 71 #define SET_GID(var, gid) do { (var) = __convert_gid(sizeof(var), (gid)); } while (0) argument 93 #define fs_high2lowgid(gid) ((gid) & ~0xFFFF ? (gid16_t)fs_overflowgid : (gid16_t)(gid)) argument
|
H A D | uidgid.h | 39 static inline gid_t __kgid_val(kgid_t gid) in __kgid_val() argument 41 return gid.val; in __kgid_val() 49 static inline gid_t __kgid_val(kgid_t gid) in __kgid_val() argument 116 static inline bool gid_valid(kgid_t gid) in gid_valid() argument 118 return __kgid_val(gid) != (gid_t) -1; in gid_valid() 150 return KGIDT_INIT(gid); in make_kgid() 173 gid_t gid = from_kgid(to, kgid); in from_kgid_munged() local 174 if (gid == (gid_t)-1) in from_kgid_munged() 175 gid = overflowgid; in from_kgid_munged() 176 return gid; in from_kgid_munged() [all …]
|
/openbmc/linux/security/safesetid/ |
H A D | lsm.c | 48 if (!gid_eq(rule->src_id.gid, src.gid)) in _setid_policy_lookup() 50 if (gid_eq(rule->dst_id.gid, dst.gid)){ in _setid_policy_lookup() 127 if (setid_policy_lookup((kid_t){.gid = cred->gid}, INVALID_ID, GID) == SIDPOL_DEFAULT) in safesetid_security_capable() 134 __kgid_val(cred->gid)); in safesetid_security_capable() 157 if (gid_eq(new_id.gid, old->gid) || gid_eq(new_id.gid, old->egid) || in id_permitted_for_cred() 158 gid_eq(new_id.gid, old->sgid)) in id_permitted_for_cred() 177 __kgid_val(old->gid), __kgid_val(old->egid), in id_permitted_for_cred() 220 if (setid_policy_lookup((kid_t){.gid = old->gid}, INVALID_ID, GID) == SIDPOL_DEFAULT) in safesetid_task_fix_setgid() 223 if (id_permitted_for_cred(old, (kid_t){.gid = new->gid}, GID) && in safesetid_task_fix_setgid() 243 if (setid_policy_lookup((kid_t){.gid = old->gid}, INVALID_ID, GID) == SIDPOL_DEFAULT) in safesetid_task_fix_setgroups() [all …]
|
H A D | securityfs.c | 59 rule->src_id.gid = make_kgid(file->f_cred->user_ns, parsed_parent); in parse_policy_line() 60 rule->dst_id.gid = make_kgid(file->f_cred->user_ns, parsed_child); in parse_policy_line() 61 if (!gid_valid(rule->src_id.gid) || !gid_valid(rule->dst_id.gid)) in parse_policy_line() 93 hash_add(pol->rules, &rule->next, __kgid_val(rule->src_id.gid)); in insert_rule() 112 __kgid_val(rule->src_id.gid), in verify_ruleset() 113 __kgid_val(rule->dst_id.gid)); in verify_ruleset() 129 nrule->src_id.gid = rule->dst_id.gid; in verify_ruleset() 130 nrule->dst_id.gid = rule->dst_id.gid; in verify_ruleset()
|
/openbmc/linux/include/rdma/ |
H A D | ib_addr.h | 99 union ib_gid *gid) in ib_addr_get_mgid() argument 101 memcpy(gid, dev_addr->broadcast + 4, sizeof *gid); in ib_addr_get_mgid() 120 (struct in6_addr *)gid); in rdma_ip2gid() 123 *(struct in6_addr *)&gid->raw = in rdma_ip2gid() 135 if (ipv6_addr_v4mapped((struct in6_addr *)gid)) { in rdma_gid2ip() 139 memcpy(&out_in->sin_addr.s_addr, gid->raw + 12, 4); in rdma_gid2ip() 144 memcpy(&out_in->sin6_addr.s6_addr, gid->raw, 16); in rdma_gid2ip() 156 sizeof(*gid)); in rdma_addr_get_sgid() 161 memcpy(dev_addr->src_dev_addr + rdma_addr_gid_offset(dev_addr), gid, sizeof *gid); in rdma_addr_set_sgid() 166 memcpy(gid, dev_addr->dst_dev_addr + rdma_addr_gid_offset(dev_addr), sizeof *gid); in rdma_addr_get_dgid() [all …]
|
H A D | ib_cache.h | 14 union ib_gid *gid); 17 const union ib_gid *gid, 21 const union ib_gid *gid, 26 struct ib_device *device, const union ib_gid *gid, u32 port_num, 27 bool (*filter)(const union ib_gid *gid, const struct ib_gid_attr *, 108 bool rdma_is_zero_gid(const union ib_gid *gid);
|
H A D | opa_addr.h | 33 static inline bool ib_is_opa_gid(const union ib_gid *gid) in ib_is_opa_gid() argument 35 return ((be64_to_cpu(gid->global.interface_id) >> 40) == in ib_is_opa_gid() 46 static inline u32 opa_get_lid_from_gid(const union ib_gid *gid) in opa_get_lid_from_gid() argument 48 return be64_to_cpu(gid->global.interface_id) & 0xFFFFFFFF; in opa_get_lid_from_gid()
|
/openbmc/linux/drivers/infiniband/hw/mthca/ |
H A D | mthca_mcg.c | 42 u8 gid[16]; member 64 u8 *gid, struct mthca_mailbox *mgm_mailbox, in find_mgm() argument 77 memcpy(mgid, gid, 16); in find_mgm() 86 mthca_dbg(dev, "Hash for %pI6 is %04x\n", gid, *hash); in find_mgm() 98 if (!memcmp(mgm->gid, zero_gid, 16)) { in find_mgm() 106 if (!memcmp(mgm->gid, gid, 16)) in find_mgm() 143 if (!memcmp(mgm->gid, zero_gid, 16)) in mthca_multicast_attach() 144 memcpy(mgm->gid, gid->raw, 16); in mthca_multicast_attach() 161 memcpy(mgm->gid, gid->raw, 16); in mthca_multicast_attach() 236 mthca_err(dev, "MGID %pI6 not found\n", gid->raw); in mthca_multicast_detach() [all …]
|
/openbmc/linux/kernel/ |
H A D | groups.c | 18 gi = kvmalloc(struct_size(gi, gid, gidsetsize), GFP_KERNEL_ACCOUNT); in groups_alloc() 45 gid_t gid; in groups_to_user() local 46 gid = from_kgid_munged(user_ns, group_info->gid[i]); in groups_to_user() 47 if (put_user(gid, grouplist+i)) in groups_to_user() 62 gid_t gid; in groups_from_user() local 64 if (get_user(gid, grouplist+i)) in groups_from_user() 67 kgid = make_kgid(user_ns, gid); in groups_from_user() 71 group_info->gid[i] = kgid; in groups_from_user() 86 sort(group_info->gid, group_info->ngroups, sizeof(*group_info->gid), in groups_sort() 103 if (gid_gt(grp, group_info->gid[mid])) in groups_search() [all …]
|
/openbmc/linux/ipc/ |
H A D | compat.c | 45 to->gid = v.gid; in get_compat_ipc64_perm() 57 to->gid = v.gid; in get_compat_ipc_perm() 66 to->gid = from->gid; in to_compat_ipc64_perm() 77 SET_GID(to->gid, from->gid); in to_compat_ipc_perm()
|
/openbmc/linux/drivers/pinctrl/mvebu/ |
H A D | pinctrl-mvebu.c | 42 unsigned gid; member 295 unsigned gid) in mvebu_pinmux_set() argument 389 unsigned gid) in mvebu_pinctrl_get_group_name() argument 392 return pctl->groups[gid].name; in mvebu_pinctrl_get_group_name() 583 unsigned gid, n, k; in mvebu_pinctrl_probe() local 656 gid = 0; in mvebu_pinctrl_probe() 662 pctl->groups[gid].gid = gid; in mvebu_pinctrl_probe() 676 pctl->groups[gid].npins = 1; in mvebu_pinctrl_probe() 681 gid++; in mvebu_pinctrl_probe() 682 pctl->groups[gid].gid = gid; in mvebu_pinctrl_probe() [all …]
|
/openbmc/linux/fs/ |
H A D | mnt_idmapping.c | 138 gid_t gid; in make_vfsgid() local 144 gid = __kgid_val(kgid); in make_vfsgid() 146 gid = from_kgid(fs_userns, kgid); in make_vfsgid() 147 if (gid == (gid_t)-1) in make_vfsgid() 149 return VFSGIDT_INIT(make_kgid(mnt_userns, gid)); in make_vfsgid() 195 gid_t gid; in from_vfsgid() local 200 gid = from_kgid(mnt_userns, AS_KGIDT(vfsgid)); in from_vfsgid() 201 if (gid == (gid_t)-1) in from_vfsgid() 204 return KGIDT_INIT(gid); in from_vfsgid() 205 return make_kgid(fs_userns, gid); in from_vfsgid()
|
/openbmc/linux/drivers/net/ethernet/mellanox/mlx5/core/ |
H A D | mcg.c | 41 void *gid; in mlx5_core_attach_mcg() local 45 gid = MLX5_ADDR_OF(attach_to_mcg_in, in, multicast_gid); in mlx5_core_attach_mcg() 46 memcpy(gid, mgid, sizeof(*mgid)); in mlx5_core_attach_mcg() 54 void *gid; in mlx5_core_detach_mcg() local 58 gid = MLX5_ADDR_OF(detach_from_mcg_in, in, multicast_gid); in mlx5_core_detach_mcg() 59 memcpy(gid, mgid, sizeof(*mgid)); in mlx5_core_detach_mcg()
|
H A D | rdma.c | 110 static void mlx5_rdma_make_default_gid(struct mlx5_core_dev *dev, union ib_gid *gid) in mlx5_rdma_make_default_gid() argument 115 gid->global.subnet_prefix = cpu_to_be64(0xfe80000000000000LL); in mlx5_rdma_make_default_gid() 116 addrconf_addr_eui48(&gid->raw[8], hw_id); in mlx5_rdma_make_default_gid() 121 union ib_gid gid; in mlx5_rdma_add_roce_addr() local 124 mlx5_rdma_make_default_gid(dev, &gid); in mlx5_rdma_add_roce_addr() 127 0, gid.raw, mac, in mlx5_rdma_add_roce_addr()
|
/openbmc/linux/drivers/infiniband/core/ |
H A D | cache.c | 159 return !memcmp(gid, &zgid, sizeof(*gid)); in rdma_is_zero_gid() 328 entry->attr.gid.raw); in store_gid_entry() 520 memcmp(gid, &data->attr.gid, sizeof(*gid))) in find_gid() 559 if (rdma_is_zero_gid(gid)) in __ib_cache_gid_add() 577 attr->gid = *gid; in __ib_cache_gid_add() 586 __func__, gid->raw, ret); in __ib_cache_gid_add() 626 __func__, gid->raw, ret); in _ib_cache_gid_del() 759 if (memcmp(gid, &entry->attr.gid, sizeof(*gid))) in rdma_find_gid_by_filter() 838 union ib_gid gid = { }; in ib_cache_gid_set_default_gid() local 972 memcpy(gid, &table->data_vec[index]->attr.gid, sizeof(*gid)); in rdma_query_gid() [all …]
|
/openbmc/linux/usr/ |
H A D | gen_init_cpio.c | 108 unsigned int mode, uid_t uid, gid_t gid) in cpio_mkslink() argument 120 (long) gid, /* gid */ in cpio_mkslink() 144 int gid; in cpio_mkslink_line() local 157 uid_t uid, gid_t gid) in cpio_mkgeneric() argument 169 (long) gid, /* gid */ in cpio_mkgeneric() 215 int gid; in cpio_mkgeneric_line() local 224 rc = cpio_mkgeneric(name, mode, uid, gid); in cpio_mkgeneric_line() 263 (long) gid, /* gid */ in cpio_mknod() 283 int gid; in cpio_mknod_line() local 388 (long) gid, /* gid */ in cpio_mkfile() [all …]
|
H A D | gen_initramfs.sh | 17 $0 [-o <file>] [-l <dep_list>] [-u <uid>] [-g <gid>] {-d | <cpio_source>} ... 23 -g <gid> Group ID to map to group ID 0 (root). 24 <gid> is only meaningful if <cpio_source> is a 25 directory. "squash" forces all files to gid 0. 94 local gid="$4" 98 [ "$root_gid" = "squash" ] && gid=0 || [ "$gid" -eq "$root_gid" ] && gid=0 99 local str="${mode} ${uid} ${gid}"
|
/openbmc/linux/fs/quota/ |
H A D | kqid.c | 21 return gid_eq(left.gid, right.gid); in qid_eq() 47 return gid_lt(left.gid, right.gid); in qid_lt() 74 return from_kgid(targ, kqid.gid); in from_kqid() 107 return from_kgid_munged(targ, kqid.gid); in from_kqid_munged() 126 return gid_valid(qid.gid); in qid_valid()
|
/openbmc/openbmc/poky/meta/recipes-devtools/makedevs/makedevs/ |
H A D | makedevs.c | 248 chown(path, uid, gid); in add_new_directory() 292 chown(path, uid, gid); in add_new_device() 296 unsigned long gid, unsigned long mode) in add_new_file() argument 300 path, name, gid, uid, mode); in add_new_file() 310 chown(path, uid, gid); in add_new_file() 315 unsigned long gid, unsigned long mode) in add_new_fifo() argument 319 path, name, gid, uid, mode); in add_new_fifo() 336 chown(path, uid, gid); in add_new_fifo() 376 gid = convert2guid(grp_buf, grp_list); in interpret_table_entry() 393 add_new_file(name, path, uid, gid, mode); in interpret_table_entry() [all …]
|
/openbmc/linux/drivers/misc/sgi-gru/ |
H A D | gruprocfs.c | 161 long gid = *(long *)data; in cch_seq_show() local 163 struct gru_state *gru = GID_TO_GRU(gid); in cch_seq_show() 167 if (gid == 0) in cch_seq_show() 189 long gid = *(long *)data, ctxfree, cbrfree, dsrfree; in gru_seq_show() local 190 struct gru_state *gru = GID_TO_GRU(gid); in gru_seq_show() 192 if (gid == 0) { in gru_seq_show() 215 if (*gid < gru_max_gids) in seq_start() 216 return gid; in seq_start() 222 (*gid)++; in seq_next() 223 if (*gid < gru_max_gids) in seq_next() [all …]
|
/openbmc/linux/fs/nfsd/ |
H A D | flexfilelayoutxdr.c | 31 struct ff_idmap gid; in nfsd4_ff_encode_layoutget() local 36 gid.len = sprintf(gid.buf, "%u", from_kgid(&init_user_ns, fl->gid)); in nfsd4_ff_encode_layoutget() 40 8 + uid.len + 8 + gid.len; in nfsd4_ff_encode_layoutget() 70 p = xdr_encode_opaque(p, gid.buf, gid.len); in nfsd4_ff_encode_layoutget()
|
/openbmc/linux/net/core/ |
H A D | scm.c | 50 kgid_t gid = make_kgid(cred->user_ns, creds->gid); in scm_check_creds() local 52 if (!uid_valid(uid) || !gid_valid(gid)) in scm_check_creds() 59 ((gid_eq(gid, cred->gid) || gid_eq(gid, cred->egid) || in scm_check_creds() 60 gid_eq(gid, cred->sgid)) || ns_capable(cred->user_ns, CAP_SETGID))) { in scm_check_creds() 173 kgid_t gid; in __scm_send() local 194 gid = make_kgid(current_user_ns(), creds.gid); in __scm_send() 195 if (!uid_valid(uid) || !gid_valid(gid)) in __scm_send() 199 p->creds.gid = gid; in __scm_send()
|
/openbmc/linux/drivers/infiniband/hw/bnxt_re/ |
H A D | qplib_sp.c | 234 memcpy(gid, &sgid_tbl->tbl[index].gid, sizeof(*gid)); in bnxt_qplib_get_sgid() 253 if (!memcmp(&sgid_tbl->tbl[index].gid, gid, sizeof(*gid)) && in bnxt_qplib_del_sgid() 341 req.gid[0] = cpu_to_be32(((u32 *)gid->data)[3]); in bnxt_qplib_add_sgid() 342 req.gid[1] = cpu_to_be32(((u32 *)gid->data)[2]); in bnxt_qplib_add_sgid() 343 req.gid[2] = cpu_to_be32(((u32 *)gid->data)[1]); in bnxt_qplib_add_sgid() 344 req.gid[3] = cpu_to_be32(((u32 *)gid->data)[0]); in bnxt_qplib_add_sgid() 372 memcpy(&sgid_tbl->tbl[free_idx], gid, sizeof(*gid)); in bnxt_qplib_add_sgid() 404 req.gid[0] = cpu_to_be32(((u32 *)gid->data)[3]); in bnxt_qplib_update_sgid() 405 req.gid[1] = cpu_to_be32(((u32 *)gid->data)[2]); in bnxt_qplib_update_sgid() 406 req.gid[2] = cpu_to_be32(((u32 *)gid->data)[1]); in bnxt_qplib_update_sgid() [all …]
|
/openbmc/linux/include/net/ |
H A D | scm.h | 22 kgid_t gid; member 58 struct pid *pid, kuid_t uid, kgid_t gid) in scm_set_cred() argument 63 scm->creds.gid = gid; in scm_set_cred() 84 scm->creds.gid = INVALID_GID; in scm_send() 177 .gid = from_kgid_munged(current_ns, scm->creds.gid), in __scm_recv_common()
|
/openbmc/linux/drivers/net/ethernet/mellanox/mlx4/ |
H A D | mcg.c | 712 memcpy(mgid, gid, 16); in find_entry() 738 if (!memcmp(mgm->gid, gid, 16) && in find_entry() 1116 u8 port = gid[5]; in mlx4_qp_attach_common() 1133 memcpy(mgm->gid, gid, 16); in mlx4_qp_attach_common() 1148 memcpy(mgm->gid, gid, 16); in mlx4_qp_attach_common() 1224 u8 port = gid[5]; in mlx4_qp_detach_common() 1290 memset(mgm->gid, 0, 16); in mlx4_qp_detach_common() 1350 memcpy(mailbox->buf, gid, 16); in mlx4_QP_ATTACH() 1368 u8 gid[16], u8 port, in mlx4_trans_to_dmfs_attach() 1534 gid[7] |= (MLX4_UC_STEER << 1); in mlx4_unicast_attach() [all …]
|