Re: [PATCH] mm/hugetlb: Fix potential double free in hugetlb_register_node() error path

From
Mike Kravetz <hidden>
Date
2021-01-07 20:00:46
Also in
lkml
Reply to
Miaohe Lin, 2021-01-07
On 1/7/21 4:32 AM, Miaohe Lin wrote:
In hugetlb_sysfs_add_hstate(), we would do kobject_put() on hstate_kobjs
when failed to create sysfs group but forget to set hstate_kobjs to NULL.
Then in hugetlb_register_node() error path, we may free it again via
hugetlb_unregister_node().

Fixes: a3437870160c ("hugetlb: new sysfs interface")
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: <redacted>
---
 mm/hugetlb.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Thanks, this is a potential issue that should be fixed.

Reviewed-by: Mike Kravetz <redacted>

This has been around for a long time (more than 12 years).  I suspect
nobody actually experienced this issue.  You just discovered via code
inspection.  Correct?
At one time cc stable would not be accepted for this type of issue,
not sure about today.
-- 
Mike Kravetz
Thread (5 messages) 5 messages, 4 authors, last reply 2021-01-09
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help