From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (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 496494AD4B0 for ; Wed, 2 Sep 2026 19:34:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788377711; cv=none; b=mwCyc5VHgNbnjuRT4KYQuzFia4D19ooYdHrkNv8fQBJ6AqfQ5aZQs5mvxHfgYsI2KrFlGmaqjyzfqpD26M5N41ieimhcxoO53rqCdE1AGz0de4wBAeZBpBUjUvr94hkxfuu51yTeiEUDCaRN4ihxfKIk8Ibr4svA/nO4Cj3Fqwo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788377711; c=relaxed/simple; bh=dINnaKckdfOT2F94x9t7jziPlS9yc2iyV99WUJZti5k=; h=Date:Message-ID:MIME-Version:Content-Type:From:To:Cc:Subject: References:In-Reply-To; b=W/HDTTUwYxBuhrh/s39YctHNx7sxoEzYOEM6KkJOjvarfPRwTqRVMdNwOXOXSiSxCIFmzSoG/DDS21U3WQqI4KjiYXQadkBsOCgHqkSd6eK8J6mJllOnw3SMBE8asljrb+dQgJe8Bl/tPnYKPHY1C6p+mb2ttr0bC9T8Vm8OBJI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=paul-moore.com; spf=pass smtp.mailfrom=paul-moore.com; dkim=pass (2048-bit key) header.d=paul-moore.com header.i=@paul-moore.com header.b=Mp6gh/qJ; arc=none smtp.client-ip=209.85.219.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=paul-moore.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=paul-moore.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=paul-moore.com header.i=@paul-moore.com header.b="Mp6gh/qJ" Received: by mail-qv1-f54.google.com with SMTP id 6a1803df08f44-90e7bde5596so15083186d6.1 for ; Wed, 02 Sep 2026 12:34:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore.com; s=google; t=1788377692; x=1788982492; darn=vger.kernel.org; h=in-reply-to:references:subject:cc:to:from:content-transfer-encoding :content-type:mime-version:message-id:date:from:to:cc:subject:date :message-id:reply-to:content-type; bh=183/fvO/by+DRdIa2ztu9BBJ4pI2bMZEyG+Jxipy0sA=; b=Mp6gh/qJ9PlBzkbFBngWPcHLug6aL4CVpoMoBhP+8cG8UE9y85GoduQoqIih5YgyNl SvWVTiaBA/qyWMiONrZyvM0SY6wAjBbacAFAI4GP+egbp+jJYuipoqAOwzb682f32Yt1 fBk0GiCRl9Z4HsaMpBNG+78y26N5SSpIM/AOYae8IP4AZNWGUSbhW260XHN+LyULIoky tTLV/D4i/SUONQC9eRCfWI3RnwTzmbOnuTetb2uBIXo13sa2mXOch1rXBMVA132fBrCs m5HvTYka9FeVwWTn1jP+9TIgCrYp74rb/+grmmfh1kSjT9kNCRgOlwiR9+mH/Zta7Csw WhQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788377692; x=1788982492; h=in-reply-to:references:subject:cc:to:from:content-transfer-encoding :content-type:mime-version:message-id:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=183/fvO/by+DRdIa2ztu9BBJ4pI2bMZEyG+Jxipy0sA=; b=tYE3whxsj1BrYmWg1fAPUwd8UJnCYT7VyUcPdxx+tNi/rGH02om6imV9cJn3GrgxUl J3F8q2unJFqgVW+2UkHYCGN59jChDDp3YdWSs0Rjb0Q1ueEefgaudMT9VufERGPRSWTJ EbmOafJcxBpMmvbHBN2YA9ouZATlijQJ/Jn2TiApC7KaljLFmfGXs9xSkUrGKrAfoz+d 0JYKWOvifhEelr40gAxuLoFMmDucxFYO6vRx/kuUPljS+HiKDOBquX21k9Wdr8t//ii9 g5P4tvNjK/hZBiABpOzU9VSQ31A+wed824NB0SZ5z5mtXqduFsfXH4DsbTF69+TwCIrr 3LvQ== X-Forwarded-Encrypted: i=1; AKwUvByBxTsqpnJqAup72vJPGvM8XKKcJQi8XvTNliGKlhpephrbO3eY2L1sIL0FptSMwGXBMKsYpvzVvg9Mc1L68QPDi9i0NXA=@vger.kernel.org X-Gm-Message-State: AFuF++kBQtEsNu2UWGnJUurMrIhBNghLmlCh+y2iVN1eCMa4EYC7pQ70 81tDVgK8o05w0h84Be2mKbKzyXN7oCUyS20dA7+jf0YO6+g8Veeqq0y+Q7zLJQuH1w== X-Gm-Gg: AYBFou2SFw5HFv+IQ+41NyLXVlpRNctH0mMxlK9zBXt/GWvISQRjIV4C/uzESrtipcS zbCA51YoLK3Okpn+njI6mP6V5IZz9Wm6P/rK94n2j7wE9GjVd75EbWxCcYcn/LKGxR3G737IS6d K2f543lWIqXF/wooiYwmNNysIFoPL6Lqk88Q6Sec/bROp1XI4DAe6g67etiWpjzKkP89TEIq9ku RLyZq5uBRXxk3eVDyxjsyMOqDqCCrzjkYUwzJvaj8LLDFbw8mq/p8v4za23s9FZ7vJb74NiiVba KN4BICxZRTwxujmxoL/NHMXp9ZIy5KBVcWS7GPsVyqTfg5AmVznUvwhyqcuo1rlahjUEaSxCQ7U DSNuDM+LZAp/uOlvvQJPSTwv1Y4O52B+y8mI2dh9NY1bwCK2X0ocatGuLCeW2Q51Q6EyLObkIjI 0/FN4NQVpBo+GjSDn5bgwBRJpjDyfZKRQrZ2eVdKfjhABrXtUa5/d/jOo3Ow7/D9sCHx7ixwaTg tHutopNs4GVseLecLDlpAbCHJn4lyqfZA== X-Received: by 2002:a05:6214:2dc9:b0:90e:8022:b66a with SMTP id 6a1803df08f44-90eca50ecaamr99641606d6.22.1788377691985; Wed, 02 Sep 2026 12:34:51 -0700 (PDT) Received: from localhost (pool-71-126-255-178.bstnma.fios.verizon.net. [71.126.255.178]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-90e9eec8099sm25284386d6.30.2026.09.02.12.34.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2026 12:34:51 -0700 (PDT) Date: Wed, 02 Sep 2026 15:34:50 -0400 Message-ID: <32dd145d801e472375c21d582023ed40@paul-moore.com> Precedence: bulk X-Mailing-List: linux-security-module@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Mailer: pstg-pwork:20260902_1319/pstg-lib:20260901_1604/pstg-pwork:20260902_1319 From: Paul Moore To: Christian Brauner , linux-fsdevel@vger.kernel.org Cc: Alexander Viro , Jan Kara , Christoph Hellwig , Seth Forshee , linux-security-module@vger.kernel.org, Mimi Zohar , linux-integrity@vger.kernel.org, Ilya Dryomov , ceph-devel@vger.kernel.org, Carlos Maiolino , linux-xfs@vger.kernel.org, Miklos Szeredi , Amir Goldstein , linux-unionfs@vger.kernel.org, Namjae Jeon , linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org, "Christian Brauner (Amutable)" Subject: Re: [PATCH 17/27] fs: port ->tmpfile() to pass const mnt_idmap References: <20260901-work-idmap-const-v1-17-54ccd48e100b@kernel.org> In-Reply-To: <20260901-work-idmap-const-v1-17-54ccd48e100b@kernel.org> On Sep 1, 2026 Christian Brauner wrote: > > Convert to const struct mnt_idmap. > > A mount's idmapping is immutable. The only thing that is allowed to be > modified afterwards is the reference count and that is hidden behind > mnt_idmap_get() and mnt_idmap_put(). Everything else only ever reads > from the idmapping. This is the same model that struct cred uses and the > idmapping is also rather sensitive. > > So make the idmap argument const wherever we can. The conversion is done > from the bottom up so callers can continue to pass a non-const pointer > to a const parameter until the conversion is finished. > > No functional changes. > > Signed-off-by: Christian Brauner (Amutable) > Reviewed-by: Jan Kara > --- > Documentation/filesystems/locking.rst | 2 +- > Documentation/filesystems/vfs.rst | 2 +- > fs/bad_inode.c | 2 +- > fs/btrfs/inode.c | 2 +- > fs/ext2/namei.c | 2 +- > fs/ext4/namei.c | 2 +- > fs/f2fs/namei.c | 2 +- > fs/fuse/dir.c | 2 +- > fs/hugetlbfs/inode.c | 2 +- > fs/minix/namei.c | 2 +- > fs/overlayfs/dir.c | 2 +- > fs/ramfs/inode.c | 2 +- > fs/smb/client/cifsfs.h | 2 +- > fs/smb/client/dir.c | 2 +- > fs/ubifs/dir.c | 2 +- > fs/udf/namei.c | 2 +- > fs/xfs/xfs_iops.c | 2 +- > include/linux/fs.h | 2 +- > include/linux/lsm_hook_defs.h | 2 +- > include/linux/security.h | 4 ++-- > mm/shmem.c | 2 +- > security/integrity/ima/ima_main.c | 2 +- > security/security.c | 2 +- > 23 files changed, 24 insertions(+), 24 deletions(-) Acked-by: Paul Moore (LSM) -- paul-moore.com