lkml.org 
[lkml]   [2022]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] brcmfmac: Fix a wild pointer dereference bug in brcmf_chip_recognition()
On Tue, Jan 25, 2022 at 12:48:45AM +0800, Zhou Qingyang wrote:
> In brcmf_chip_recognition(), the return value of brcmf_chip_add_core()
> is assigned to core and is passed to brcmf_chip_sb_corerev(). In
> brcmf_chip_sb_corerev(), there exists dereference of core without check.
> the return value of brcmf_chip_add_core() could be ERR_PTR on failure of
> allocation, which could lead to a NULL pointer dereference bug.
>
> Fix this bug by adding IS_ERR check for every variable core.
>
> This bug was found by a static analyzer.
>
> Builds with 'make allyesconfig' show no new warnings,
> and our static analyzer no longer warns about this code
>
> Fixes: cb7cf7be9eba ("brcmfmac: make chip related functions host interface independent")
> Signed-off-by: Zhou Qingyang <zhou1615@umn.edu>
> ---
> The analysis employs differential checking to identify inconsistent
> security operations (e.g., checks or kfrees) between two code paths
> and confirms that the inconsistent operations are not recovered in the
> current function or the callers, so they constitute bugs.
>
> Note that, as a bug found by static analysis, it can be a false
> positive or hard to trigger. Multiple researchers have cross-reviewed
> the bug.

As stated before, umn.edu is still not allowed to contribute to the
Linux kernel. Please work with your administration to resolve this
issue.



\
 
 \ /
  Last update: 2022-01-28 11:16    [W:0.492 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site