[PATCH OLK-5.10] ceph: fix a buffer leak in __ceph_setxattr()
From: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com> stable inclusion from stable-v5.10.258 commit 521e5aba857fd267624892c8dd6295f22ce0267e category: bugfix bugzilla: https://atomgit.com/src-openeuler/kernel/issues/15664 CVE: CVE-2026-52962 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=... -------------------------------- commit 5d3cc36b4e77a27ce7b686b7c59c7072bcb3fa8e upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Lin Yujun <linyujun809@h-partners.com> Signed-off-by: Pan Taixi <pantaixi1@huawei.com> --- fs/ceph/xattr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/ceph/xattr.c b/fs/ceph/xattr.c index 76322c0f6e5f..d1fd81b1b541 100644 --- a/fs/ceph/xattr.c +++ b/fs/ceph/xattr.c @@ -1130,10 +1130,11 @@ int __ceph_setxattr(struct inode *inode, const char *name, ceph_free_cap_flush(prealloc_cf); return err; 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); /* security module set xattr while filling trace */ -- 2.34.1
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://atomgit.com/openeuler/kernel/merge_requests/24893 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/UHU... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://atomgit.com/openeuler/kernel/merge_requests/24893 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/UHU...
participants (2)
-
Pan Taixi -
patchwork bot