public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Philipp Stanner <pstanner@redhat.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Johannes Berg <johannes@sipsolutions.net>,
	Randy Dunlap <rdunlap@infradead.org>, NeilBrown <neilb@suse.de>,
	John Sanpe <sanpeqf@gmail.com>,
	Kent Overstreet <kent.overstreet@gmail.com>,
	Niklas Schnelle <schnelle@linux.ibm.com>,
	Dave Jiang <dave.jiang@intel.com>,
	Uladzislau Koshchanka <koshchanka@gmail.com>,
	"Masami Hiramatsu (Google)" <mhiramat@kernel.org>,
	David Gow <davidgow@google.com>,
	Kees Cook <keescook@chromium.org>, Rae Moar <rmoar@google.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	"wuqiang.matt" <wuqiang.matt@bytedance.com>,
	Yury Norov <yury.norov@gmail.com>,
	Jason Baron <jbaron@akamai.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Marco Elver <elver@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ben Dooks <ben.dooks@codethink.co.uk>,
	dakr@redhat.com, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org, linux-arch@vger.kernel.org,
	stable@vger.kernel.org, Arnd Bergmann <arnd@kernel.org>
Subject: Re: [PATCH v6 1/4] lib/pci_iomap.c: fix cleanup bug in pci_iounmap()
Date: Wed, 31 Jan 2024 15:09:44 -0600	[thread overview]
Message-ID: <20240131210944.GA599710@bhelgaas> (raw)
In-Reply-To: <20240131090023.12331-2-pstanner@redhat.com>

On Wed, Jan 31, 2024 at 10:00:20AM +0100, Philipp Stanner wrote:
> The #ifdef for the ioport-ranges accidentally also guards iounmap(),
> potentially compiling an empty function. This would cause the mapping to
> be leaked.
> 
> Move the guard so that iounmap() will always be part of the function.

I tweaked the subject and commit log to be more explicit about what
the bug is.  Let me know if I got it wrong:

  pci_iounmap(): Fix MMIO mapping leak

  The #ifdef ARCH_HAS_GENERIC_IOPORT_MAP accidentally also guards iounmap(),
  which means MMIO mappings are leaked.

  Move the guard so we call iounmap() for MMIO mappings.

Bjorn

  reply	other threads:[~2024-01-31 21:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-31  9:00 [PATCH v6 0/4] Regather scattered PCI-Code Philipp Stanner
2024-01-31  9:00 ` [PATCH v6 1/4] lib/pci_iomap.c: fix cleanup bug in pci_iounmap() Philipp Stanner
2024-01-31 21:09   ` Bjorn Helgaas [this message]
2024-02-06  9:36     ` Philipp Stanner
2024-01-31  9:00 ` [PATCH v6 2/4] lib: move pci_iomap.c to drivers/pci/ Philipp Stanner
2024-01-31  9:00 ` [PATCH v6 3/4] lib: move pci-specific devres code " Philipp Stanner
2024-01-31  9:00 ` [PATCH v6 4/4] PCI: Move devres code from pci.c to devres.c Philipp Stanner
2024-01-31 21:12   ` Bjorn Helgaas
2024-02-06  9:37     ` Philipp Stanner
2024-01-31 21:08 ` [PATCH v6 0/4] Regather scattered PCI-Code Bjorn Helgaas
2024-02-06  9:41   ` Philipp Stanner
2024-02-06 15:34     ` Bjorn Helgaas

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=20240131210944.GA599710@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=ben.dooks@codethink.co.uk \
    --cc=bhelgaas@google.com \
    --cc=dakr@redhat.com \
    --cc=dave.jiang@intel.com \
    --cc=davidgow@google.com \
    --cc=elver@google.com \
    --cc=geert@linux-m68k.org \
    --cc=jbaron@akamai.com \
    --cc=johannes@sipsolutions.net \
    --cc=keescook@chromium.org \
    --cc=kent.overstreet@gmail.com \
    --cc=koshchanka@gmail.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=neilb@suse.de \
    --cc=pstanner@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=rmoar@google.com \
    --cc=sanpeqf@gmail.com \
    --cc=schnelle@linux.ibm.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=wuqiang.matt@bytedance.com \
    --cc=yury.norov@gmail.com \
    /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