diff options
| author | Danish Khateeb <danishkhateeb03@gmail.com> | 2026-09-04 10:31:31 -0500 |
|---|---|---|
| committer | Ard Biesheuvel <ardb@kernel.org> | 2026-09-10 09:37:17 +0200 |
| commit | 7a8d764ad2f7af1a45a43a2131c95e1c7301c169 (patch) | |
| tree | aa99dde6e809d3c7a726f5f68d0b49c54f25ed54 /scripts/basic/split-include.c | |
| parent | f89563b30748bd439d86d729734d346c468b52a5 (diff) | |
| download | linux-next-7a8d764ad2f7af1a45a43a2131c95e1c7301c169.tar.gz linux-next-7a8d764ad2f7af1a45a43a2131c95e1c7301c169.zip | |
efi/capsule-loader: Replace kmap() with kmap_local_page()
kmap() is deprecated in favour of kmap_local_page(), as described in
Documentation/mm/highmem.rst.
The conversion is safe here. efi_capsule_write() maps the page and
releases it within the same call, on both the success and the fail_unmap
error path, so the mapping never escapes the thread that created it and
the stack-based unmap ordering is preserved. No atomic context is
involved: the page is allocated with alloc_page(GFP_KERNEL) just above,
and the copy_from_user() performed while the page is mapped is fine
because faults are permitted in a local kmap region.
efi_capsule_setup_info() also runs while the mapping is live, but only
reads through the pointer.
kunmap_local() is handed a pointer that has been advanced into the page,
which is fine as it masks the address back down to the page boundary.
Build-tested only, on i386 with CONFIG_HIGHMEM=y -- where
kmap_local_page() actually establishes a mapping rather than returning
the direct-map address -- and on x86_64. No new gcc or sparse warnings.
Assisted-by: LLM sparse
Signed-off-by: Danish Khateeb <danishkhateeb03@gmail.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'scripts/basic/split-include.c')
0 files changed, 0 insertions, 0 deletions
