From: Greg Kroah-Hartman Date: Mon, 9 Mar 2026 13:33:36 +0000 (+0100) Subject: 6.12-stable patches X-Git-Tag: v6.19.7~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d329f7851671f49ff5b97daa94871a53a1ea71b1;p=thirdparty%2Fkernel%2Fstable-queue.git 6.12-stable patches added patches: xattr-switch-to-class-fd.patch --- diff --git a/queue-6.12/series b/queue-6.12/series index c28bf3f3cd..ab9f63a9e8 100644 --- a/queue-6.12/series +++ b/queue-6.12/series @@ -167,3 +167,4 @@ smb-client-don-t-log-plaintext-credentials-in-cifs_set_cifscreds.patch scsi-core-fix-refcount-leak-for-tagset_refcnt.patch selftests-mptcp-more-stable-simult_flows-tests.patch selftests-mptcp-join-check-removing-signal-subflow-endp.patch +xattr-switch-to-class-fd.patch diff --git a/queue-6.12/xattr-switch-to-class-fd.patch b/queue-6.12/xattr-switch-to-class-fd.patch new file mode 100644 index 0000000000..cf313c98dd --- /dev/null +++ b/queue-6.12/xattr-switch-to-class-fd.patch @@ -0,0 +1,96 @@ +From a71874379ec8c6e788a61d71b3ad014a8d9a5c08 Mon Sep 17 00:00:00 2001 +From: Al Viro +Date: Mon, 30 Sep 2024 14:49:47 -0400 +Subject: xattr: switch to CLASS(fd) + +From: Al Viro + +commit a71874379ec8c6e788a61d71b3ad014a8d9a5c08 upstream. + +Reviewed-by: Christian Brauner +Signed-off-by: Al Viro +Signed-off-by: Greg Kroah-Hartman +--- + fs/xattr.c | 35 ++++++++++++++--------------------- + 1 file changed, 14 insertions(+), 21 deletions(-) + +--- a/fs/xattr.c ++++ b/fs/xattr.c +@@ -697,9 +697,9 @@ SYSCALL_DEFINE5(fsetxattr, int, fd, cons + int error; + + CLASS(fd, f)(fd); +- if (!fd_file(f)) +- return -EBADF; + ++ if (fd_empty(f)) ++ return -EBADF; + audit_file(fd_file(f)); + error = setxattr_copy(name, &ctx); + if (error) +@@ -809,16 +809,13 @@ SYSCALL_DEFINE4(lgetxattr, const char __ + SYSCALL_DEFINE4(fgetxattr, int, fd, const char __user *, name, + void __user *, value, size_t, size) + { +- struct fd f = fdget(fd); +- ssize_t error = -EBADF; ++ CLASS(fd, f)(fd); + +- if (!fd_file(f)) +- return error; ++ if (fd_empty(f)) ++ return -EBADF; + audit_file(fd_file(f)); +- error = getxattr(file_mnt_idmap(fd_file(f)), fd_file(f)->f_path.dentry, ++ return getxattr(file_mnt_idmap(fd_file(f)), fd_file(f)->f_path.dentry, + name, value, size); +- fdput(f); +- return error; + } + + /* +@@ -885,15 +882,12 @@ SYSCALL_DEFINE3(llistxattr, const char _ + + SYSCALL_DEFINE3(flistxattr, int, fd, char __user *, list, size_t, size) + { +- struct fd f = fdget(fd); +- ssize_t error = -EBADF; ++ CLASS(fd, f)(fd); + +- if (!fd_file(f)) +- return error; ++ if (fd_empty(f)) ++ return -EBADF; + audit_file(fd_file(f)); +- error = listxattr(fd_file(f)->f_path.dentry, list, size); +- fdput(f); +- return error; ++ return listxattr(fd_file(f)->f_path.dentry, list, size); + } + + /* +@@ -950,12 +944,12 @@ SYSCALL_DEFINE2(lremovexattr, const char + + SYSCALL_DEFINE2(fremovexattr, int, fd, const char __user *, name) + { +- struct fd f = fdget(fd); ++ CLASS(fd, f)(fd); + char kname[XATTR_NAME_MAX + 1]; +- int error = -EBADF; ++ int error; + +- if (!fd_file(f)) +- return error; ++ if (fd_empty(f)) ++ return -EBADF; + audit_file(fd_file(f)); + + error = strncpy_from_user(kname, name, sizeof(kname)); +@@ -970,7 +964,6 @@ SYSCALL_DEFINE2(fremovexattr, int, fd, c + fd_file(f)->f_path.dentry, kname); + mnt_drop_write_file(fd_file(f)); + } +- fdput(f); + return error; + } +