[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPhsuW7xJhRWv6N=-KJVd3+=zX1r5nxGguxe0kOC=Fk5JtXxVQ@mail.gmail.com>
Date: Tue, 16 Nov 2021 23:23:43 -0800
From: Song Liu <song@...nel.org>
To: zhangyue <zhangyue1@...inos.cn>
Cc: linux-raid <linux-raid@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] md: fix the problem that the pointer may be double free
On Mon, Nov 15, 2021 at 6:37 PM zhangyue <zhangyue1@...inos.cn> wrote:
>
> int driver/md/md.c, if the function autorun_array() is called,
> the problem of double free may occur.
>
> in function autorun_array(), when the function do_md_run() returns an
> error, the function do_md_stop() will be called.
>
> The function do_md_run() called function md_run(), but in function
> md_run(), the pointer mddev->private may be freed.
>
> The function do_md_stop() called the function __md_stop(), but in
> function __md_stop(), the pointer mddev->private also will be freed
> without judging null.
>
> At this time, the pointer mddev->private will be double free, so it
> needs to be judged null or not.
>
> Signed-off-by: zhangyue <zhangyue1@...inos.cn>
Applied to md-fixes. Thanks!
Song
Powered by blists - more mailing lists