+++ /dev/null
-From ac96e4171af6fe91c6bc75cf4ea1e648e5500a55 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Thu, 17 Apr 2025 08:40:42 +0200
-Subject: fs: move the bdex_statx call to vfs_getattr_nosec
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-From: Christoph Hellwig <hch@lst.de>
-
-[ Upstream commit 777d0961ff95b26d5887fdae69900374364976f3 ]
-
-Currently bdex_statx is only called from the very high-level
-vfs_statx_path function, and thus bypassing it for in-kernel calls
-to vfs_getattr or vfs_getattr_nosec.
-
-This breaks querying the block ѕize of the underlying device in the
-loop driver and also is a pitfall for any other new kernel caller.
-
-Move the call into the lowest level helper to ensure all callers get
-the right results.
-
-Fixes: 2d985f8c6b91 ("vfs: support STATX_DIOALIGN on block devices")
-Fixes: f4774e92aab8 ("loop: take the file system minimum dio alignment into account")
-Reported-by: "Darrick J. Wong" <djwong@kernel.org>
-Signed-off-by: Christoph Hellwig <hch@lst.de>
-Link: https://lore.kernel.org/20250417064042.712140-1-hch@lst.de
-Signed-off-by: Christian Brauner <brauner@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- block/bdev.c | 3 +--
- fs/stat.c | 32 ++++++++++++++++++--------------
- include/linux/blkdev.h | 6 +++---
- 3 files changed, 22 insertions(+), 19 deletions(-)
-
-diff --git a/block/bdev.c b/block/bdev.c
-index 738e3c8457e7f..1f1282a0dc653 100644
---- a/block/bdev.c
-+++ b/block/bdev.c
-@@ -1269,8 +1269,7 @@ void sync_bdevs(bool wait)
- /*
- * Handle STATX_{DIOALIGN, WRITE_ATOMIC} for block devices.
- */
--void bdev_statx(struct path *path, struct kstat *stat,
-- u32 request_mask)
-+void bdev_statx(const struct path *path, struct kstat *stat, u32 request_mask)
- {
- struct inode *backing_inode;
- struct block_device *bdev;
-diff --git a/fs/stat.c b/fs/stat.c
-index b399b881bbbf9..8ce0fc9cad5d0 100644
---- a/fs/stat.c
-+++ b/fs/stat.c
-@@ -162,12 +162,25 @@ int vfs_getattr_nosec(const struct path *path, struct kstat *stat,
- STATX_ATTR_DAX);
-
- idmap = mnt_idmap(path->mnt);
-- if (inode->i_op->getattr)
-- return inode->i_op->getattr(idmap, path, stat,
-- request_mask,
-- query_flags);
-+ if (inode->i_op->getattr) {
-+ int ret;
-+
-+ ret = inode->i_op->getattr(idmap, path, stat, request_mask,
-+ query_flags);
-+ if (ret)
-+ return ret;
-+ } else {
-+ generic_fillattr(idmap, request_mask, inode, stat);
-+ }
-+
-+ /*
-+ * If this is a block device inode, override the filesystem attributes
-+ * with the block device specific parameters that need to be obtained
-+ * from the bdev backing inode.
-+ */
-+ if (S_ISBLK(stat->mode))
-+ bdev_statx(path, stat, request_mask);
-
-- generic_fillattr(idmap, request_mask, inode, stat);
- return 0;
- }
- EXPORT_SYMBOL(vfs_getattr_nosec);
-@@ -260,15 +273,6 @@ static int vfs_statx_path(struct path *path, int flags, struct kstat *stat,
- if (path_mounted(path))
- stat->attributes |= STATX_ATTR_MOUNT_ROOT;
- stat->attributes_mask |= STATX_ATTR_MOUNT_ROOT;
--
-- /*
-- * If this is a block device inode, override the filesystem
-- * attributes with the block device specific parameters that need to be
-- * obtained from the bdev backing inode.
-- */
-- if (S_ISBLK(stat->mode))
-- bdev_statx(path, stat, request_mask);
--
- return 0;
- }
-
-diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
-index 8f37c5dd52b21..2aa9cb446c6c8 100644
---- a/include/linux/blkdev.h
-+++ b/include/linux/blkdev.h
-@@ -1624,7 +1624,7 @@ int sync_blockdev(struct block_device *bdev);
- int sync_blockdev_range(struct block_device *bdev, loff_t lstart, loff_t lend);
- int sync_blockdev_nowait(struct block_device *bdev);
- void sync_bdevs(bool wait);
--void bdev_statx(struct path *, struct kstat *, u32);
-+void bdev_statx(const struct path *path, struct kstat *stat, u32 request_mask);
- void printk_all_partitions(void);
- int __init early_lookup_bdev(const char *pathname, dev_t *dev);
- #else
-@@ -1642,8 +1642,8 @@ static inline int sync_blockdev_nowait(struct block_device *bdev)
- static inline void sync_bdevs(bool wait)
- {
- }
--static inline void bdev_statx(struct path *path, struct kstat *stat,
-- u32 request_mask)
-+static inline void bdev_statx(const struct path *path, struct kstat *stat,
-+ u32 request_mask)
- {
- }
- static inline void printk_all_partitions(void)
---
-2.39.5
-
+++ /dev/null
-From 11c74829cae321a5b870db6d926431b83847c171 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 1 Nov 2024 15:37:03 -0400
-Subject: fs: Simplify getattr interface function checking AT_GETATTR_NOSEC
- flag
-
-From: Stefan Berger <stefanb@linux.ibm.com>
-
-[ Upstream commit 95f567f81e43a1bcb5fbf0559e55b7505707300d ]
-
-Commit 8a924db2d7b5 ("fs: Pass AT_GETATTR_NOSEC flag to getattr interface
-function")' introduced the AT_GETATTR_NOSEC flag to ensure that the
-call paths only call vfs_getattr_nosec if it is set instead of vfs_getattr.
-Now, simplify the getattr interface functions of filesystems where the flag
-AT_GETATTR_NOSEC is checked.
-
-There is only a single caller of inode_operations getattr function and it
-is located in fs/stat.c in vfs_getattr_nosec. The caller there is the only
-one from which the AT_GETATTR_NOSEC flag is passed from.
-
-Two filesystems are checking this flag in .getattr and the flag is always
-passed to them unconditionally from only vfs_getattr_nosec:
-
-- ecryptfs: Simplify by always calling vfs_getattr_nosec in
- ecryptfs_getattr. From there the flag is passed to no other
- function and this function is not called otherwise.
-
-- overlayfs: Simplify by always calling vfs_getattr_nosec in
- ovl_getattr. From there the flag is passed to no other
- function and this function is not called otherwise.
-
-The query_flags in vfs_getattr_nosec will mask-out AT_GETATTR_NOSEC from
-any caller using AT_STATX_SYNC_TYPE as mask so that the flag is not
-important inside this function. Also, since no filesystem is checking the
-flag anymore, remove the flag entirely now, including the BUG_ON check that
-never triggered.
-
-The net change of the changes here combined with the original commit is
-that ecryptfs and overlayfs do not call vfs_getattr but only
-vfs_getattr_nosec.
-
-Fixes: 8a924db2d7b5 ("fs: Pass AT_GETATTR_NOSEC flag to getattr interface function")
-Reported-by: Al Viro <viro@zeniv.linux.org.uk>
-Closes: https://lore.kernel.org/linux-fsdevel/20241101011724.GN1350452@ZenIV/T/#u
-Cc: Tyler Hicks <code@tyhicks.com>
-Cc: ecryptfs@vger.kernel.org
-Cc: Miklos Szeredi <miklos@szeredi.hu>
-Cc: Amir Goldstein <amir73il@gmail.com>
-Cc: linux-unionfs@vger.kernel.org
-Cc: Christian Brauner <brauner@kernel.org>
-Cc: linux-fsdevel@vger.kernel.org
-Reviewed-by: Christian Brauner <brauner@kernel.org>
-Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
-Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-Stable-dep-of: 777d0961ff95 ("fs: move the bdex_statx call to vfs_getattr_nosec")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- fs/ecryptfs/inode.c | 12 ++----------
- fs/overlayfs/inode.c | 10 +++++-----
- fs/overlayfs/overlayfs.h | 8 --------
- fs/stat.c | 5 +----
- include/uapi/linux/fcntl.h | 4 ----
- 5 files changed, 8 insertions(+), 31 deletions(-)
-
-diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
-index cbdf82f0183f3..a9819ddb1ab85 100644
---- a/fs/ecryptfs/inode.c
-+++ b/fs/ecryptfs/inode.c
-@@ -1008,14 +1008,6 @@ static int ecryptfs_getattr_link(struct mnt_idmap *idmap,
- return rc;
- }
-
--static int ecryptfs_do_getattr(const struct path *path, struct kstat *stat,
-- u32 request_mask, unsigned int flags)
--{
-- if (flags & AT_GETATTR_NOSEC)
-- return vfs_getattr_nosec(path, stat, request_mask, flags);
-- return vfs_getattr(path, stat, request_mask, flags);
--}
--
- static int ecryptfs_getattr(struct mnt_idmap *idmap,
- const struct path *path, struct kstat *stat,
- u32 request_mask, unsigned int flags)
-@@ -1024,8 +1016,8 @@ static int ecryptfs_getattr(struct mnt_idmap *idmap,
- struct kstat lower_stat;
- int rc;
-
-- rc = ecryptfs_do_getattr(ecryptfs_dentry_to_lower_path(dentry),
-- &lower_stat, request_mask, flags);
-+ rc = vfs_getattr_nosec(ecryptfs_dentry_to_lower_path(dentry),
-+ &lower_stat, request_mask, flags);
- if (!rc) {
- fsstack_copy_attr_all(d_inode(dentry),
- ecryptfs_inode_to_lower(d_inode(dentry)));
-diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c
-index baa54c718bd72..97dd70d631446 100644
---- a/fs/overlayfs/inode.c
-+++ b/fs/overlayfs/inode.c
-@@ -170,7 +170,7 @@ int ovl_getattr(struct mnt_idmap *idmap, const struct path *path,
-
- type = ovl_path_real(dentry, &realpath);
- old_cred = ovl_override_creds(dentry->d_sb);
-- err = ovl_do_getattr(&realpath, stat, request_mask, flags);
-+ err = vfs_getattr_nosec(&realpath, stat, request_mask, flags);
- if (err)
- goto out;
-
-@@ -195,8 +195,8 @@ int ovl_getattr(struct mnt_idmap *idmap, const struct path *path,
- (!is_dir ? STATX_NLINK : 0);
-
- ovl_path_lower(dentry, &realpath);
-- err = ovl_do_getattr(&realpath, &lowerstat, lowermask,
-- flags);
-+ err = vfs_getattr_nosec(&realpath, &lowerstat, lowermask,
-+ flags);
- if (err)
- goto out;
-
-@@ -248,8 +248,8 @@ int ovl_getattr(struct mnt_idmap *idmap, const struct path *path,
-
- ovl_path_lowerdata(dentry, &realpath);
- if (realpath.dentry) {
-- err = ovl_do_getattr(&realpath, &lowerdatastat,
-- lowermask, flags);
-+ err = vfs_getattr_nosec(&realpath, &lowerdatastat,
-+ lowermask, flags);
- if (err)
- goto out;
- } else {
-diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h
-index 500a9634ad533..63ad4511c1208 100644
---- a/fs/overlayfs/overlayfs.h
-+++ b/fs/overlayfs/overlayfs.h
-@@ -412,14 +412,6 @@ static inline bool ovl_open_flags_need_copy_up(int flags)
- return ((OPEN_FMODE(flags) & FMODE_WRITE) || (flags & O_TRUNC));
- }
-
--static inline int ovl_do_getattr(const struct path *path, struct kstat *stat,
-- u32 request_mask, unsigned int flags)
--{
-- if (flags & AT_GETATTR_NOSEC)
-- return vfs_getattr_nosec(path, stat, request_mask, flags);
-- return vfs_getattr(path, stat, request_mask, flags);
--}
--
- /* util.c */
- int ovl_get_write_access(struct dentry *dentry);
- void ovl_put_write_access(struct dentry *dentry);
-diff --git a/fs/stat.c b/fs/stat.c
-index 41e598376d7e3..cbc0fcd4fba39 100644
---- a/fs/stat.c
-+++ b/fs/stat.c
-@@ -165,7 +165,7 @@ int vfs_getattr_nosec(const struct path *path, struct kstat *stat,
- if (inode->i_op->getattr)
- return inode->i_op->getattr(idmap, path, stat,
- request_mask,
-- query_flags | AT_GETATTR_NOSEC);
-+ query_flags);
-
- generic_fillattr(idmap, request_mask, inode, stat);
- return 0;
-@@ -198,9 +198,6 @@ int vfs_getattr(const struct path *path, struct kstat *stat,
- {
- int retval;
-
-- if (WARN_ON_ONCE(query_flags & AT_GETATTR_NOSEC))
-- return -EPERM;
--
- retval = security_inode_getattr(path);
- if (retval)
- return retval;
-diff --git a/include/uapi/linux/fcntl.h b/include/uapi/linux/fcntl.h
-index 87e2dec79fea4..a40833bf2855e 100644
---- a/include/uapi/linux/fcntl.h
-+++ b/include/uapi/linux/fcntl.h
-@@ -154,8 +154,4 @@
- usable with open_by_handle_at(2). */
- #define AT_HANDLE_MNT_ID_UNIQUE 0x001 /* Return the u64 unique mount ID. */
-
--#if defined(__KERNEL__)
--#define AT_GETATTR_NOSEC 0x80000000
--#endif
--
- #endif /* _UAPI_LINUX_FCNTL_H */
---
-2.39.5
-
+++ /dev/null
-From 6fe5034f85c4cb6e3574c78f6546f5e3e0dc7f74 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Sun, 19 Jan 2025 10:59:47 +0800
-Subject: fs/stat.c: avoid harmless garbage value problem in vfs_statx_path()
-
-From: Su Hui <suhui@nfschina.com>
-
-[ Upstream commit 0fac3ed473dd2955053be6671cdd747807f5e488 ]
-
-Clang static checker(scan-build) warning:
-fs/stat.c:287:21: warning: The left expression of the compound assignment is
-an uninitialized value. The computed value will also be garbage.
- 287 | stat->result_mask |= STATX_MNT_ID_UNIQUE;
- | ~~~~~~~~~~~~~~~~~ ^
-fs/stat.c:290:21: warning: The left expression of the compound assignment is
-an uninitialized value. The computed value will also be garbage.
- 290 | stat->result_mask |= STATX_MNT_ID;
-
-When vfs_getattr() failed because of security_inode_getattr(), 'stat' is
-uninitialized. In this case, there is a harmless garbage problem in
-vfs_statx_path(). It's better to return error directly when
-vfs_getattr() failed, avoiding garbage value and more clearly.
-
-Signed-off-by: Su Hui <suhui@nfschina.com>
-Link: https://lore.kernel.org/r/20250119025946.1168957-1-suhui@nfschina.com
-Signed-off-by: Christian Brauner <brauner@kernel.org>
-Stable-dep-of: 777d0961ff95 ("fs: move the bdex_statx call to vfs_getattr_nosec")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- fs/stat.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/fs/stat.c b/fs/stat.c
-index cbc0fcd4fba39..b399b881bbbf9 100644
---- a/fs/stat.c
-+++ b/fs/stat.c
-@@ -246,6 +246,8 @@ static int vfs_statx_path(struct path *path, int flags, struct kstat *stat,
- u32 request_mask)
- {
- int error = vfs_getattr(path, stat, request_mask, flags);
-+ if (error)
-+ return error;
-
- if (request_mask & STATX_MNT_ID_UNIQUE) {
- stat->mnt_id = real_mount(path->mnt)->mnt_id_unique;
-@@ -267,7 +269,7 @@ static int vfs_statx_path(struct path *path, int flags, struct kstat *stat,
- if (S_ISBLK(stat->mode))
- bdev_statx(path, stat, request_mask);
-
-- return error;
-+ return 0;
- }
-
- static int vfs_statx_fd(int fd, int flags, struct kstat *stat,
---
-2.39.5
-
nfs-add-missing-selections-of-config_crc32.patch
nfsd-decrease-sc_count-directly-if-fail-to-queue-dl_.patch
i2c-atr-fix-wrong-include.patch
-fs-simplify-getattr-interface-function-checking-at_g.patch
-fs-stat.c-avoid-harmless-garbage-value-problem-in-vf.patch
-fs-move-the-bdex_statx-call-to-vfs_getattr_nosec.patch
ftrace-fix-incorrect-hash-size-in-register_ftrace_di.patch
drm-msm-a6xx-don-t-let-ib_size-overflow.patch
bluetooth-l2cap-process-valid-commands-in-too-long-frame.patch
+++ /dev/null
-From ba72f014dfdcb5896817f3bc8f141da311a7b75d Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Thu, 17 Apr 2025 08:40:42 +0200
-Subject: fs: move the bdex_statx call to vfs_getattr_nosec
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-From: Christoph Hellwig <hch@lst.de>
-
-[ Upstream commit 777d0961ff95b26d5887fdae69900374364976f3 ]
-
-Currently bdex_statx is only called from the very high-level
-vfs_statx_path function, and thus bypassing it for in-kernel calls
-to vfs_getattr or vfs_getattr_nosec.
-
-This breaks querying the block ѕize of the underlying device in the
-loop driver and also is a pitfall for any other new kernel caller.
-
-Move the call into the lowest level helper to ensure all callers get
-the right results.
-
-Fixes: 2d985f8c6b91 ("vfs: support STATX_DIOALIGN on block devices")
-Fixes: f4774e92aab8 ("loop: take the file system minimum dio alignment into account")
-Reported-by: "Darrick J. Wong" <djwong@kernel.org>
-Signed-off-by: Christoph Hellwig <hch@lst.de>
-Link: https://lore.kernel.org/20250417064042.712140-1-hch@lst.de
-Signed-off-by: Christian Brauner <brauner@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- block/bdev.c | 3 +--
- fs/stat.c | 32 ++++++++++++++++++--------------
- include/linux/blkdev.h | 6 +++---
- 3 files changed, 22 insertions(+), 19 deletions(-)
-
-diff --git a/block/bdev.c b/block/bdev.c
-index 9d73a8fbf7f99..e5147cab21b21 100644
---- a/block/bdev.c
-+++ b/block/bdev.c
-@@ -1268,8 +1268,7 @@ void sync_bdevs(bool wait)
- /*
- * Handle STATX_{DIOALIGN, WRITE_ATOMIC} for block devices.
- */
--void bdev_statx(struct path *path, struct kstat *stat,
-- u32 request_mask)
-+void bdev_statx(const struct path *path, struct kstat *stat, u32 request_mask)
- {
- struct inode *backing_inode;
- struct block_device *bdev;
-diff --git a/fs/stat.c b/fs/stat.c
-index f13308bfdc983..3d9222807214a 100644
---- a/fs/stat.c
-+++ b/fs/stat.c
-@@ -204,12 +204,25 @@ int vfs_getattr_nosec(const struct path *path, struct kstat *stat,
- STATX_ATTR_DAX);
-
- idmap = mnt_idmap(path->mnt);
-- if (inode->i_op->getattr)
-- return inode->i_op->getattr(idmap, path, stat,
-- request_mask,
-- query_flags);
-+ if (inode->i_op->getattr) {
-+ int ret;
-+
-+ ret = inode->i_op->getattr(idmap, path, stat, request_mask,
-+ query_flags);
-+ if (ret)
-+ return ret;
-+ } else {
-+ generic_fillattr(idmap, request_mask, inode, stat);
-+ }
-+
-+ /*
-+ * If this is a block device inode, override the filesystem attributes
-+ * with the block device specific parameters that need to be obtained
-+ * from the bdev backing inode.
-+ */
-+ if (S_ISBLK(stat->mode))
-+ bdev_statx(path, stat, request_mask);
-
-- generic_fillattr(idmap, request_mask, inode, stat);
- return 0;
- }
- EXPORT_SYMBOL(vfs_getattr_nosec);
-@@ -295,15 +308,6 @@ static int vfs_statx_path(struct path *path, int flags, struct kstat *stat,
- if (path_mounted(path))
- stat->attributes |= STATX_ATTR_MOUNT_ROOT;
- stat->attributes_mask |= STATX_ATTR_MOUNT_ROOT;
--
-- /*
-- * If this is a block device inode, override the filesystem
-- * attributes with the block device specific parameters that need to be
-- * obtained from the bdev backing inode.
-- */
-- if (S_ISBLK(stat->mode))
-- bdev_statx(path, stat, request_mask);
--
- return 0;
- }
-
-diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
-index d37751789bf58..38fc78501ef2d 100644
---- a/include/linux/blkdev.h
-+++ b/include/linux/blkdev.h
-@@ -1664,7 +1664,7 @@ int sync_blockdev(struct block_device *bdev);
- int sync_blockdev_range(struct block_device *bdev, loff_t lstart, loff_t lend);
- int sync_blockdev_nowait(struct block_device *bdev);
- void sync_bdevs(bool wait);
--void bdev_statx(struct path *, struct kstat *, u32);
-+void bdev_statx(const struct path *path, struct kstat *stat, u32 request_mask);
- void printk_all_partitions(void);
- int __init early_lookup_bdev(const char *pathname, dev_t *dev);
- #else
-@@ -1682,8 +1682,8 @@ static inline int sync_blockdev_nowait(struct block_device *bdev)
- static inline void sync_bdevs(bool wait)
- {
- }
--static inline void bdev_statx(struct path *path, struct kstat *stat,
-- u32 request_mask)
-+static inline void bdev_statx(const struct path *path, struct kstat *stat,
-+ u32 request_mask)
- {
- }
- static inline void printk_all_partitions(void)
---
-2.39.5
-
i2c-atr-fix-wrong-include.patch
eventpoll-abstract-out-ep_try_send_events-helper.patch
eventpoll-set-epoll-timeout-if-it-s-in-the-future.patch
-fs-move-the-bdex_statx-call-to-vfs_getattr_nosec.patch
ftrace-fix-incorrect-hash-size-in-register_ftrace_di.patch
drm-msm-a6xx-don-t-let-ib_size-overflow.patch
bluetooth-l2cap-process-valid-commands-in-too-long-frame.patch