block: fix possible memory leak in 'blk_prepare_release_queue'
hulk inclusion
category: bugfix
bugzilla: 30213
CVE: CVE-2019-19770
---------------------------
If 'kobject_name(q->kobj.parent)' is too long, 'sprintf' will trigger
memory leak.
Fix the problem by removing device name from the name of new dir, and
replace 'sprintf' with 'snprintf'.
Fixes: commit 0ebb1affa76c ("block: rename 'q->debugfs_dir' and 'q->blk_trace->dir' in blk_unregister_queue()")
Signed-off-by: Nyu kuai <yukuai3@huawei.com>
Reviewed-by: NHou Tao <houtao1@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Showing
想要评论请 注册 或 登录