linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dominik Brodowski <linux@dominikbrodowski.net>
To: Zhou Qingyang <zhou1615@umn.edu>
Cc: kjlu@umn.edu, Lee Jones <lee.jones@linaro.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pcmcia: rsrc_nonstatic: Fix a NULL pointer dereference in nonstatic_find_mem_region()
Date: Sun, 2 Jan 2022 18:47:27 +0100	[thread overview]
Message-ID: <YdHlL/EhEg9QEamH@owl.dominikbrodowski.net> (raw)
In-Reply-To: <20211130181142.220254-1-zhou1615@umn.edu>

Am Wed, Dec 01, 2021 at 02:11:40AM +0800 schrieb Zhou Qingyang:
> In nonstatic_find_mem_region(), pcmcia_make_resource() is assigned to
> res and used in pci_bus_alloc_resource(). There a dereference of res
> in pci_bus_alloc_resource(), which could lead to a NULL pointer
> dereference on failure of pcmcia_make_resource().
> 
> Fix this bug by adding a check of res.
> 
> This bug was found by a static analyzer. 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.
> 
> Builds with CONFIG_PCCARD_NONSTATIC=y show no new warnings,
> and our static analyzer no longer warns about this code.
> 
> Fixes: 49b1153adfe1 ("pcmcia: move all pcmcia_resource_ops providers into one module")
> Signed-off-by: Zhou Qingyang <zhou1615@umn.edu>

Same caveat as before, but applied nonetheless.

Thanks,
	Dominik

      reply	other threads:[~2022-01-02 18:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30 18:11 [PATCH] pcmcia: rsrc_nonstatic: Fix a NULL pointer dereference in nonstatic_find_mem_region() Zhou Qingyang
2022-01-02 17:47 ` Dominik Brodowski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YdHlL/EhEg9QEamH@owl.dominikbrodowski.net \
    --to=linux@dominikbrodowski.net \
    --cc=kjlu@umn.edu \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zhou1615@umn.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).