[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20220408083935.25816-1-xiam0nd.tong@gmail.com>
Date: Fri, 8 Apr 2022 16:39:35 +0800
From: Xiaomeng Tong <xiam0nd.tong@...il.com>
To: song@...nel.org
Cc: guoqing.jiang@...ux.dev, linux-kernel@...r.kernel.org,
linux-raid@...r.kernel.org, rgoldwyn@...e.com,
stable@...r.kernel.org, xiam0nd.tong@...il.com
Subject: Re: [PATCH v2] md: fix an incorrect NULL check in sync_sbs
On Thu, 7 Apr 2022 17:36:48 -0700, Song Liu wrote:
> On Mon, Mar 28, 2022 at 1:11 AM Xiaomeng Tong <xiam0nd.tong@...il.com> wrote:
> >
> > The bug is here:
> > if (!rdev)
> >
> > The list iterator value 'rdev' will *always* be set and non-NULL
> > by rdev_for_each(), so it is incorrect to assume that the iterator
> > value will be NULL if the list is empty or no element found.
> > Otherwise it will bypass the NULL check and lead to invalid memory
> > access passing the check.
> >
> > To fix the bug, use a new variable 'iter' as the list iterator,
> > while using the original variable 'pdev' as a dedicated pointer to
>
> s/pdev/rdev/
>
Have fixed it in PATCH v3, please check it. Thank you.
>
> > point to the found element.
> >
> > Cc: stable@...r.kernel.org
> > Fixes: 2aa82191ac36c ("md-cluster: Perform a lazy update")
>
> "Fixes" should use a hash of 12 characters (13 given here). Did
> checkpatch.pl complain about it?
Have fixed it in PATCH v3, please check it. Thank you.
--
Xiaomeng Tong
Powered by blists - more mailing lists