From: Andrew Morton <akpm@linux-foundation.org>
To: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Miaohe Lin <linmiaohe@huawei.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/hugetlb: Fix potential double free in hugetlb_register_node() error path
Date: Thu, 7 Jan 2021 15:15:02 -0800 [thread overview]
Message-ID: <20210107151502.7c581d98078ba90e63553dd4@linux-foundation.org> (raw)
In-Reply-To: <a8753475-e9a8-a730-c095-086530ecdd17@oracle.com>
On Thu, 7 Jan 2021 11:59:38 -0800 Mike Kravetz <mike.kravetz@oracle.com> wrote:
> 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: <stable@vger.kernel.org>
> > ---
> > 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 <mike.kravetz@oracle.com>
>
> 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.
sysfs_create_group() will only fail if something is terribly messed up
- probably it has never happened to anyone. I don't think the
cc:stable is justified here.
next prev parent reply other threads:[~2021-01-07 23:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-07 12:32 [PATCH] mm/hugetlb: Fix potential double free in hugetlb_register_node() error path Miaohe Lin
2021-01-07 19:59 ` Mike Kravetz
2021-01-07 23:15 ` Andrew Morton [this message]
2021-01-08 1:41 ` Miaohe Lin
2021-01-09 4:36 ` Muchun Song
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210107151502.7c581d98078ba90e63553dd4@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mike.kravetz@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).