lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e6f5d1e6-afe5-4225-a672-7523d04c6504@linux.ibm.com>
Date: Thu, 18 Sep 2025 10:19:38 +0530
From: Donet Tom <donettom@...ux.ibm.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Chris Mason <clm@...a.com>, David Hildenbrand <david@...hat.com>,
        Oscar Salvador <osalvador@...e.de>, Zi Yan <ziy@...dia.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Ritesh Harjani <ritesh.list@...il.com>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, "Rafael J . Wysocki" <rafael@...nel.org>,
        Danilo Krummrich <dakr@...nel.org>,
        Jonathan Cameron <Jonathan.Cameron@...wei.com>,
        Alison Schofield <alison.schofield@...el.com>,
        Yury Norov <yury.norov@...il.com>, Dave Jiang <dave.jiang@...el.com>,
        KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Subject: Re: [PATCH v2] drivers/base/node: Handle error properly in
 register_one_node()


On 9/18/25 3:18 AM, Andrew Morton wrote:
> On Wed, 17 Sep 2025 20:25:48 +0530 Donet Tom <donettom@...ux.ibm.com> wrote:
>
>>> Can this cause a double-free? Looking at register_node(), when
>>> device_register() fails, it calls put_device(&node->dev). The put_device()
>>> call triggers node_device_release() which does kfree(to_node(dev)), freeing
>>> the entire node structure. So when register_node() returns an error, the
>>> node memory is already freed, but this code calls kfree(node) again on the
>>> same memory.
>>>
>>> The call chain is: register_node()->device_register() fails->
>>> put_device()->node_device_release()->kfree(to_node(dev)).
>>
>> Thank you for pointing this out. I will address it and send a v3.
> This patch is now in mm.git's non-rebasing mm-stable branch, so no
> replacements, please.
>
> A standalone patch with
>
> 	Fixes: 786eb990cfb7 ("drivers/base/node: handle error properly in register_one_node()")
>
> is the way to go.


Sure Andrew .I will send it today.


>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ