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:   Tue, 22 Jun 2021 09:44:19 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Zhihao Cheng <chengzhihao1@...wei.com>
Cc:     Colin King <colin.king@...onical.com>,
        Richard Weinberger <richard@....at>,
        linux-mtd@...ts.infradead.org, kernel-janitors@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ubifs: Remove a redundant null check on pointer lp

On Tue, Jun 22, 2021 at 10:38:52AM +0800, Zhihao Cheng wrote:
> 在 2021/6/21 23:22, Colin King 写道:
> > From: Colin Ian King <colin.king@...onical.com>
> > 
> > An earlier fix to replace an IS_ERR check on lp with a null check
> > on lp didn't remove a following null check on lp. The second null
> > check is redundant and can be removed.
> > 
> > Addresses-Coverity: ("Logically dead code")
> > Fixes: c770cd5190ba ("ubifs: fix an IS_ERR() vs NULL check")
> > Signed-off-by: Colin Ian King <colin.king@...onical.com>
> > ---
> >   fs/ubifs/gc.c | 2 --
> >   1 file changed, 2 deletions(-)
> > 
> > diff --git a/fs/ubifs/gc.c b/fs/ubifs/gc.c
> > index 7cc22d7317ea..465beea52176 100644
> > --- a/fs/ubifs/gc.c
> > +++ b/fs/ubifs/gc.c
> > @@ -899,8 +899,6 @@ int ubifs_gc_start_commit(struct ubifs_info *c)
> >   			err = -ENOMEM;
> >   			goto out;
> >   		}
> Hi Colin,
> I just found out about it today thanks to your patch. Commit c770cd5190ba
> ("ubifs: fix an IS_ERR() vs NULL check") did import a new problem that
> ubifs_gc_start_commit() may return -ENOMEM while syncing fs.
> I guess ubifs_fast_find_frdi_idx() return NULL pointer is the termination
> condition in while-loop, which means we cannot get a freeable index LEB in
> ubifs_gc_start_commit().

Ugh...  I'm so sorry.  My patch was clearly wrong.  I've tried before to
add a Smatch check which warns about duplicative NULL checks, but I
think this gives me a new idea to try.  Hopefully, it will prevent this
in the future.

Yeah, and it's my check which needs to be deleted, not the other one.

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ