Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) (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 C513839B97D for ; Thu, 19 Mar 2026 07:13:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773904426; cv=none; b=NLOSMacmEDl91ShLRuiRRAUJFvkCE/V4dqhh3yGM1it6Qqh0KZ4q8kqlr1UnWDgQlCDjbiN9SDwh6O18Vz2bok/NLs6A+79MFRzMhDodWxIdDGicj1NGKFObEGmFR6Bw+PuJie7fbFEJc+kGOJtN/Q8aWEQyKVc/71GfPcB7ycI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773904426; c=relaxed/simple; bh=tkTs1gtAJDZhzvAVrF0FQohKuKSt3sVyorwlRe4etac=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Y1LkvmW1yyTnRA9lBCF36I6wdP4UH8wWrFg3Hk5XoLycsMd9Ze4JpuG3GGaeWGccod5bXFI1OZuxH1vVPaejfKn0b7M/ad3dcBAF6wFIhScGM7CjQir1dFuEXtmcAHumdo57EXTydzfvUOn6TveAb42X6VQ3e9C5Gp94Vkaxwns= 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=Cbh0z8Pl; arc=none smtp.client-ip=209.85.215.175 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="Cbh0z8Pl" Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-c73a5473bbdso273603a12.2 for ; Thu, 19 Mar 2026 00:13:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773904425; x=1774509225; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mTi0zyH9OJSgr25Ih+unkvbvFfmtDELfkr2/MWjFrSc=; b=Cbh0z8Plf6SLXqRmJ5x7+PXQuiBzG17LZBq4k5ZpXRG0Zz+yi211utJx1hzaO9Y1Lk noN8YEoC7MAXOgunGZALLUoViK3fAFfhHE44XtgcyAT+DqylFB5REWe8KcPGhGMWdAq3 XIurwbG46B6z33rkN89iSrfFw+YnI+I/90jMcNfUyGoJw6oRSMgNmjtMUWNBYZ5km19a E6tt0k0qJfQRKnflXkEX2KLdyv7vfbAL5vSs5XN/cZCIyNpQjUYAxubuHPrBW0AiT7bj XgV8/9ZVUF2aVBWmnxKDH+IMGXJZP8LVTCV8Ganmw4nvwHDjbSYql/gdo/+el9iIAoaq MXCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773904425; x=1774509225; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=mTi0zyH9OJSgr25Ih+unkvbvFfmtDELfkr2/MWjFrSc=; b=jHHoYkqaxVv0CQQp9oRQip9QW0xmb/4uAAwoC4eroFTUF+BUC5D3IxkijRp6XNNi4I DR6KpSAffbGV0sQLAspA52G/3aAW//LigSw4AP3NtEPI2p9wzlBJdytRRPzN2se5CGoK E7C97xxkHuvbxvv5YjQ7ObsRdVfapxhYjuyR4x/2o9XhXrmJewUN+EhYOAYhdXF/yx1J kErfO3/BTWPr/NGJIj/Fyr3jLNcd0kUIRTUisG8Af+8toxXyyWtP+tWnWe6uVAvanofV gKtjfuJwta+0hycesfzaBOygtw/pMU1c08K2GWz4csN5tSijnimHe0ekdQzDPya4mrCM LNcg== X-Forwarded-Encrypted: i=1; AJvYcCXWlONZQBGiZQTNpHZ1iwsKa7TWFIY3X719vmyXgBdW5duRsvadMRZTL1HscK6/Z8C9S1Pm@lists.linux.dev X-Gm-Message-State: AOJu0Yx94wTsePp66R/7L10983pWmCO+Xqifptz4uPnHqXP1mdlTN4ZJ eFg/vcx2taeDZc9Asa9Kr7KWDxsmKLDS9ECrIWsLcW407/OAe5LYRZqY X-Gm-Gg: ATEYQzwXZw8En+9xIBns0V40ybG4FWqIGqnUJPupbYWUnHng8GD695jw5Z6FFx5CRWK KiKFyO/Tx6lkEaOyMZShTrRM1m0qr8VmEwM53AJoFD0vv+ofPD7JQMH+nd/70HG/Oc6UB2hdJis 3QPk1Th48G9PnhHujRPtDN8X4YM8r/d5hP6SJd8JQbNa8tpcRQR7g//F4EXPfqoGEC+33/KqQc/ b1/Tq2KYu70OsDD73HY7j+ZlEe3EqCiZc4QohEhuWC/qL5xc2HepTBihZHUY1GavJkJeAVNcZPU 63LNhKWTnHoCDSTSLmiOjTDIwMflA4roRyt1IJrkkWK6due43FD60xj4fJyGng/gz0+6zByplgG Ua/XXDq3/MU2hMhlTnmiVffnkmoUiSRBIPMceVFcKQ9n7PPBXAErzMsec7jPRxjVEwjtgItsTHp FXgzIrL1bAly3NaedFK/91raheo4rY73CCbAJ1jm8gk4qlPoyd7nSUymC4dvdnOXJw X-Received: by 2002:a05:6a20:9c89:b0:398:6ea8:21f7 with SMTP id adf61e73a8af0-39b99d0132dmr5812218637.15.1773904424940; Thu, 19 Mar 2026 00:13:44 -0700 (PDT) Received: from fedora ([2405:201:3017:184:8df:188f:bb44:232b]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c741e0b31fasm4583442a12.5.2026.03.19.00.13.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Mar 2026 00:13:44 -0700 (PDT) From: Bhavik Sachdev To: alx@kernel.org Cc: avagin@gmail.com, b.sachdev1904@gmail.com, brauner@kernel.org, criu@lists.linux.dev, linux-man@vger.kernel.org, ptikhomirov@virtuozzo.com Subject: [PATCH v2 1/2] man/man2/statmount.2: Fix STATMOUNT_MNT_{UID,GID}MAP documentation Date: Thu, 19 Mar 2026 12:39:11 +0530 Message-ID: <8e3b0ce5a322e253ddad52e10875ce37c9c005cd.1773904035.git.b.sachdev1904@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: References: 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]: Fixes: 9968ead5 (2026-03-05; "man/man2/statmount.2: Document STATMOUNT_{UIDMAP,GIDMAP}") Signed-off-by: Bhavik Sachdev --- 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 42ca902d..78b6e9be 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