Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D0313C062A for ; Tue, 17 Mar 2026 12:21:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773750093; cv=none; b=O6maQenqHE+j2E4ylul5yvW6A6errpcvZt4zpmFm9SAzZ5sss0VC9goYp0VKCQU4RGkWZCKH7dBAfPjq9s+xeYSDhj/0vnzYYrN9n1u9hJPcyPg86ZdG+k19+KLYPe963FMJqVwiQw0jYK5J9HM8DJqqtlVAmLZHW3YpX0xSDnk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773750093; c=relaxed/simple; bh=pM7lLEXPHgZa93WuXe5B4jITKQtFxwa0+rN4ea9NF8s=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nP2RnUfm7hsGKIRXABlLiY+dKqVzXPTEoI2tgByxtwsqGO+oz3WyHhxD22I2Y4xr+RJd2XHRzSExBCYAymKfm9zU2hs1/HxnQYujXggTNQA7jMGjUp6XIdkMN6/JcBKAMQth3L5aE7NVGf2mmD4GrQYuJME6WnvaGM8/Z9NNzq4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MrPEFB0o; arc=none smtp.client-ip=209.85.216.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MrPEFB0o" Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-35bb7afdc38so38592a91.1 for ; Tue, 17 Mar 2026 05:21:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773750091; x=1774354891; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=MK2m9HCZE4LQ1PtTeBpXozu7Gx5lhMFwgsqKUvBrCmU=; b=MrPEFB0o+vVzx7raRDahz4oKS6gsNov95rWPXjfoZl03DTNlcXK1/nfVFwp2n8Pxk8 /QQuqAd9gcmM99hnLXIu1l10zp14otKoPyE/4TZqnIk86yyyyoSQRt00a2qFmdG4ehFd jTxHtPYGRJnlz5MxG5UQbfoNuy+LVTKOs6bQcBYHMwrn4JkDkGBWNylskH5lwIVpsAuJ i0Y+rtSrZ8KS3IMIrXn/8FoILpk0rggxe0qT7jGw5fkonckjZTpf/9NTuD299T4SH6hp 9PLeIxYV9gCOmHw3Voma/lxRFR1kacVWlC4lgkU8FHq5MVNwDTc4C9MMzWaooBJmAfEM V/2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773750091; x=1774354891; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=MK2m9HCZE4LQ1PtTeBpXozu7Gx5lhMFwgsqKUvBrCmU=; b=RmTL6ySurd19gqnE+V3R9AjEfRjrfNL4ZwsOozGfWeER5YJHfkhzvMzwc073pPfoiZ eQtZTAEeheQ0xLYluG96w2iNd1dy19Xk1Q7KjEJxF21JnQHll/H+QcLQO8okRkoTs4Ti FicIkG5oO7gqFO24hZjejqCAIwY14wC+sqMqlPWad28GOKf1pwi85y9vdlJeAWS8nGaC i68zzfckc20l1ldUcPzmCKD1Kv9TVKLC27cX4b3h/mgsdiyNA8ISYPaWWlHBGw6nhXws M2e6hSO9x9kuG2uN80S8CWw9krD3bXM3obvaHV1wVj+zckgrBXw07sNoPFu1ftCxUzz7 +BKQ== X-Forwarded-Encrypted: i=1; AJvYcCXwbeumruoaJZCqWWPjbu65g3zMkaX+/HN9CKhIg9PWATOrTc/LvhE419rcF8MGjjSEVb6C@lists.linux.dev X-Gm-Message-State: AOJu0YxgaWquC0scvkHv5qAxKHi7XC3P3UTaQa1ouYC1E27AUuhq2zfI VegTGNPwz50p3bRlBs4/ID5gGmX4wC4Nd9FS8bZYMXGKEUHc4fo+kGEQ X-Gm-Gg: ATEYQzxaPT43YgaZYqSzBkdaiLRCM17/QR/jt3/307VH9TtSqszcBIqjDgeADFU0PC/ LQxqLi8HzHcodTHdYnUAl75YjTUUW7Ec6lj3ggnHOT9agd3iZkAepPbvaB0VgS74dtkjbzOHAV4 A+57f45FzdqoezjFrvdCWgHAYeeAlwvjKYp/cOwPf+u3MlSoBXA5VZtHiTXK3gLWzHm0Rh/N9G0 SEZJeM+ebZTwRzktOYnVLRZlGcWJ0In/Q/poXacfNwoO0MEO8AVId3OFLPRXfkZTyawfhNjs/gR aiThoQPI+8v1ZU8A/DD8HkKxfJakmNgkcJ6+p9MJwA45cLBdBi3J8VqPNWnUbmmzzB+NV96HQrW LrnLxlvK54yCHLjU1fEpG262XkMw8q/kkFHWVrXAFpM5L4puuoTTNiVQ4fYvd103tswtcKSK/9e 8WSyAl8brdnIcb4/EgeakJEYtlOm6Qur3UEOqdJasaTVuPmU+xWyvXEg== X-Received: by 2002:a17:90b:4a46:b0:359:f6f8:57b8 with SMTP id 98e67ed59e1d1-35a21e37d7cmr13702741a91.1.1773750091414; Tue, 17 Mar 2026 05:21:31 -0700 (PDT) Received: from fedora ([2405:201:3017:184:8df:188f:bb44:232b]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-35badb90b8esm2810359a91.11.2026.03.17.05.21.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Mar 2026 05:21:30 -0700 (PDT) From: Bhavik Sachdev To: Alejandro Colomar Cc: Bhavik Sachdev , linux-man@vger.kernel.org, criu@lists.linux.dev, Andrei Vagin , Pavel Tikhomirov , Christian Brauner Subject: [PATCH] man/man2/statmount.2: Fix STATMOUNT_MNT_{UID,GID}MAP documentation Date: Tue, 17 Mar 2026 17:48:33 +0530 Message-ID: <6e8de405e5ada94279b68cd2d2159cb8393921ea.1773749913.git.b.sachdev1904@gmail.com> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: criu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In case of idmapped mounts and statmount(), three cases can occur: 1. The mount is not an idmapped mount. In this case, smbuf->mask will *not* have STATMOUNT_MNT_{UID,GID}MAP set. 2. The mount is an idmapped mount but *all* its mappings are *not* resolvable in the user namespace of the caller. In this case, smbuf->mask will have STATMOUNT_MNT_{UID,GID}MAP set but smbuf->mnt_{uid,gid}map_num will be 0. 3. The mount is an idmapped mount and *all* its mappings are resolvable in the user namespace of the caller. In this case, smbuf->mask will have STATMOUNT_MNT_{UID,GID}MAP set and mbuf->mnt_{uid,gid}map_num will be greater than 0. The current documentation fails to differentiate between case 1 and 2 and incorrectly states that STATMOUNT_MNT_{UID,GID}MAP will be set for non-idmapped mounts. We can verify that the above is the case by looking at [1] and is made explicitly clear by the comment in the implementation [2]. The case for STATMOUNT_MNT_{UID,GID}MAP not being raised for a non-idmapped mount can be verified by running this program [3]. [1]: [2]: [3]: Signed-off-by: Bhavik Sachdev --- Hey Alex! My understanding of how statmount() differentiated between idmapped mounts and non-idmapped mounts was incorrect. This patch fixes the incorrect documentation introduced as a result. Thanks, Bhavik man/man2/statmount.2 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/man/man2/statmount.2 b/man/man2/statmount.2 index 42ca902d9..40a07181b 100644 --- a/man/man2/statmount.2 +++ b/man/man2/statmount.2 @@ -356,7 +356,8 @@ .SS The returned information If .I smbuf.mask has STATMOUNT_UIDMAP set and this field is 0, -the mount is not an idmapped mount. +then uid mappings applied on the mount cannot be resolved in the user namespace +of the caller. .TP .IR smbuf.mnt_uidmap " (since Linux 6.15)" The offset to the location in the @@ -372,7 +373,8 @@ .SS The returned information If .I smbuf.mask has STATMOUNT_GIDMAP set and this field is 0, -the mount is not an idmapped mount. +then gid mappings applied on the mount cannot be resolved in the user namespace +of the caller. .TP .IR smbuf.mnt_gidmap " (since Linux 6.15)" The offset to the location in the -- 2.53.0