Linux PARISC architecture development
 help / color / mirror / Atom feed
From: Gyokhan Kochmarla <gyokhan@amazon.de>
To: <stable@vger.kernel.org>, <gregkh@linuxfoundation.org>
Cc: Matthew Wilcox <willy@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ira Weiny <ira.weiny@intel.com>, Helge Deller <deller@gmx.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Sasha Levin <sashal@kernel.org>, <linux-mm@kvack.org>,
	<linux-parisc@vger.kernel.org>,
	"Fabio M. De Francesco" <fmdefrancesco@gmail.com>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Alexander Potapenko <glider@google.com>,
	"Andrey Konovalov" <andreyknvl@gmail.com>,
	Bagas Sanjaya <bagasdotme@gmail.com>,
	"David Sterba" <dsterba@suse.com>,
	Kees Cook <keescook@chromium.org>,
	"Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
	Tony Luck <tony.luck@intel.com>,
	Gyokhan Kochmarla <gyokhan@amazon.de>
Subject: [PATCH 5.10] highmem: round down the address passed to kunmap_flush_on_unmap()
Date: Thu, 15 Oct 2026 11:27:01 +0000	[thread overview]
Message-ID: <20261015112701.650511-1-gyokhan@amazon.de> (raw)

From: "Matthew Wilcox (Oracle)" <willy@infradead.org>

commit 88d7b12068b95731c280af8ce88e8ee9561f96de upstream.

We already round down the address in kunmap_local_indexed() which is the
other implementation of __kunmap_local().  The only implementation of
kunmap_flush_on_unmap() is PA-RISC which is expecting a page-aligned
address.  This may be causing PA-RISC to be flushing the wrong addresses
currently.

Link: https://lkml.kernel.org/r/20230126200727.1680362-1-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Fixes: 298fa1ad5571 ("highmem: Provide generic variant of kmap_atomic*")
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Cc: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Helge Deller <deller@gmx.de>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Bagas Sanjaya <bagasdotme@gmail.com>
Cc: David Sterba <dsterba@suse.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
[ 5.10 has no include/linux/highmem-internal.h and no
  kmap_local API, so __kunmap_local() does not exist. Therefore,
  I applied the __kunmap_atomic() hunk to include/linux/highmem.h ]
Signed-off-by: Gyokhan Kochmarla <gyokhan@amazon.de>
---

298fa1ad5571 ("highmem: Provide generic variant of kmap_atomic*") came
into 5.10.y in 5.10.270 (c1824fac30fa) as a Stable-dep-of 68d4d3e78150
("isofs: fix out-of-bounds page array access on empty zisofs block"),
but its follow-up 88d7b12068b9 did not. 5.15.y and 6.1.y already have
it (5.15.93 and 6.1.11).

 include/linux/highmem.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 5f7cd58db478..a2a252a93d76 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -218,7 +218,7 @@ static inline void __kunmap_atomic(void *addr)
 	 * handles re-enabling faults and preemption
 	 */
 #ifdef ARCH_HAS_FLUSH_ON_KUNMAP
-	kunmap_flush_on_unmap(addr);
+	kunmap_flush_on_unmap(PTR_ALIGN_DOWN(addr, PAGE_SIZE));
 #endif
 }
 
-- 
2.50.1


             reply	other threads:[~2026-10-15 11:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15 11:27 Gyokhan Kochmarla [this message]
2026-10-15 19:36 ` [PATCH 5.10] highmem: round down the address passed to kunmap_flush_on_unmap() Sasha Levin

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=20261015112701.650511-1-gyokhan@amazon.de \
    --to=gyokhan@amazon.de \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@gmail.com \
    --cc=bagasdotme@gmail.com \
    --cc=bigeasy@linutronix.de \
    --cc=deller@gmx.de \
    --cc=dsterba@suse.com \
    --cc=fmdefrancesco@gmail.com \
    --cc=glider@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ira.weiny@intel.com \
    --cc=keescook@chromium.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.org \
    /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