From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) (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 3A1384ACC9B for ; Wed, 2 Sep 2026 19:34:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788377701; cv=none; b=IpxXaXxmThyUGhZV2tanbnUAZhfXGJb3RAuBYWJE/nZW1Ia2nFFXCpM4P8SyWFvAPZpzeqwI0MwUEHMDX1VIRoLYM3/trTh9wmhcILqsDcdKZiz077A/UHleld+Kpb8mRPYDUeSaIR7Uk0eMdEaS1E17wSwymk4SESjlGI1mKlw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788377701; c=relaxed/simple; bh=7XijPLwz3cHBxl1YFk+E8vu/tL68tteh4h0gxiMHTNc=; h=Date:Message-ID:MIME-Version:Content-Type:From:To:Cc:Subject: References:In-Reply-To; b=nF8lGkQnGdZIL/JOloQqFzAWXpW8+xiQRpB1Yp+FaCnBefkR6PWgc5n6WNvS0cWg75HltO7gn2CmuHLa1KBVFbnriD3ijCIcCfOoDjguzKQEJ+Gc5CgJTfropTfDJWXmq/p/R5RdKq/B0Lna8uehC5yzBoHfCyd/ROPJ9nmDHUw= 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=apaOjh7d; arc=none smtp.client-ip=209.85.219.41 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="apaOjh7d" Received: by mail-qv1-f41.google.com with SMTP id 6a1803df08f44-90ce3971a86so14467826d6.0 for ; Wed, 02 Sep 2026 12:34:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore.com; s=google; t=1788377690; x=1788982490; 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=BIdNMxFvwqrPz4tpIyv6StSQNKP9oc9jkPpYrkixADU=; b=apaOjh7dQp74WY42ZKX1LucplV5mZwhakPtY5Jg2eXD4fZ3oEZRJXmKGzxoPFjE+Sd TFfutb20vFTVAwcF8aFfemNt+nNl2YigcQV+qQOzgrBZCsRMIjQAuCsL06AIQQPDPill MkUKXuR5tuMo6l8FA//nAL1Tj/XGhR8GdhHCcbs6J/tW84CM/8/sKhSrjkWKYzLVip42 ZvhxgG8RAlyP+XVemMTyp9hSCSvPOSZ6O099hPlHoH9oipeJfJ8CrCyHgbhmgS30owwF HV1aWHhUJ3mUY881jnB4aQkdPvbZn9vSbvoRWmIqm1/impT4Vj7OvR0gzwrjwAj+PxTq nR5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788377690; x=1788982490; 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=BIdNMxFvwqrPz4tpIyv6StSQNKP9oc9jkPpYrkixADU=; b=qf3zH/A1IxJ+XyTBKmPow1nVrFT1y/P/nS7zZSBE/ix6FXL5XY2CLOmUbiAaVQqlc/ 5R6m2Ra7aX46LdRHaYR4wT47aJRCMJ0hBkt1vB4TlLImrCLgaHGHb9LZq8+gmLt7huQL Eha7ikjTcSjhOsEeYu7xVun6qS+w2tO32WNp5EV4zSNhxaKPuG9YH0ENvApXL1COuaSv Q6KiTu6BirZSjpcB7guX6DDAtrNbBWp3mwHMorQYSwDEBkDiH+G5dfqMwghKiMs+PTQe EWJRX3PlVH/s2fidLu2cURa0P5TQWS4snFb4iDzmiIv0HPLfJuSzFjuN1cxmSAbq1Tj5 C/eA== X-Forwarded-Encrypted: i=1; AKwUvBycE+GtqZPTq7Qkok7oHYZwUMHR62gPvX7uQKPAh6i9Vd3esLKQ1qb/YUa6qqvYg7duuhNBsv6AhE6zx/vngVwl7hC3BuI=@vger.kernel.org X-Gm-Message-State: AFuF++neObGdAo/JK6oMNG6NqYqgR7/xgtkF1UJodjtq8TOag0+CK0pA zuNGvk61CFZ5RJb1nnRCq6LDmg4e3hTNQZELdrgAI6CSStcPSYJT/UXpJDHtXtH+TMupUF+z9Zs 4Mq1MqA== X-Gm-Gg: AYBFou3jt06TXbfT4kH+LUdfZygScMwg/Vld3IwrZEzN9+9vaciUPZAfFCsL/Cp1D1L Gg4LLOvV4qutkQtY5pISelPfgK8hxJu4vuiWCfKzravGCMSCiGgdW4IdfWKKbWIR5pbSFmh8QBz CtweCrFyv61VurdaR9WmeV3LbvHFwyaLzeAYjl0NYro6h105V+tL0SVGXlEUv+SotqV6wo+NatB h66C9L2TCn6UeufNs0Ha1M9CUaNcxg8pQOi8YuxGcfV5Qjb33AGfaKjdV95EOznC7N8w0vo4Y/D sVK6b8Z72HklPbriinTZ3jQY5BUr0i6VDTVqo+PWP+ekwaEBMZWlmPJcsRQSk27XBe1BT4CGtOI 5DNFii1M/ANjgvgq6d15D8fMJptzmDed1ymWUEsRA/X39s9B0gZJuPGp0aF0sF1Euz0cPTvFAgI j0ZjLlKfJ02aXrtu7lAKQe2c8ozL9KMtk/YEoHVmRjzsKPfI5/3T3d56APCBR6WeR/HY3LiPCgX YUwU6rk89ew+EaFQd//FH11usj/eCOYbw== X-Received: by 2002:a05:6214:4601:b0:8f0:3b2c:a9c8 with SMTP id 6a1803df08f44-90e9f25c224mr108760886d6.12.1788377690538; Wed, 02 Sep 2026 12:34:50 -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-90e9ef0f57fsm25004716d6.47.2026.09.02.12.34.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2026 12:34:49 -0700 (PDT) Date: Wed, 02 Sep 2026 15:34:49 -0400 Message-ID: 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 13/27] fs: port xattr to const mnt_idmap References: <20260901-work-idmap-const-v1-13-54ccd48e100b@kernel.org> In-Reply-To: <20260901-work-idmap-const-v1-13-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 +- > fs/9p/xattr.c | 2 +- > fs/afs/xattr.c | 4 ++-- > fs/attr.c | 2 +- > fs/btrfs/xattr.c | 6 +++--- > fs/ceph/xattr.c | 2 +- > fs/ecryptfs/inode.c | 2 +- > fs/ext2/xattr_security.c | 2 +- > fs/ext2/xattr_trusted.c | 2 +- > fs/ext2/xattr_user.c | 2 +- > fs/ext4/xattr_hurd.c | 2 +- > fs/ext4/xattr_security.c | 2 +- > fs/ext4/xattr_trusted.c | 2 +- > fs/ext4/xattr_user.c | 2 +- > fs/f2fs/xattr.c | 4 ++-- > fs/fuse/dir.c | 2 +- > fs/fuse/fuse_i.h | 2 +- > fs/fuse/xattr.c | 2 +- > fs/gfs2/xattr.c | 2 +- > fs/hfs/attr.c | 2 +- > fs/hfsplus/xattr.c | 2 +- > fs/hfsplus/xattr_security.c | 2 +- > fs/hfsplus/xattr_trusted.c | 2 +- > fs/hfsplus/xattr_user.c | 2 +- > fs/jffs2/security.c | 2 +- > fs/jffs2/xattr_trusted.c | 2 +- > fs/jffs2/xattr_user.c | 2 +- > fs/jfs/xattr.c | 4 ++-- > fs/kernfs/inode.c | 4 ++-- > fs/nfs/nfs4proc.c | 10 +++++----- > fs/ntfs/ea.c | 2 +- > fs/ntfs3/xattr.c | 2 +- > fs/ocfs2/xattr.c | 6 +++--- > fs/orangefs/xattr.c | 2 +- > fs/overlayfs/xattrs.c | 4 ++-- > fs/pidfs.c | 2 +- > fs/smb/client/xattr.c | 2 +- > fs/smb/server/vfs.c | 24 ++++++++++++------------ > fs/smb/server/vfs.h | 20 ++++++++++---------- > fs/ubifs/xattr.c | 2 +- > fs/xattr.c | 22 +++++++++++----------- > fs/xfs/xfs_iops.c | 2 +- > fs/xfs/xfs_xattr.c | 2 +- > include/linux/capability.h | 4 ++-- > include/linux/fs.h | 2 +- > include/linux/lsm_hook_defs.h | 8 ++++---- > include/linux/security.h | 20 ++++++++++---------- > include/linux/xattr.h | 20 ++++++++++---------- > kernel/bpf/inode.c | 2 +- > mm/shmem.c | 2 +- > net/socket.c | 4 ++-- > security/commoncap.c | 8 ++++---- > security/integrity/evm/evm_main.c | 4 ++-- > security/integrity/ima/ima_appraise.c | 4 ++-- > security/security.c | 8 ++++---- > security/selinux/hooks.c | 6 +++--- > security/smack/smack_lsm.c | 6 +++--- > 57 files changed, 135 insertions(+), 135 deletions(-) Acked-by: Paul Moore (LSM, SELinux) -- paul-moore.com