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 Cc: Christian Brauner Cc: Jan Kara Cc: Miklos Szeredi Cc: linux-fsdevel@vger.kernel.org Cc: fuse-devel@lists.linux.dev Signed-off-by: Jeff Xu --- 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