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]
Message-ID: <YmfgqKcMmstgfz+0@casper.infradead.org>
Date:   Tue, 26 Apr 2022 13:08:08 +0100
From:   Matthew Wilcox <willy@...radead.org>
To:     Wan Jiabing <wanjiabing@...o.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Vlastimil Babka <vbabka@...e.cz>,
        David Howells <dhowells@...hat.com>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, Julia Lawall <Julia.Lawall@...ia.fr>
Subject: Re: [PATCH] mm/filemap: Fix NULL pointer dereference in
 pagecache_get_page

On Tue, Apr 26, 2022 at 04:25:48PM +0800, Wan Jiabing wrote:
> Fix following coccicheck error:
> mm/folio-compat.c:128:17-21: ERROR: folio is NULL but dereferenced.
>  	folio = __filemap_get_folio(mapping, index, fgp_flags, gfp);
> -	if ((fgp_flags & FGP_HEAD) || !folio || xa_is_value(folio))
> +	if (!folio)
> +		return NULL;
> +	if ((fgp_flags & FGP_HEAD) || xa_is_value(folio))
>  		return &folio->page;

That doesn't dereference the folio.  Coccicheck is wrong.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ