linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Miaohe Lin <linmiaohe@huawei.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Mike Kravetz <mike.kravetz@oracle.com>
Cc: <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: Fri, 8 Jan 2021 09:41:01 +0800	[thread overview]
Message-ID: <0c53d7a7-df61-9187-676b-6ba5d0829394@huawei.com> (raw)
In-Reply-To: <20210107151502.7c581d98078ba90e63553dd4@linux-foundation.org>

On 2021/1/8 7:15, Andrew Morton wrote:
> 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?

Yes, I found this by code inspection.

>> 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.
> 
> .
> 

I would take care of more when cc stable. Many thanks for both of you!


  reply	other threads:[~2021-01-08  1:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-07 12:32 Miaohe Lin
2021-01-07 19:59 ` Mike Kravetz
2021-01-07 23:15   ` Andrew Morton
2021-01-08  1:41     ` Miaohe Lin [this message]
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=0c53d7a7-df61-9187-676b-6ba5d0829394@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=akpm@linux-foundation.org \
    --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