From: Alexei Starovoitov Date: Fri, 11 Jul 2025 17:43:55 +0000 (-0700) Subject: Merge branch 'bpf-arena-add-kfunc-for-reserving-arena-memory' X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b1fd82cbaffef05a35bd04ba2d62d96f4d8a622;p=thirdparty%2Flinux.git Merge branch 'bpf-arena-add-kfunc-for-reserving-arena-memory' Emil Tsalapatis says: ==================== bpf/arena: Add kfunc for reserving arena memory Add a new kfunc for BPF arenas that reserves a region of the mapping to prevent it from being mapped. These regions serve as guards against out-of-bounds accesses and are useful for debugging arena-related code. >From v3 (20250709015712.97099-1-emil@etsalapatis.com) ------------------------------------------------------ - Added Acked-by tags by Yonghong. - Replace hardcoded error numbers in selftests (Yonghong). - Fixed selftest for partially freeing a reserved region (Yonghong). >From v2 (20250702003351.197234-1-emil@etsalapatis.com) ------------------------------------------------------ - Removed -EALREADY and replaced with -EINVAL to bring error handling in line with the rest of the BPF code (Alexei). >From v1 (20250620031118.245601-1-emil@etsalapatis.com) ------------------------------------------------------ - Removed the additional guard range tree. Adjusted tests accordingly. Reserved regions now behave like allocated regions, and can be unreserved using bpf_arena_free_pages(). They can also be allocated from userspace through minor faults. It is up to the user to prevent erroneous frees and/or use the BPF_F_SEGV_ON_FAULT flag to catch stray userspace accesses (Alexei). - Changed terminology from guard pages to reserved pages (Alexei, Kartikeya). Signed-off-by: Emil Tsalapatis ==================== Link: https://patch.msgid.link/20250709191312.29840-1-emil@etsalapatis.com Signed-off-by: Alexei Starovoitov --- 2b1fd82cbaffef05a35bd04ba2d62d96f4d8a622