Lines Matching refs:new_map
731 static bool mappings_overlap(struct uid_gid_map *new_map, in mappings_overlap() argument
742 for (idx = 0; idx < new_map->nr_extents; idx++) { in mappings_overlap()
747 if (new_map->nr_extents <= UID_GID_MAP_MAX_BASE_EXTENTS) in mappings_overlap()
748 prev = &new_map->extent[idx]; in mappings_overlap()
750 prev = &new_map->forward[idx]; in mappings_overlap()
880 struct uid_gid_map *new_map) in verify_root_map() argument
886 for (idx = 0; idx < new_map->nr_extents; idx++) { in verify_root_map()
887 if (new_map->nr_extents <= UID_GID_MAP_MAX_BASE_EXTENTS) in verify_root_map()
888 extent0 = &new_map->extent[idx]; in verify_root_map()
890 extent0 = &new_map->forward[idx]; in verify_root_map()
928 struct uid_gid_map new_map; in map_write() local
964 memset(&new_map, 0, sizeof(struct uid_gid_map)); in map_write()
1026 if (mappings_overlap(&new_map, &extent)) in map_write()
1029 if ((new_map.nr_extents + 1) == UID_GID_MAP_MAX_EXTENTS && in map_write()
1033 ret = insert_extent(&new_map, &extent); in map_write()
1039 if (new_map.nr_extents == 0) in map_write()
1044 if (!new_idmap_permitted(file, map_ns, cap_setid, &new_map)) in map_write()
1051 for (idx = 0; idx < new_map.nr_extents; idx++) { in map_write()
1055 if (new_map.nr_extents <= UID_GID_MAP_MAX_BASE_EXTENTS) in map_write()
1056 e = &new_map.extent[idx]; in map_write()
1058 e = &new_map.forward[idx]; in map_write()
1077 ret = sort_idmaps(&new_map); in map_write()
1082 if (new_map.nr_extents <= UID_GID_MAP_MAX_BASE_EXTENTS) { in map_write()
1083 memcpy(map->extent, new_map.extent, in map_write()
1084 new_map.nr_extents * sizeof(new_map.extent[0])); in map_write()
1086 map->forward = new_map.forward; in map_write()
1087 map->reverse = new_map.reverse; in map_write()
1090 map->nr_extents = new_map.nr_extents; in map_write()
1095 if (ret < 0 && new_map.nr_extents > UID_GID_MAP_MAX_BASE_EXTENTS) { in map_write()
1096 kfree(new_map.forward); in map_write()
1097 kfree(new_map.reverse); in map_write()
1162 struct uid_gid_map *new_map) in new_idmap_permitted() argument
1166 if (cap_setid == CAP_SETUID && !verify_root_map(file, ns, new_map)) in new_idmap_permitted()
1172 if ((new_map->nr_extents == 1) && (new_map->extent[0].count == 1) && in new_idmap_permitted()
1174 u32 id = new_map->extent[0].lower_first; in new_idmap_permitted()