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
150 idmapset or "userspace idmapset" starting with ``u0``. And it is mapped to
173 ownership of a file is read from disk by a filesystem, the userspace id is
200 example, it is used when reporting back the ownership of a file to userspace
212 then translate ``k11000`` into a userspace id in the second idmapping using the
215 /* Map the kernel id up into a userspace id in the second idmapping. */
221 /* Map the userspace id down into a kernel id in the second idmapping. */
224 /* Map the kernel id up into a userspace id in the first idmapping. */
227 This algorithm allows us to answer the question what userspace id a given
232 For example, when the kernel reads a raw userspace id from disk it maps it down
239 When someone in userspace calls ``stat()`` or a related function to get
253 the userspace idmapset of the two idmappings. This is equivalent to remapping
265 1. Map the kernel id up into a userspace id in the first idmapping::
267 /* Map the kernel id up into a userspace id in the first idmapping. */
270 2. Map the userspace id down into a kernel id in the second idmapping::
272 /* Map the userspace id down into a kernel id in the second idmapping. */
275 As you can see we used the userspace idmapset in both idmappings to translate
279 get the same userspace id in another idmapping. In order to be able to answer
280 this question both idmappings need to contain the same userspace id in their
281 respective userspace idmapsets.
286 1. Map the kernel id up into a userspace id in the second idmapping::
288 /* Map the kernel id up into a userspace id in the second idmapping. */
291 2. Map the userspace id down into a kernel id in the first idmapping::
293 /* Map the userspace id down into a kernel id in the first idmapping. */
298 userspace id mapped. This will come in handy when working with idmapped mounts.
304 id in the userspace idmapset of another or the same idmapping. While the kernel
305 idmapset always indicates an idmapset in the kernel id space the userspace
306 idmapset indicates a userspace id. So the following translations are forbidden::
308 /* Map the userspace id down into a kernel id in the first idmapping. */
317 /* Map the kernel id up into a userspace id in the first idmapping. */
320 /* INVALID: Map the userspace id up into a userspace id in the second idmapping. */
324 Since userspace ids have type ``uid_t`` and ``gid_t`` and kernel ids have type
335 /* Map the userspace id down into a kernel id. */
338 /* Map the kernel id up into a userspace id. */
349 filesystem ids. These are just regular ``uid_t`` and ``gid_t`` userspace ids
357 1. Map the caller's userspace ids down into kernel ids in the caller's
362 2. Verify that the caller's kernel ids can be mapped up to userspace ids in the
366 the kernel id back up into a userspace id when writing to disk.
367 So with the second step the kernel guarantees that a valid userspace id can be
373 kernel maps the caller's userspace id down into a kernel id according to the
400 1. Map the caller's userspace ids into kernel ids in the caller's idmapping::
404 2. Verify that the caller's kernel ids can be mapped to userspace ids in the
414 on. Ultimately the userspace id that lands on disk will be ``u1000``.
425 1. Map the caller's userspace ids down into kernel ids in the caller's
430 2. Verify that the caller's kernel ids can be mapped up to userspace ids in the
435 It's immediately clear that while the caller's userspace id could be
453 1. Map the caller's userspace ids down into kernel ids in the caller's
458 2. Verify that the caller's kernel ids can be mapped up to userspace ids in the
463 We can see that the translation always succeeds. The userspace id that the
469 userspace id. We could only do this if we were to mount the whole filesystem
476 kernel ids map up into valid userspace ids in the caller's idmapping
478 1. Map raw userspace ids down to kernel ids in the filesystem's idmapping::
482 2. Map kernel ids up to userspace ids in the caller's idmapping::
495 In order to report ownership to userspace the kernel uses the crossmapping
498 1. Map the userspace id on disk down into a kernel id in the filesystem's
503 2. Map the kernel id up into a userspace id in the caller's idmapping::
508 filesystem idmapping cannot be mapped up to a userspace id in the caller's
521 In order to report ownership to userspace the kernel uses the crossmapping
524 1. Map the userspace id on disk down into a kernel id in the filesystem's
529 2. Map the kernel id up into a userspace id in the caller's idmapping::
534 the filesystem idmapping cannot be mapped to a userspace id in the caller's
543 1. Map the userspace id on disk down into a kernel id in the filesystem's
548 2. Map the kernel id up into a userspace id in the caller's idmapping::
592 different login userspace ids. Most users will have ``u1000`` as the login id
694 Similar to how we prefix all userspace ids in this document with ``u`` and all
709 /* Map the filesystem's kernel id up into a userspace id in the filesystem's idmapping. */
712 /* Map the filesystem's userspace id down ito a VFS id in the mount's idmapping. */
721 /* Map the caller's VFS id up into a userspace id in the mount's idmapping. */
724 /* Map the mount's userspace id down into a kernel id in the filesystem's idmapping. */
744 kernel id up to a userspace id in the caller's idmapping.
751 /* Map the filesystem's kernel id up into a userspace id. */
754 /* Map the filesystem's userspace id down into a VFS id in the mount's idmapping. */
758 VFS id in the mount's idmapping into a userspace id in the caller's
769 mapped to a userspace id in the filesystem's idmapping. Since ``k11000`` can't
778 /* Map the caller's kernel id up into a userspace id in the mount's idmapping. */
781 /* Map the mount's userspace id down into a kernel id in the filesystem's idmapping. */
785 userspace id in the filesystem's idmapping::
810 1. Map the caller's userspace ids into kernel ids in the caller's idmapping::
818 /* Map the VFS id up into a userspace id in the mount's idmapping. */
821 /* Map the userspace id down into a kernel id in the filesystem's idmapping. */
824 3. Verify that the caller's kernel ids can be mapped to userspace ids in the
843 1. Map the caller's userspace ids into kernel ids in the caller's idmapping::
851 /* Map the VFS id up into a userspace id in the mount's idmapping. */
854 /* Map the userspace id down into a kernel id in the filesystem's idmapping. */
857 3. Verify that the caller's kernel ids can be mapped to userspace ids in the
874 In order to report ownership to userspace the kernel now does three steps using
877 1. Map the userspace id on disk down into a kernel id in the filesystem's
885 /* Map the kernel id up into a userspace id in the filesystem's idmapping. */
888 /* Map the userspace id down into a VFS id in the mounts's idmapping. */
891 3. Map the VFS id up into a userspace id in the caller's idmapping::
911 Again, in order to report ownership to userspace the kernel now does three
914 1. Map the userspace id on disk down into a kernel id in the filesystem's
922 /* Map the kernel id up into a userspace id in the filesystem's idmapping. */
925 /* Map the userspace id down into a VFS id in the mounts's idmapping. */
928 3. Map the VFS id up into a userspace id in the caller's idmapping::
983 1. Map the caller's userspace ids into kernel ids in the caller's idmapping::
991 /* Map the VFS id up into a userspace id in the mount's idmapping. */
994 /* Map the userspace id down into a kernel id in the filesystem's idmapping. */
997 3. Verify that the caller's filesystem ids can be mapped to userspace ids in the
1014 1. Map the userspace id on disk down into a kernel id in the filesystem's
1022 /* Map the kernel id up into a userspace id in the filesystem's idmapping. */
1025 /* Map the userspace id down into a VFS id in the mounts's idmapping. */
1028 3. Map the VFS id up into a userspace id in the caller's idmapping::
1034 which is the caller's userspace id on their workstation in our example.
1036 The raw userspace id that is put on disk is ``u1000`` so when the user takes