Lines Matching full:userspace
7 reading from or writing ownership to disk, reporting ownership to userspace, or
16 in userspace is::
81 ``(uid_t)-1`` or overflowgid ``(gid_t)-1`` to userspace.
126 of userspace ids into a range of kernel ids::
128 userspace-id:kernel-id:range
130 A userspace id is always an element in the upper idmapset of an idmapping of
133 "userspace id" will be used to refer to the well known ``uid_t`` and ``gid_t``
138 A userspace id on the other hand is an id that is reported to userspace by the
139 kernel, or is passed by userspace to the kernel, or a raw device id that is
143 how userspace would specify them.
145 For the rest of this document we will prefix all userspace ids with ``u`` and
149 For example, the id ``u1000`` is an id in the upper idmapset or "userspace
172 ownership of a file is read from disk by a filesystem, the userspace id is
199 example, it is used when reporting back the ownership of a file to userspace
211 then translate ``k11000`` into a userspace id in the second idmapping using the
214 /* Map the kernel id up into a userspace id in the second idmapping. */
220 /* Map the userspace id down into a kernel id in the second idmapping. */
223 /* Map the kernel id up into a userspace id in the first idmapping. */
226 This algorithm allows us to answer the question what userspace id a given
231 For example, when the kernel reads a raw userspace id from disk it maps it down
238 When someone in userspace calls ``stat()`` or a related function to get
252 the userspace idmapset of the two idmappings. This is equivalent to remapping
264 1. Map the kernel id up into a userspace id in the first idmapping::
266 /* Map the kernel id up into a userspace id in the first idmapping. */
269 2. Map the userspace id down into a kernel id in the second idmapping::
271 /* Map the userspace id down into a kernel id in the second idmapping. */
274 As you can see we used the userspace idmapset in both idmappings to translate
278 get the same userspace id in another idmapping. In order to be able to answer
279 this question both idmappings need to contain the same userspace id in their
280 respective userspace idmapsets.
285 1. Map the kernel id up into a userspace id in the second idmapping::
287 /* Map the kernel id up into a userspace id in the second idmapping. */
290 2. Map the userspace id down into a kernel id in the first idmapping::
292 /* Map the userspace id down into a kernel id in the first idmapping. */
297 userspace id mapped. This will come in handy when working with idmapped mounts.
303 id in the userspace idmapset of another or the same idmapping. While the kernel
304 idmapset always indicates an idmapset in the kernel id space the userspace
305 idmapset indicates a userspace id. So the following translations are forbidden::
307 /* Map the userspace id down into a kernel id in the first idmapping. */
316 /* Map the kernel id up into a userspace id in the first idmapping. */
319 /* INVALID: Map the userspace id up into a userspace id in the second idmapping. */
330 /* Map the userspace id down into a kernel id. */
333 /* Map the kernel id up into a userspace id. */
344 filesystem ids. These are just regular ``uid_t`` and ``gid_t`` userspace ids
352 1. Map the caller's userspace ids down into kernel ids in the caller's
357 2. Verify that the caller's kernel ids can be mapped up to userspace ids in the
361 the kernel id back up into a userspace id when writing to disk.
362 So with the second step the kernel guarantees that a valid userspace id can be
368 kernel maps the caller's userspace id down into a kernel id according to the
388 1. Map the caller's userspace ids into kernel ids in the caller's idmapping::
392 2. Verify that the caller's kernel ids can be mapped to userspace ids in the
402 on. Ultimately the userspace id that lands on disk will be ``u1000``.
413 1. Map the caller's userspace ids down into kernel ids in the caller's
418 2. Verify that the caller's kernel ids can be mapped up to userspace ids in the
423 It's immediately clear that while the caller's userspace id could be
441 1. Map the caller's userspace ids down into kernel ids in the caller's
446 2. Verify that the caller's kernel ids can be mapped up to userspace ids in the
451 We can see that the translation always succeeds. The userspace id that the
457 userspace id. We could only do this if we were to mount the whole fileystem
464 kernel ids map up into valid userspace ids in the caller's idmapping
466 1. Map raw userspace ids down to kernel ids in the filesystem's idmapping::
470 2. Map kernel ids up to userspace ids in the caller's idmapping::
483 In order to report ownership to userspace the kernel uses the crossmapping
486 1. Map the userspace id on disk down into a kernel id in the filesystem's
491 2. Map the kernel id up into a userspace id in the caller's idmapping::
496 filesystem idmapping cannot be mapped up to a userspace id in the caller's
509 In order to report ownership to userspace the kernel uses the crossmapping
512 1. Map the userspace id on disk down into a kernel id in the filesystem's
517 2. Map the kernel id up into a userspace id in the caller's idmapping::
522 the filesystem idmapping cannot be mapped to a userspace id in the caller's
531 1. Map the userspace id on disk down into a kernel id in the filesystem's
536 2. Map the kernel id up into a userspace id in the caller's idmapping::
580 different login userspace ids. Most users will have ``u1000`` as the login id
638 /* Map the filesystem's kernel id up into a userspace id in the filesystem's idmapping. */
641 /* Map the filesystem's userspace id down ito a kernel id in the mount's idmapping. */
650 /* Map the caller's kernel id up into a userspace id in the mount's idmapping. */
653 /* Map the mount's userspace id down into a kernel id in the filesystem's idmapping. */
669 kernel id up to a userspace id in the caller's idmapping.
676 /* Map the filesystem's kernel id up into a userspace id. */
679 /* Map the filesystem's userspace id down ito a kernel id in the mount's idmapping. */
683 kernel id in the mount's idmapping into a userspace id in the caller's
693 mapped to a userspace id in the filesystem's idmapping. Since ``k11000`` can't
702 /* Map the caller's kernel id up into a userspace id in the mount's idmapping. */
705 /* Map the mount's userspace id down into a kernel id in the filesystem's idmapping. */
709 userspace id in the filesystem's idmapping::
733 1. Map the caller's userspace ids into kernel ids in the caller's idmapping::
741 /* Map the kernel id up into a userspace id in the mount's idmapping. */
744 /* Map the userspace id down into a kernel id in the filesystem's idmapping. */
747 2. Verify that the caller's kernel ids can be mapped to userspace ids in the
766 1. Map the caller's userspace ids into kernel ids in the caller's idmapping::
774 /* Map the kernel id up into a userspace id in the mount's idmapping. */
777 /* Map the userspace id down into a kernel id in the filesystem's idmapping. */
780 2. Verify that the caller's kernel ids can be mapped to userspace ids in the
797 In order to report ownership to userspace the kernel now does three steps using
800 1. Map the userspace id on disk down into a kernel id in the filesystem's
808 /* Map the kernel id up into a userspace id in the filesystem's idmapping. */
811 /* Map the userspace id down into a kernel id in the mounts's idmapping. */
814 3. Map the kernel id up into a userspace id in the caller's idmapping::
833 Again, in order to report ownership to userspace the kernel now does three
836 1. Map the userspace id on disk down into a kernel id in the filesystem's
844 /* Map the kernel id up into a userspace id in the filesystem's idmapping. */
847 /* Map the userspace id down into a kernel id in the mounts's idmapping. */
850 3. Map the kernel id up into a userspace id in the caller's idmapping::
904 1. Map the caller's userspace ids into kernel ids in the caller's idmapping::
912 /* Map the kernel id up into a userspace id in the mount's idmapping. */
915 /* Map the userspace id down into a kernel id in the filesystem's idmapping. */
918 2. Verify that the caller's kernel ids can be mapped to userspace ids in the
935 1. Map the userspace id on disk down into a kernel id in the filesystem's
943 /* Map the kernel id up into a userspace id in the filesystem's idmapping. */
946 /* Map the userspace id down into a kernel id in the mounts's idmapping. */
949 3. Map the kernel id up into a userspace id in the caller's idmapping::
954 which is the caller's userspace id on their workstation in our example.
956 The raw userspace id that is put on disk is ``u1000`` so when the user takes