lkml.org 
[lkml]   [2022]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2] md: fix an incorrect NULL check in sync_sbs
Date
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@gmail.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@vger.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

\
 
 \ /
  Last update: 2022-04-08 10:43    [W:0.083 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site