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] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 9 Oct 2014 12:10:39 +0800
From:	Xishi Qiu <qiuxishi@...wei.com>
To:	Yasuaki Ishimatsu <isimatu.yasuaki@...fujitsu.com>
CC:	<gregkh@...uxfoundation.org>, <akpm@...ux-foundation.org>,
	<stable@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<linux-mm@...ck.org>
Subject: Re: [PATCH] driver/base/node: remove unnecessary kfree of node struct
 from unregister_one_node

On 2014/10/3 18:06, Yasuaki Ishimatsu wrote:

> Commit 92d585ef067d ("numa: fix NULL pointer access and memory
> leak in unregister_one_node()") added kfree() of node struct in
> unregister_one_node(). But node struct is freed by node_device_release()
> which is called in  unregister_node(). So by adding the kfree(),

Hi,

Is this path?
unregister_node()
  device_unregister()
    device_del()
      bus_remove_device()
        device_release_driver()
          __device_release_driver()
            devres_release_all()
              release_nodes()
                dr->node.release(dev, dr->data);
                  then which function is be called?

Thanks,
Xishi Qiu

> node struct is freed two times.
> 
> While hot removing memory, the commit leads the following BUG_ON():
> 
>   kernel BUG at mm/slub.c:3346!
>   invalid opcode: 0000 [#1] SMP
>   [...]
>   Call Trace:
>    [...] unregister_one_node
>    [...] try_offline_node
>    [...] remove_memory
>    [...] acpi_memory_device_remove
>    [...] acpi_bus_trim
>    [...] acpi_bus_trim
>    [...] acpi_device_hotplug
>    [...] acpi_hotplug_work_fn
>    [...] process_one_work
>    [...] worker_thread
>    [...] ? rescuer_thread
>    [...] kthread
>    [...] ? kthread_create_on_node
>    [...] ret_from_fork
>    [...] ? kthread_create_on_node
> 
> This patch removes unnecessary kfree() from unregister_one_node().
> 
> Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@...fujitsu.com>
> Cc: Xishi Qiu <qiuxishi@...wei.com>
> Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: stable@...r.kernel.org # v3.16+
> Fixes: 92d585ef067d "numa: fix NULL pointer access and memory leak in unregister_one_node()"
> ---
>  drivers/base/node.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/base/node.c b/drivers/base/node.c
> index c6d3ae0..d51c49c 100644
> --- a/drivers/base/node.c
> +++ b/drivers/base/node.c
> @@ -603,7 +603,6 @@ void unregister_one_node(int nid)
>  		return;
> 
>  	unregister_node(node_devices[nid]);
> -	kfree(node_devices[nid]);
>  	node_devices[nid] = NULL;
>  }
> 



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ