]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ceph: fix a buffer leak in __ceph_setxattr()
authorViacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Thu, 9 Apr 2026 19:26:02 +0000 (12:26 -0700)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 11 May 2026 08:39:22 +0000 (10:39 +0200)
The old_blob in __ceph_setxattr() can store
ci->i_xattrs.prealloc_blob value during the retry.
However, it is never called the ceph_buffer_put()
for the old_blob object. This patch fixes the issue of
the buffer leak.

Cc: stable@vger.kernel.org
Signed-off-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Reviewed-by: Alex Markuze <amarkuze@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/xattr.c

index 5f87f62091a144d67bda6f2fb4a4ebb59cdf2a68..c6fcbf4283177fa6eaedc2a4e6cd68219d2d33de 100644 (file)
@@ -1294,6 +1294,7 @@ retry:
 
 do_sync:
        spin_unlock(&ci->i_ceph_lock);
+       ceph_buffer_put(old_blob);
 do_sync_unlocked:
        if (lock_snap_rwsem)
                up_read(&mdsc->snap_rwsem);