Commit 9815debf authored by yu kuai's avatar yu kuai Committed by Yang Yingliang
Browse files

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: default avataryu kuai <yukuai3@huawei.com>
Reviewed-by: default avatarHou Tao <houtao1@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent d2430f2c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment