]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
namespaces.7: Comparisons between fstat()ed files should be on st_dev+st_ino
authorMichael Kerrisk <mtk.manpages@gmail.com>
Mon, 12 Dec 2016 06:01:44 +0000 (07:01 +0100)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Mon, 12 Dec 2016 06:30:16 +0000 (07:30 +0100)
The FDs returned by NS_GET_USERNS and NS_GET_PAREENT must be
tested by comparing to both the 'st_dev' and 'st_ino' fields
returned by fstat(2).

Reported-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man7/namespaces.7

index 6dc89138068a3451bdeb8514602d6e910fab9abf..c755545755a850a6d4214a9950fe91137a458a0a 100644 (file)
@@ -378,8 +378,10 @@ By applying
 to the returned file descriptor, one obtains a
 .I stat
 structure whose
+.I st_dev
+(resident device) and
 .I st_ino
-(inode number) field identifies the owning/parent namespace.
+(inode number) fields together identify the owning/parent namespace.
 This inode number can be matched with the inode number of another
 .IR /proc/[pid]/ns/{pid,user}
 file to determine whether that is the owning/parent namespace.