[PATCH v1 2/7] pipe, fuse: use GFP_HIGHUSER_KASAN for pipe buffer pages
From: Jeff Xu
Date: Mon Nov 16 2026 - 18:07:22 EST
Pipe buffer pages hold data in transit. Pipe writes allocate them, and
the kernel fills and drains them through kmap_local_page(). The same
holds for the page fuse_copy_fill() allocates when a request is spliced
from /dev/fuse into a pipe.
Allocate them with GFP_HIGHUSER_KASAN, so that they keep their KASAN
tagging when GFP_HIGHUSER starts to skip it later in this series.
No functional change: GFP_HIGHUSER_KASAN has the same value as
GFP_HIGHUSER at this point.
Assisted-by: LLM
Cc: Alexander Viro <viro@xxxxxxxxxxxxxxxxxx>
Cc: Christian Brauner <brauner@xxxxxxxxxx>
Cc: Jan Kara <jack@xxxxxxx>
Cc: Miklos Szeredi <miklos@xxxxxxxxxx>
Cc: linux-fsdevel@xxxxxxxxxxxxxxx
Cc: fuse-devel@xxxxxxxxxxxxxxx
Signed-off-by: Jeff Xu <jeffxu@xxxxxxxxxxxx>
---
fs/fuse/dev.c | 2 +-
fs/pipe.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 3641abb90d6b..fdcb11679dbb 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -1044,7 +1044,7 @@ static int fuse_copy_fill(struct fuse_copy_state *cs)
if (cs->nr_segs >= cs->pipe->max_usage)
return -EIO;
- page = alloc_page(GFP_HIGHUSER);
+ page = alloc_page(GFP_HIGHUSER_KASAN);
if (!page)
return -ENOMEM;
diff --git a/fs/pipe.c b/fs/pipe.c
index 4fa69192e6fb..87792ef63564 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -155,7 +155,7 @@ static void anon_pipe_prefill_and_lock(struct pipe_inode_info *pipe, size_t tota
}
while (n < need) {
- struct page *page = alloc_page(GFP_HIGHUSER | __GFP_ACCOUNT);
+ struct page *page = alloc_page(GFP_HIGHUSER_KASAN | __GFP_ACCOUNT);
if (!page)
break;
@@ -201,7 +201,7 @@ static struct page *anon_pipe_get_page(struct pipe_inode_info *pipe)
return page;
/* FWIW: This is called with pipe->mutex held */
- return alloc_page(GFP_HIGHUSER | __GFP_ACCOUNT);
+ return alloc_page(GFP_HIGHUSER_KASAN | __GFP_ACCOUNT);
}
static void anon_pipe_put_page(struct pipe_inode_info *pipe,
--
2.56.0.611.g1030f0b940-goog